Bug 276094 - [CSS 2.1 Conformance] Solving 'width: auto' of a block-level non-replaced element in normal flow with one other property set to an 'auto' value
Summary: [CSS 2.1 Conformance] Solving 'width: auto' of a block-level non-replaced ele...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: 4.7.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL: http://test.csswg.org/suites/css2.1/l...
Keywords: testcase
Depends on:
Blocks:
 
Reported: 2011-06-20 00:39 UTC by Gérard Talbot (no longer involved)
Modified: 2024-05-06 18:38 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gérard Talbot (no longer involved) 2011-06-20 00:39:06 UTC
Version:           4.6.3 (using KDE 4.6.4) 
OS:                Linux

CSS 2.1, section 10.3.3 Block-level, non-replaced elements in normal flow
http://www.w3.org/TR/CSS21/visudet.html#blockwidth
states

"
The following constraints must hold among the used values of the other properties:
'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block 
(...)
If 'width' is set to 'auto', any other 'auto' values become '0' and 'width' follows from the resulting equality.
"


Now, assume this code:

  <style type="text/css">
  div {height: 200px;}

  div#containing-block
  {
  border-right: red solid 200px;
  padding-right: 200px;
  width: 0px;
  }

  div#child
  {  
  border-right: green solid 200px;
  margin-right: -400px;
  }

(...)

  <div id="containing-block">
    <div id="child"></div>
  </div>
  
  /*
  Calculation of used width for div#child:

    margin-left             :    0px (or auto)
  + border-left-width       :    0px
  + padding-left            :    0px
  + width                   :    auto
  + padding-right           :    0px
  + border-right-width      :  200px 
  + margin-right            : -400px 
  ====================================
  width of containing block :    0px
  
  Therefore 'width: auto' must be resolved as 'width: 200px'.
  Therefore div#child's green border-right should overlap perfectly 
  div#containing-block's red border-right.
  */

Reproducible: Didn't try

Steps to Reproduce:
Load
http://test.csswg.org/suites/css2.1/latest/html4/block-non-replaced-width-008.htm
or
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/block-non-replaced-width-008.html

Actual Results:  
There is a filled green square and a filled red square, side by side.

Expected Results:  
There should be a filled green square and no red.

IE8, IE9.01, Firefox 4.0.1, Opera 10.70 and Opera 11.11 pass this test.

KDE Platform Version: 4.6.4
Konqueror version: 4.6.4
Qt Version: 4.7.2
Operating System: Linux 2.6.38-10-generic-pae i686
Distribution: Kubuntu 11.04
here.

regards, Gérard
Comment 1 Gérard Talbot (no longer involved) 2012-01-13 06:21:46 UTC
CONFIRMING
Comment 2 Christoph Cullmann 2024-05-06 18:38:30 UTC
Dear user,

KHTML (and KJS) was a long time more or less unmaintained and got removed in KF6.

Please migrate to use a QWebEngine based HTML component.

We will do no further fixes or improvements to the KF5 branches of these components beside important security fixes.

For security issues, please see:

https://kde.org/info/security/

Sorry that we did not fix this issue during the life-time of KHTML.

Greetings
Christoph Cullmann