Changeset 108185 in webkit


Ignore:
Timestamp:
Feb 19, 2012 7:24:50 AM (12 years ago)
Author:
robert@webkit.org
Message:

CSS 2.1 failure: inline-box-002.htm fails
https://bugs.webkit.org/show_bug.cgi?id=69210

Reviewed by David Hyatt.

Source/WebCore:

Tests: css2.1/20110323/dynamic-top-change-005.htm

css2.1/20110323/dynamic-top-change-005a.htm
css2.1/20110323/dynamic-top-change-005b.htm
css2.1/20110323/inline-box-002.htm
fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed.html
fast/css/relative-positioned-block-nested-with-inline-parent-dynamic.html
fast/css/relative-positioned-block-nested-with-inline-parent-multiple-descendant-blocks-dynamic.html
fast/css/relative-positioned-block-nested-with-inline-parent.html
fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic.html
fast/css/relative-positioned-block-with-inline-ancestor-dynamic-removed.html
fast/css/relative-positioned-block-with-inline-ancestor-dynamic.html
fast/css/relative-positioned-block-with-inline-ancestor.html
fast/css/relative-positioned-block-with-inline-parent-dynamic-removed.html
fast/css/relative-positioned-block-with-inline-parent-dynamic.html
fast/css/relative-positioned-block-with-inline-parent-keeps-style.html
fast/css/relative-positioned-block-with-inline-parent.html

A block within an inline is affected by relative positioning on the inline box. Give
the anonymous block containing the block a layer and make it relative positioned. Then
calculate the offset of the anonymous block's layer by accumulating the offsets from its
inline continuation and the inline continuation's inline parents.
If the position of an inline changes from or to relative positioned then ensure that any
descendant blocks update their position and layer accordingly.

  • rendering/RenderBoxModelObject.cpp:

(): add an enum RelPosAxis
(WebCore::accumulateRelativePositionOffsets):
Total up the offsets of all relatively positioned inlines that are de-facto parents of the relatively
positioned anonymous block's child block.

(WebCore):
(WebCore::RenderBoxModelObject::relativePositionOffsetX):
Use accumulateRelativePositionOffsets when calculating the relative position offset of a relatively positioned anonymous block.

(WebCore::RenderBoxModelObject::relativePositionOffsetY): ditto

  • rendering/RenderInline.cpp:

(WebCore::hasRelPositionedInlineAncestor):
Detects if the anonymous block contains a block that is the de-facto descendant of a relatively positioned inline.

(WebCore::updateStyleOfAnonymousBlockContinuations):
Update the style's positioning for each anonymous block containing a block that is descendant from the inline whose style has changed.

(WebCore::RenderInline::styleDidChange):
If an inline changes to or from relative positioning ensure that any descendant blocks change to or from relative positioning
as well, unless they still have a relatively positioned ancestor after the current ancestor loses its relative positioning.

(WebCore::RenderInline::addChildIgnoringContinuation):
If the anonymous block contains a block that is effectively descended from a relatively positioned inline, make it relatively
positioned so the block will respect its inline ancestor's relative positioning.

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::propagateStyleToAnonymousChildren):
Preserve style position in anonymous block continuations when the parent block propagates a style change.

LayoutTests:

  • css2.1/20110323/dynamic-top-change-005-expected.html: Added.
  • css2.1/20110323/dynamic-top-change-005.htm: Added.
  • css2.1/20110323/dynamic-top-change-005a-expected.html: Added.
  • css2.1/20110323/dynamic-top-change-005a.htm: Added.
  • css2.1/20110323/dynamic-top-change-005b-expected.html: Added.
  • css2.1/20110323/dynamic-top-change-005b.htm: Added.
  • css2.1/20110323/inline-box-002-expected.html: Added.
  • css2.1/20110323/inline-box-002.htm: Added.
  • fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed.html: Added.
  • fast/css/relative-positioned-block-nested-with-inline-parent-dynamic.html: Added.
  • fast/css/relative-positioned-block-nested-with-inline-parent-multiple-descendant-blocks-dynamic.html: Added.
  • fast/css/relative-positioned-block-nested-with-inline-parent.html: Added.
  • fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic.html: Added.
  • fast/css/relative-positioned-block-with-inline-ancestor-dynamic-removed.html: Added.
  • fast/css/relative-positioned-block-with-inline-ancestor-dynamic.html: Added.
  • fast/css/relative-positioned-block-with-inline-ancestor.html: Added.
  • fast/css/relative-positioned-block-with-inline-parent-dynamic-removed.html: Added.
  • fast/css/relative-positioned-block-with-inline-parent-dynamic.html: Added.
  • fast/css/relative-positioned-block-with-inline-parent-expected.html: Added.
  • fast/css/relative-positioned-block-with-inline-parent-keeps-style.html: Added.
  • fast/css/relative-positioned-block-with-inline-parent.html: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-expected.png: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-expected.txt: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed-expected.png: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed-expected.txt: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-expected.png: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-expected.txt: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-multiple-descendant-blocks-dynamic-expected.png: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-multiple-descendant-blocks-dynamic-expected.txt: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic-expected.png: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic-expected.txt: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-dynamic-expected.png: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-dynamic-expected.txt: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-dynamic-removed-expected.png: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-dynamic-removed-expected.txt: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-expected.png: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-expected.txt: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-parent-dynamic-expected.png: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-parent-dynamic-expected.txt: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-parent-dynamic-removed-expected.png: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-parent-dynamic-removed-expected.txt: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-parent-keeps-style-expected.png: Added.
  • platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-parent-keeps-style-expected.txt: Added.
  • platform/chromium-linux/fast/encoding/utf-16-big-endian-expected.png:
  • platform/chromium-linux/fast/encoding/utf-16-little-endian-expected.png:
  • platform/chromium-linux/fast/inline/continuation-outlines-with-layers-2-expected.txt:
  • platform/chromium-linux/fast/inline/continuation-outlines-with-layers-expected.png:
  • platform/chromium-linux/fast/repaint/transform-absolute-in-positioned-container-expected.png:
  • platform/chromium-win/fast/encoding/utf-16-big-endian-expected.txt:
  • platform/chromium-win/fast/encoding/utf-16-little-endian-expected.txt:
  • platform/chromium-win/fast/inline/continuation-outlines-with-layers-expected.txt:
  • platform/chromium-win/fast/repaint/transform-absolute-in-positioned-container-expected.txt:
  • platform/chromium/test_expectations.txt: Suppress existing tests until results rebaselined.
  • platform/gtk/test_expectations.txt: ditto
  • platform/mac/test_expectations.txt: ditto
  • platform/qt/test_expectations.txt: ditto
  • platform/win/Skipped: ditto
Location:
trunk
Files:
43 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r108183 r108185  
     12012-02-18  Robert Hogan  <robert@webkit.org>
     2
     3        CSS 2.1 failure: inline-box-002.htm fails
     4        https://bugs.webkit.org/show_bug.cgi?id=69210
     5
     6        Reviewed by David Hyatt.
     7
     8        * css2.1/20110323/dynamic-top-change-005-expected.html: Added.
     9        * css2.1/20110323/dynamic-top-change-005.htm: Added.
     10        * css2.1/20110323/dynamic-top-change-005a-expected.html: Added.
     11        * css2.1/20110323/dynamic-top-change-005a.htm: Added.
     12        * css2.1/20110323/dynamic-top-change-005b-expected.html: Added.
     13        * css2.1/20110323/dynamic-top-change-005b.htm: Added.
     14        * css2.1/20110323/inline-box-002-expected.html: Added.
     15        * css2.1/20110323/inline-box-002.htm: Added.
     16        * fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed.html: Added.
     17        * fast/css/relative-positioned-block-nested-with-inline-parent-dynamic.html: Added.
     18        * fast/css/relative-positioned-block-nested-with-inline-parent-multiple-descendant-blocks-dynamic.html: Added.
     19        * fast/css/relative-positioned-block-nested-with-inline-parent.html: Added.
     20        * fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic.html: Added.
     21        * fast/css/relative-positioned-block-with-inline-ancestor-dynamic-removed.html: Added.
     22        * fast/css/relative-positioned-block-with-inline-ancestor-dynamic.html: Added.
     23        * fast/css/relative-positioned-block-with-inline-ancestor.html: Added.
     24        * fast/css/relative-positioned-block-with-inline-parent-dynamic-removed.html: Added.
     25        * fast/css/relative-positioned-block-with-inline-parent-dynamic.html: Added.
     26        * fast/css/relative-positioned-block-with-inline-parent-expected.html: Added.
     27        * fast/css/relative-positioned-block-with-inline-parent-keeps-style.html: Added.
     28        * fast/css/relative-positioned-block-with-inline-parent.html: Added.
     29        * platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-expected.png: Added.
     30        * platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-expected.txt: Added.
     31        * platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed-expected.png: Added.
     32        * platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed-expected.txt: Added.
     33        * platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-expected.png: Added.
     34        * platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-expected.txt: Added.
     35        * platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-multiple-descendant-blocks-dynamic-expected.png: Added.
     36        * platform/chromium-linux-x86/fast/css/relative-positioned-block-nested-with-inline-parent-multiple-descendant-blocks-dynamic-expected.txt: Added.
     37        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic-expected.png: Added.
     38        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic-expected.txt: Added.
     39        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-dynamic-expected.png: Added.
     40        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-dynamic-expected.txt: Added.
     41        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-dynamic-removed-expected.png: Added.
     42        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-dynamic-removed-expected.txt: Added.
     43        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-expected.png: Added.
     44        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-ancestor-expected.txt: Added.
     45        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-parent-dynamic-expected.png: Added.
     46        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-parent-dynamic-expected.txt: Added.
     47        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-parent-dynamic-removed-expected.png: Added.
     48        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-parent-dynamic-removed-expected.txt: Added.
     49        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-parent-keeps-style-expected.png: Added.
     50        * platform/chromium-linux-x86/fast/css/relative-positioned-block-with-inline-parent-keeps-style-expected.txt: Added.
     51        * platform/chromium-linux/fast/encoding/utf-16-big-endian-expected.png:
     52        * platform/chromium-linux/fast/encoding/utf-16-little-endian-expected.png:
     53        * platform/chromium-linux/fast/inline/continuation-outlines-with-layers-2-expected.txt:
     54        * platform/chromium-linux/fast/inline/continuation-outlines-with-layers-expected.png:
     55        * platform/chromium-linux/fast/repaint/transform-absolute-in-positioned-container-expected.png:
     56        * platform/chromium-win/fast/encoding/utf-16-big-endian-expected.txt:
     57        * platform/chromium-win/fast/encoding/utf-16-little-endian-expected.txt:
     58        * platform/chromium-win/fast/inline/continuation-outlines-with-layers-expected.txt:
     59        * platform/chromium-win/fast/repaint/transform-absolute-in-positioned-container-expected.txt:
     60        * platform/chromium/test_expectations.txt: Suppress existing tests until results rebaselined.
     61        * platform/gtk/test_expectations.txt: ditto
     62        * platform/mac/test_expectations.txt: ditto
     63        * platform/qt/test_expectations.txt: ditto
     64        * platform/win/Skipped: ditto
     65
    1662012-02-18  Abhishek Arya  <inferno@chromium.org>
    267
  • trunk/LayoutTests/platform/chromium-linux/fast/inline/continuation-outlines-with-layers-2-expected.txt

    r63086 r108185  
    99      RenderBlock {DIV} at (0,36) size 784x100
    1010        RenderBlock (anonymous) at (0,0) size 784x50
    11         RenderBlock (anonymous) at (0,50) size 784x0
    12           RenderBlock {DIV} at (0,0) size 784x0
    1311        RenderBlock (anonymous) at (0,50) size 784x50
    1412          RenderText {#text} at (0,0) size 0x0
     
    4240        text run at (60,0) width 50: " "
    4341        text run at (110,0) width 50: " "
     42layer at (8,102) size 784x0
     43  RenderBlock (anonymous) at (0,50) size 784x0
     44    RenderBlock {DIV} at (0,0) size 784x0
    4445layer at (8,102) size 60x50
    4546  RenderInline (relative positioned) {SPAN} at (0,0) size 60x50 [bgcolor=#FFFFFF]
  • trunk/LayoutTests/platform/chromium-win/fast/encoding/utf-16-big-endian-expected.txt

    r69281 r108185  
    1 layer at (0,0) size 785x1146
    2   RenderView at (0,0) size 785x600
     1layer at (0,0) size 792x1146
     2  RenderView at (0,0) size 785x585
    33layer at (0,0) size 785x1146
    44  RenderBlock {HTML} at (0,0) size 785x1146
     
    7171              RenderBR {BR} at (126,15) size 0x0
    7272            RenderText {#text} at (0,0) size 0x0
    73       RenderBlock (anonymous) at (0,217) size 769x62
    7473      RenderBlock (anonymous) at (0,279) size 769x0
    7574        RenderInline {SPAN} at (0,0) size 0x0
     
    469468    RenderImage {IMG} at (0,21) size 20x20
    470469    RenderText {#text} at (0,0) size 0x0
    471 layer at (28,210) size 520x62
     470layer at (23,225) size 769x62
     471  RenderBlock (anonymous) at (0,217) size 769x62
     472layer at (43,210) size 520x62
    472473  RenderTable {TABLE} at (0,0) size 520x62 [border: (1px outset #808080)]
    473474    RenderTableSection {TBODY} at (1,1) size 518x60
  • trunk/LayoutTests/platform/chromium-win/fast/encoding/utf-16-little-endian-expected.txt

    r69281 r108185  
    1 layer at (0,0) size 785x1146
    2   RenderView at (0,0) size 785x600
     1layer at (0,0) size 792x1146
     2  RenderView at (0,0) size 785x585
    33layer at (0,0) size 785x1146
    44  RenderBlock {HTML} at (0,0) size 785x1146
     
    7171              RenderBR {BR} at (126,15) size 0x0
    7272            RenderText {#text} at (0,0) size 0x0
    73       RenderBlock (anonymous) at (0,217) size 769x62
    7473      RenderBlock (anonymous) at (0,279) size 769x0
    7574        RenderInline {SPAN} at (0,0) size 0x0
     
    469468    RenderImage {IMG} at (0,21) size 20x20
    470469    RenderText {#text} at (0,0) size 0x0
    471 layer at (28,210) size 520x62
     470layer at (23,225) size 769x62
     471  RenderBlock (anonymous) at (0,217) size 769x62
     472layer at (43,210) size 520x62
    472473  RenderTable {TABLE} at (0,0) size 520x62 [border: (1px outset #808080)]
    473474    RenderTableSection {TBODY} at (1,1) size 518x60
  • trunk/LayoutTests/platform/chromium-win/fast/inline/continuation-outlines-with-layers-expected.txt

    r76837 r108185  
    99      RenderBlock {DIV} at (0,36) size 784x99
    1010        RenderBlock (anonymous) at (0,0) size 784x20
    11         RenderBlock (anonymous) at (0,38) size 784x23
    12           RenderBlock {H3} at (0,0) size 784x23
    13             RenderText {#text} at (0,0) size 146x22
    14               text run at (0,0) width 146: "Bold with margin."
    1511        RenderBlock (anonymous) at (0,79) size 784x20
    1612      RenderBlock {DIV} at (0,153) size 784x61
    1713        RenderBlock (anonymous) at (0,0) size 784x0
    18         RenderBlock (anonymous) at (0,0) size 784x23
    19           RenderBlock {H3} at (0,0) size 784x23
    20             RenderText {#text} at (0,0) size 151x22
    21               text run at (0,0) width 151: "No content before."
    2214        RenderBlock (anonymous) at (0,41) size 784x20
    2315      RenderBlock {DIV} at (0,230) size 784x61
    2416        RenderBlock (anonymous) at (0,0) size 784x20
    25         RenderBlock (anonymous) at (0,38) size 784x23
    26           RenderBlock {H3} at (0,0) size 784x23
    27             RenderText {#text} at (0,0) size 175x22
    28               text run at (0,0) width 175: "But No Content After"
    2917        RenderBlock (anonymous) at (0,79) size 784x0
    3018      RenderBlock {DIV} at (0,309) size 784x23
    3119        RenderBlock (anonymous) at (0,0) size 784x0
    32         RenderBlock (anonymous) at (0,0) size 784x23
    33           RenderBlock {H3} at (0,0) size 784x23
    34             RenderText {#text} at (0,0) size 218x22
    35               text run at (0,0) width 218: "No content before or after."
    3620        RenderBlock (anonymous) at (0,41) size 784x0
    3721layer at (8,52) size 95x19
     
    3923    RenderText {#text} at (0,0) size 95x19
    4024      text run at (0,0) width 95: "Content before."
     25layer at (8,90) size 784x23
     26  RenderBlock (anonymous) at (0,38) size 784x23
     27    RenderBlock {H3} at (0,0) size 784x23
     28      RenderText {#text} at (0,0) size 146x22
     29        text run at (0,0) width 146: "Bold with margin."
    4130layer at (8,131) size 79x19
    4231  RenderInline (relative positioned) {SPAN} at (0,0) size 79x19
     
    4534layer at (8,169) size 0x0
    4635  RenderInline (relative positioned) {SPAN} at (0,0) size 0x0
     36layer at (8,169) size 784x23
     37  RenderBlock (anonymous) at (0,0) size 784x23
     38    RenderBlock {H3} at (0,0) size 784x23
     39      RenderText {#text} at (0,0) size 151x22
     40        text run at (0,0) width 151: "No content before."
    4741layer at (8,210) size 83x19
    4842  RenderInline (relative positioned) {SPAN} at (0,0) size 83x19
     
    5347    RenderText {#text} at (0,0) size 91x19
    5448      text run at (0,0) width 91: "Content before"
     49layer at (8,284) size 784x23
     50  RenderBlock (anonymous) at (0,38) size 784x23
     51    RenderBlock {H3} at (0,0) size 784x23
     52      RenderText {#text} at (0,0) size 175x22
     53        text run at (0,0) width 175: "But No Content After"
    5554layer at (8,325) size 0x0
    5655  RenderInline (relative positioned) {SPAN} at (0,0) size 0x0
    5756layer at (8,325) size 0x0
    5857  RenderInline (relative positioned) {SPAN} at (0,0) size 0x0
     58layer at (8,325) size 784x23
     59  RenderBlock (anonymous) at (0,0) size 784x23
     60    RenderBlock {H3} at (0,0) size 784x23
     61      RenderText {#text} at (0,0) size 218x22
     62        text run at (0,0) width 218: "No content before or after."
    5963layer at (8,366) size 0x0
    6064  RenderInline (relative positioned) {SPAN} at (0,0) size 0x0
  • trunk/LayoutTests/platform/chromium-win/fast/repaint/transform-absolute-in-positioned-container-expected.txt

    r73401 r108185  
    1 layer at (0,0) size 800x600
    2   RenderView at (0,0) size 800x600
     1layer at (0,0) size 802x585
     2  RenderView at (0,0) size 800x585
    33layer at (0,0) size 800x302
    44  RenderBlock {HTML} at (0,0) size 800x302
     
    1313          text run at (342,0) width 282: ". The rotated box should be correctly redrawn."
    1414      RenderBlock (anonymous) at (0,36) size 784x20
    15       RenderBlock (anonymous) at (0,56) size 784x202
    1615      RenderBlock (anonymous) at (0,258) size 784x20
    1716        RenderText {#text} at (0,0) size 0x0
     
    2019    RenderText {#text} at (20,0) size 59x19
    2120      text run at (20,0) width 59: "Container"
    22 layer at (108,172) size 202x202
     21layer at (18,132) size 784x202
     22  RenderBlock (anonymous) at (0,56) size 784x202
     23layer at (118,232) size 202x202
    2324  RenderBlock (relative positioned) {DIV} at (0,0) size 202x202 [bgcolor=#CCCCCC] [border: (1px solid #000000)]
    2425layer at (18,334) size 20x59
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r108139 r108185  
    41824182// Needs baselines for MAC and WIN.
    41834183BUGWK76465 MAC WIN : fast/css/non-empty-span.html = IMAGE+TEXT
     4184
     4185// Need rebaselining.
     4186BUGWK69210 MAC : fast/encoding/utf-16-big-endian.html = IMAGE+TEXT
     4187BUGWK69210 MAC : fast/encoding/utf-16-little-endian.html = IMAGE+TEXT
     4188BUGWK69210 MAC : fast/inline/continuation-outlines-with-layers-2.html = TEXT
     4189BUGWK69210 MAC : fast/inline/continuation-outlines-with-layers.html = IMAGE+TEXT
  • trunk/LayoutTests/platform/gtk/test_expectations.txt

    r108073 r108185  
    101101
    102102BUGWK76639 : fast/table/multiple-captions-crash3.html = IMAGE FAIL
     103
     104// Need rebaselining.
     105BUGWK69210: fast/encoding/utf-16-big-endian.html = IMAGE+TEXT
     106BUGWK69210: fast/encoding/utf-16-little-endian.html = IMAGE+TEXT
     107BUGWK69210: fast/inline/continuation-outlines-with-layers-2.html = TEXT
     108BUGWK69210: fast/inline/continuation-outlines-with-layers.html = IMAGE+TEXT
     109BUGWK69210: fast/repaint/transform-absolute-in-positioned-container.html = IMAGE+TEXT
  • trunk/LayoutTests/platform/mac/test_expectations.txt

    r107971 r108185  
    208208BUGWK37244: tables/mozilla/bugs/bug27038-1.html = IMAGE+TEXT
    209209BUGWK37244: tables/mozilla/bugs/bug27038-2.html = IMAGE+TEXT
     210
     211// Need rebaselining.
     212BUGWK69210: fast/encoding/utf-16-big-endian.html = IMAGE+TEXT
     213BUGWK69210: fast/encoding/utf-16-little-endian.html = IMAGE+TEXT
     214BUGWK69210: fast/inline/continuation-outlines-with-layers-2.html = TEXT
     215BUGWK69210: fast/inline/continuation-outlines-with-layers.html = IMAGE+TEXT
     216BUGWK69210: fast/repaint/transform-absolute-in-positioned-container.html = IMAGE+TEXT
  • trunk/LayoutTests/platform/qt/test_expectations.txt

    r108160 r108185  
    2929// Needs baseline
    3030BUGWK76118 : fast/css/text-overflow-input.html = MISSING
     31
     32// Need rebaselining.
     33BUGWK69210: fast/encoding/utf-16-big-endian.html = IMAGE+TEXT
     34BUGWK69210: fast/encoding/utf-16-little-endian.html = IMAGE+TEXT
     35BUGWK69210: fast/inline/continuation-outlines-with-layers-2.html = TEXT
     36BUGWK69210: fast/inline/continuation-outlines-with-layers.html = IMAGE+TEXT
     37BUGWK69210: fast/repaint/transform-absolute-in-positioned-container.html = IMAGE+TEXT
  • trunk/LayoutTests/platform/win/Skipped

    r108084 r108185  
    16461646tables/mozilla/bugs/bug27038-1.html
    16471647tables/mozilla/bugs/bug27038-2.html
     1648
     1649// Need rebaselining after bug 69210.
     1650fast/encoding/utf-16-big-endian.html
     1651fast/encoding/utf-16-little-endian.html
     1652fast/inline/continuation-outlines-with-layers-2.html
     1653fast/inline/continuation-outlines-with-layers.html
     1654fast/repaint/transform-absolute-in-positioned-container.html
  • trunk/Source/WebCore/ChangeLog

    r108184 r108185  
     12012-02-18  Robert Hogan  <robert@webkit.org>
     2
     3        CSS 2.1 failure: inline-box-002.htm fails
     4        https://bugs.webkit.org/show_bug.cgi?id=69210
     5
     6        Reviewed by David Hyatt.
     7
     8        Tests: css2.1/20110323/dynamic-top-change-005.htm
     9               css2.1/20110323/dynamic-top-change-005a.htm
     10               css2.1/20110323/dynamic-top-change-005b.htm
     11               css2.1/20110323/inline-box-002.htm
     12               fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed.html
     13               fast/css/relative-positioned-block-nested-with-inline-parent-dynamic.html
     14               fast/css/relative-positioned-block-nested-with-inline-parent-multiple-descendant-blocks-dynamic.html
     15               fast/css/relative-positioned-block-nested-with-inline-parent.html
     16               fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic.html
     17               fast/css/relative-positioned-block-with-inline-ancestor-dynamic-removed.html
     18               fast/css/relative-positioned-block-with-inline-ancestor-dynamic.html
     19               fast/css/relative-positioned-block-with-inline-ancestor.html
     20               fast/css/relative-positioned-block-with-inline-parent-dynamic-removed.html
     21               fast/css/relative-positioned-block-with-inline-parent-dynamic.html
     22               fast/css/relative-positioned-block-with-inline-parent-keeps-style.html
     23               fast/css/relative-positioned-block-with-inline-parent.html
     24
     25        A block within an inline is affected by relative positioning on the inline box. Give
     26        the anonymous block containing the block a layer and make it relative positioned. Then
     27        calculate the offset of the anonymous block's layer by accumulating the offsets from its
     28        inline continuation and the inline continuation's inline parents.
     29        If the position of an inline changes from or to relative positioned then ensure that any
     30        descendant blocks update their position and layer accordingly.
     31
     32        * rendering/RenderBoxModelObject.cpp:
     33        (): add an enum RelPosAxis
     34        (WebCore::accumulateRelativePositionOffsets):
     35        Total up the offsets of all relatively positioned inlines that are de-facto parents of the relatively
     36        positioned anonymous block's child block.
     37
     38        (WebCore):
     39        (WebCore::RenderBoxModelObject::relativePositionOffsetX):
     40        Use accumulateRelativePositionOffsets when calculating the relative position offset of a relatively positioned anonymous block.
     41
     42        (WebCore::RenderBoxModelObject::relativePositionOffsetY): ditto
     43
     44        * rendering/RenderInline.cpp:
     45        (WebCore::hasRelPositionedInlineAncestor):
     46        Detects if the anonymous block contains a block that is the de-facto descendant of a relatively positioned inline.
     47
     48        (WebCore::updateStyleOfAnonymousBlockContinuations):
     49        Update the style's positioning for each anonymous block containing a block that is descendant from the inline whose style has changed.
     50
     51        (WebCore::RenderInline::styleDidChange):
     52        If an inline changes to or from relative positioning ensure that any descendant blocks change to or from relative positioning
     53        as well, unless they still have a relatively positioned ancestor after the current ancestor loses its relative positioning.
     54
     55        (WebCore::RenderInline::addChildIgnoringContinuation):
     56        If the anonymous block contains a block that is effectively descended from a relatively positioned inline, make it relatively
     57        positioned so the block will respect its inline ancestor's relative positioning.
     58
     59        * rendering/RenderObject.cpp:
     60        (WebCore::RenderObject::propagateStyleToAnonymousChildren):
     61        Preserve style position in anonymous block continuations when the parent block propagates a style change.
     62
    1632012-02-18  raman Tenneti  <rtenneti@chromium.org>
    264
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r108079 r108185  
    402402}
    403403
     404enum RelPosAxis { RelPosX, RelPosY };
     405
     406static LayoutUnit accumulateRelativePositionOffsets(const RenderObject* child, RelPosAxis axis)
     407{
     408    if (!child->isAnonymousBlock() || !child->isRelPositioned())
     409        return 0;
     410    LayoutUnit offset = 0;
     411    RenderObject* p = toRenderBlock(child)->inlineElementContinuation();
     412    while (p && p->isRenderInline()) {
     413        if (p->isRelPositioned())
     414            offset += (axis == RelPosX) ? toRenderInline(p)->relativePositionOffsetX() : toRenderInline(p)->relativePositionOffsetY();
     415        p = p->parent();
     416    }
     417    return offset;
     418}
     419
    404420LayoutUnit RenderBoxModelObject::relativePositionOffsetX() const
    405421{
     422    LayoutUnit offset = accumulateRelativePositionOffsets(this, RelPosX);
     423
    406424    // Objects that shrink to avoid floats normally use available line width when computing containing block width.  However
    407425    // in the case of relative positioning using percentages, we can't do this.  The offset should always be resolved using the
     
    412430        if (!style()->right().isAuto() && !cb->style()->isLeftToRightDirection())
    413431            return -style()->right().calcValue(cb->availableWidth());
    414         return style()->left().calcValue(cb->availableWidth());
     432        return offset + style()->left().calcValue(cb->availableWidth());
    415433    }
    416434    if (!style()->right().isAuto()) {
    417435        RenderBlock* cb = containingBlock();
    418         return -style()->right().calcValue(cb->availableWidth());
    419     }
    420     return 0;
     436        return offset + -style()->right().calcValue(cb->availableWidth());
     437    }
     438    return offset;
    421439}
    422440
    423441LayoutUnit RenderBoxModelObject::relativePositionOffsetY() const
    424442{
     443    LayoutUnit offset = accumulateRelativePositionOffsets(this, RelPosY);
     444   
    425445    RenderBlock* containingBlock = this->containingBlock();
    426 
    427446    // If the containing block of a relatively positioned element does not
    428447    // specify a height, a percentage top or bottom offset should be resolved as
     
    435454            || !style()->top().isPercent()
    436455            || containingBlock->stretchesToViewport()))
    437         return style()->top().calcValue(containingBlock->availableHeight());
     456        return offset + style()->top().calcValue(containingBlock->availableHeight());
    438457
    439458    if (!style()->bottom().isAuto()
     
    441460            || !style()->bottom().isPercent()
    442461            || containingBlock->stretchesToViewport()))
    443         return -style()->bottom().calcValue(containingBlock->availableHeight());
    444 
    445     return 0;
     462        return offset + -style()->bottom().calcValue(containingBlock->availableHeight());
     463
     464    return offset;
    446465}
    447466
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r107880 r108185  
    127127}
    128128
     129static bool hasRelPositionedInlineAncestor(RenderObject* p)
     130{
     131    while (p && p->isRenderInline()) {
     132        if (p->isRelPositioned())
     133            return true;
     134        p = p->parent();
     135    }
     136    return false;
     137}
     138
     139static void updateStyleOfAnonymousBlockContinuations(RenderObject* block, const RenderStyle* newStyle, const RenderStyle* oldStyle)
     140{
     141    for (;block && block->isAnonymousBlock(); block = block->nextSibling()) {
     142        if (!toRenderBlock(block)->isAnonymousBlockContinuation() || block->style()->position() == newStyle->position())
     143            continue;
     144        // If we are no longer relatively positioned but our descendant block(s) still have a relatively positioned ancestor then
     145        // their containing anonymous block should keep its relative positioning.
     146        RenderInline* cont = toRenderBlock(block)->inlineElementContinuation();
     147        if (oldStyle->position() == RelativePosition && hasRelPositionedInlineAncestor(cont))
     148            continue;
     149        RefPtr<RenderStyle> blockStyle = RenderStyle::createAnonymousStyle(block->style());
     150        blockStyle->setPosition(newStyle->position());
     151        blockStyle->setDisplay(BLOCK);
     152        block->setStyle(blockStyle);
     153    }
     154}
     155
    129156void RenderInline::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
    130157{
     
    138165    // need to pass its style on to anyone else.
    139166    RenderStyle* newStyle = style();
    140     for (RenderInline* currCont = inlineElementContinuation(); currCont; currCont = currCont->inlineElementContinuation()) {
     167    RenderInline* continuation = inlineElementContinuation();
     168    for (RenderInline* currCont = continuation; currCont; currCont = currCont->inlineElementContinuation()) {
    141169        RenderBoxModelObject* nextCont = currCont->continuation();
    142170        currCont->setContinuation(0);
    143171        currCont->setStyle(newStyle);
    144172        currCont->setContinuation(nextCont);
     173    }
     174
     175    // If an inline's relative positioning has changed then any descendant blocks will need to change their relative positioning accordingly.
     176    // Do this by updating the position of the descendant blocks' containing anonymous blocks - there may be more than one.
     177    if (continuation && oldStyle && newStyle->position() != oldStyle->position()
     178        && (newStyle->position() == RelativePosition || (oldStyle->position() == RelativePosition))) {
     179        // If any descendant blocks exist then they will be in the next anonymous block and its siblings.
     180        RenderObject* block = containingBlock()->nextSibling();
     181        ASSERT(block && block->isAnonymousBlock());
     182        updateStyleOfAnonymousBlockContinuations(block, newStyle, oldStyle);
    145183    }
    146184
     
    246284        RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
    247285        newStyle->setDisplay(BLOCK);
     286       
     287        // If inside an inline affected by relative positioning the block needs to be affected by it too.
     288        // Giving the block a layer like this allows it to collect the x/y offsets from inline parents later.
     289        if (hasRelPositionedInlineAncestor(this))
     290            newStyle->setPosition(RelativePosition);
    248291
    249292        RenderBlock* newBox = new (renderArena()) RenderBlock(document() /* anonymous box */);
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r108127 r108185  
    19381938                newStyle->setColumnSpan(ColumnSpanAll);
    19391939        }
     1940
     1941        // Preserve the position style of anonymous block continuations as they can have relative position when
     1942        // they contain block descendants of relative positioned inlines.
     1943        if (child->isRelPositioned() && toRenderBlock(child)->isAnonymousBlockContinuation())
     1944            newStyle->setPosition(child->style()->position());
     1945
    19401946        newStyle->setDisplay(child->style()->display());
    19411947        child->setStyle(newStyle.release());
Note: See TracChangeset for help on using the changeset viewer.