Changeset 81992 in webkit


Ignore:
Timestamp:
Mar 25, 2011 2:57:07 PM (13 years ago)
Author:
hyatt@apple.com
Message:

Source/WebCore: https://bugs.webkit.org/show_bug.cgi?id=56909

Reviewed by Dan Bernstein.

Add a simplified normal flow layout path optimization for overflow recomputation
and for positioned objects inside relative positioned containers.

Currently there is an optimized code path for positioned objects, but as soon as
we encounter a normal flow object in the containing block chain, we lose the
optimization.

This patch adds a new type of style difference called SimplifiedLayout that is
returned when only overflow needs to be recomputed. Whenever a transform changes,
this is the hint returned now instead of a full layout.

In addition, when positioned objects need layout and start marking up the
containing block chain, we now propagate the fact that the layout is simplified
all the way up to the root, even when we encounter normal flow containing
blocks.

The layoutOnlyPositionedObjects function has been renamed to simplifiedLayout()
and is now used for all of these cases (in addition to what it handled before).

The simplified layout optimization (even in ToT) did not work correctly when
static distances needed to be recomputed. In order to make static distance
computations work with simplified layout, positioned objects now always compute
their static offsets, even if they explicitly specify left/top. That way normal
flow layout never has to re-run when the positioned object moves. This makes
movement of a positioned object along a single non-auto axis much faster when the
other axis is auto. Because this code kicked in more often for absolutely positioned
objects whose original display was inline, I went ahead and fixed the trailing space
issue with those objects. This causes a bunch of layout tests to progress.

Added fast/block/positioning/static-inline-position-dynamic.html and trailing-space-test.html.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::layoutBlock):
(WebCore::RenderBlock::adjustPositionedBlock):
(WebCore::RenderBlock::simplifiedNormalFlowLayout):
(WebCore::RenderBlock::simplifiedLayout):

  • rendering/RenderBlock.h:
  • rendering/RenderBlockLineLayout.cpp:

(WebCore::setStaticPositions):
(WebCore::RenderBlock::findNextLineBreak):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::styleDidChange):
(WebCore::RenderBox::positionLineBox):

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::styleWillChange):

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::layoutBlock):
(WebCore::RenderFlexibleBox::layoutHorizontalBox):
(WebCore::RenderFlexibleBox::layoutVerticalBox):

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::RenderObject):
(WebCore::RenderObject::adjustStyleDifference):
(WebCore::RenderObject::setStyle):
(WebCore::RenderObject::styleDidChange):

  • rendering/RenderObject.h:

(WebCore::RenderObject::needsLayout):
(WebCore::RenderObject::needsPositionedMovementLayoutOnly):
(WebCore::RenderObject::needsSimplifiedNormalFlowLayout):
(WebCore::RenderObject::setNeedsLayout):
(WebCore::RenderObject::setChildNeedsLayout):
(WebCore::RenderObject::setNeedsSimplifiedNormalFlowLayout):
(WebCore::RenderObject::markContainingBlocksForLayout):

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::layout):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::diff):

  • rendering/style/RenderStyleConstants.h:
  • rendering/svg/RenderSVGText.cpp:

(WebCore::RenderSVGText::layout):

LayoutTests: Add a simplified normal flow layout path optimization for overflow recomputation
and for positioned objects inside relative positioned containers.

Reviewed by Dan Bernstein.

Currently there is an optimized code path for positioned objects, but as soon as
we encounter a normal flow object in the containing block chain, we lose the
optimization.

This patch adds a new type of style difference called SimplifiedLayout that is
returned when only overflow needs to be recomputed. Whenever a transform changes,
this is the hint returned now instead of a full layout.

In addition, when positioned objects need layout and start marking up the
containing block chain, we now propagate the fact that the layout is simplified
all the way up to the root, even when we encounter normal flow containing
blocks.

The layoutOnlyPositionedObjects function has been renamed to simplifiedLayout()
and is now used for all of these cases (in addition to what it handled before).

The simplified layout optimization (even in ToT) did not work correctly when
static distances needed to be recomputed. In order to make static distance
computations work with simplified layout, positioned objects now always compute
their static offsets, even if they explicitly specify left/top. That way normal
flow layout never has to re-run when the positioned object moves. This makes
movement of a positioned object along a single non-auto axis much faster when the
other axis is auto. Because this code kicked in more often for absolutely positioned
objects whose original display was inline, I went ahead and fixed the trailing space
issue with those objects. This causes a bunch of layout tests to progress.

Added fast/block/positioning/static-inline-position-dynamic.html and trailing-space-test.html.

  • animations/dynamic-stylesheet-loading-expected.txt:
  • animations/keyframe-timing-functions-expected.txt:
  • fast/block/positioning/static-inline-position-dynamic.html: Added.
  • fast/block/positioning/trailing-space-test.html: Added.
  • fast/dynamic/ancestor-to-absolute-expected.txt:
  • fast/forms/input-appearance-elementFromPoint-expected.txt:
  • fast/forms/input-hit-test-border-expected.txt:
  • platform/mac/fast/block/positioning/002-expected.png:
  • platform/mac/fast/block/positioning/003-expected.png:
  • platform/mac/fast/block/positioning/004-expected.png:
  • platform/mac/fast/block/positioning/005-expected.png:
  • platform/mac/fast/block/positioning/006-expected.png:
  • platform/mac/fast/block/positioning/007-expected.png:
  • platform/mac/fast/block/positioning/008-expected.png:
  • platform/mac/fast/block/positioning/009-expected.png:
  • platform/mac/fast/block/positioning/010-expected.png:
  • platform/mac/fast/block/positioning/011-expected.png:
  • platform/mac/fast/block/positioning/012-expected.png:
  • platform/mac/fast/block/positioning/013-expected.png:
  • platform/mac/fast/block/positioning/014-expected.png:
  • platform/mac/fast/block/positioning/015-expected.png:
  • platform/mac/fast/block/positioning/016-expected.png:
  • platform/mac/fast/block/positioning/017-expected.png:
  • platform/mac/fast/block/positioning/018-expected.png:
  • platform/mac/fast/block/positioning/019-expected.png:
  • platform/mac/fast/block/positioning/020-expected.png:
  • platform/mac/fast/block/positioning/021-expected.png:
  • platform/mac/fast/block/positioning/022-expected.png:
  • platform/mac/fast/block/positioning/023-expected.png:
  • platform/mac/fast/block/positioning/024-expected.png:
  • platform/mac/fast/block/positioning/025-expected.png:
  • platform/mac/fast/block/positioning/026-expected.png:
  • platform/mac/fast/block/positioning/027-expected.png:
  • platform/mac/fast/block/positioning/028-expected.png:
  • platform/mac/fast/block/positioning/029-expected.png:
  • platform/mac/fast/block/positioning/030-expected.png:
  • platform/mac/fast/block/positioning/031-expected.png:
  • platform/mac/fast/block/positioning/032-expected.png:
  • platform/mac/fast/block/positioning/033-expected.png:
  • platform/mac/fast/block/positioning/034-expected.png:
  • platform/mac/fast/block/positioning/035-expected.png:
  • platform/mac/fast/block/positioning/036-expected.png:
  • platform/mac/fast/block/positioning/037-expected.png:
  • platform/mac/fast/block/positioning/038-expected.png:
  • platform/mac/fast/block/positioning/039-expected.png:
  • platform/mac/fast/block/positioning/040-expected.png:
  • platform/mac/fast/block/positioning/041-expected.png:
  • platform/mac/fast/block/positioning/042-expected.png:
  • platform/mac/fast/block/positioning/043-expected.png:
  • platform/mac/fast/block/positioning/044-expected.png:
  • platform/mac/fast/block/positioning/045-expected.png:
  • platform/mac/fast/block/positioning/046-expected.png:
  • platform/mac/fast/block/positioning/047-expected.checksum:
  • platform/mac/fast/block/positioning/047-expected.png:
  • platform/mac/fast/block/positioning/048-expected.png:
  • platform/mac/fast/block/positioning/049-expected.png:
  • platform/mac/fast/block/positioning/050-expected.png:
  • platform/mac/fast/block/positioning/056-expected.txt:
  • platform/mac/fast/block/positioning/061-expected.png:
  • platform/mac/fast/block/positioning/062-expected.png:
  • platform/mac/fast/block/positioning/auto/005-expected.txt:
  • platform/mac/fast/block/positioning/auto/006-expected.txt:
  • platform/mac/fast/block/positioning/auto/007-expected.png:
  • platform/mac/fast/block/positioning/auto/vertical-lr/005-expected.txt:
  • platform/mac/fast/block/positioning/auto/vertical-lr/006-expected.txt:
  • platform/mac/fast/block/positioning/auto/vertical-lr/007-expected.checksum:
  • platform/mac/fast/block/positioning/auto/vertical-lr/007-expected.png:
  • platform/mac/fast/block/positioning/auto/vertical-rl/005-expected.txt:
  • platform/mac/fast/block/positioning/auto/vertical-rl/006-expected.txt:
  • platform/mac/fast/block/positioning/auto/vertical-rl/007-expected.checksum:
  • platform/mac/fast/block/positioning/auto/vertical-rl/007-expected.png:
  • platform/mac/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.txt:
  • platform/mac/fast/block/positioning/inline-block-relposition-expected.checksum:
  • platform/mac/fast/block/positioning/inline-block-relposition-expected.png:
  • platform/mac/fast/block/positioning/inline-block-relposition-expected.txt:
  • platform/mac/fast/block/positioning/move-with-auto-width-expected.png:
  • platform/mac/fast/block/positioning/negative-rel-position-expected.png:
  • platform/mac/fast/block/positioning/relative-overconstrained-expected.png:
  • platform/mac/fast/block/positioning/relative-overflow-block-expected.txt:
  • platform/mac/fast/block/positioning/static-inline-position-dynamic-expected.checksum: Added.
  • platform/mac/fast/block/positioning/static-inline-position-dynamic-expected.png: Added.
  • platform/mac/fast/block/positioning/static-inline-position-dynamic-expected.txt: Added.
  • platform/mac/fast/block/positioning/trailing-space-test-expected.checksum: Added.
  • platform/mac/fast/block/positioning/trailing-space-test-expected.png: Added.
  • platform/mac/fast/block/positioning/trailing-space-test-expected.txt: Added.
  • platform/mac/fast/clip/001-expected.txt:
  • platform/mac/fast/clip/004-expected.txt:
  • platform/mac/fast/clip/006-expected.txt:
  • platform/mac/fast/clip/007-expected.txt:
  • platform/mac/fast/clip/008-expected.txt:
  • platform/mac/fast/clip/009-expected.txt:
  • platform/mac/fast/clip/010-expected.txt:
  • platform/mac/fast/clip/011-expected.txt:
  • platform/mac/fast/clip/012-expected.txt:
  • platform/mac/fast/clip/013-expected.txt:
  • platform/mac/fast/clip/014-expected.txt:
  • platform/mac/fast/clip/nestedTransparencyClip-expected.txt:
  • platform/mac/fast/clip/outline-overflowClip-expected.txt:
  • platform/mac/fast/forms/input-appearance-preventDefault-expected.txt:
  • platform/mac/fast/invalid/014-expected.txt:
  • platform/mac/fast/layers/layer-visibility-expected.txt:
  • platform/mac/fast/repaint/layout-state-scrolloffset-expected.txt:
  • platform/mac/fast/repaint/layout-state-scrolloffset2-expected.txt:
  • platform/mac/fast/repaint/layout-state-scrolloffset3-expected.txt:
  • platform/mac/tables/mozilla/bugs/bug51140-expected.txt:
Location:
trunk
Files:
8 added
112 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r81986 r81992  
     12011-03-24  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Add a simplified normal flow layout path optimization for overflow recomputation
     6        and for positioned objects inside relative positioned containers.
     7
     8        Currently there is an optimized code path for positioned objects, but as soon as
     9        we encounter a normal flow object in the containing block chain, we lose the
     10        optimization.
     11
     12        This patch adds a new type of style difference called SimplifiedLayout that is
     13        returned when only overflow needs to be recomputed. Whenever a transform changes,
     14        this is the hint returned now instead of a full layout.
     15       
     16        In addition, when positioned objects need layout and start marking up the
     17        containing block chain, we now propagate the fact that the layout is simplified
     18        all the way up to the root, even when we encounter normal flow containing
     19        blocks.
     20       
     21        The layoutOnlyPositionedObjects function has been renamed to simplifiedLayout()
     22        and is now used for all of these cases (in addition to what it handled before).
     23       
     24        The simplified layout optimization (even in ToT) did not work correctly when
     25        static distances needed to be recomputed. In order to make static distance
     26        computations work with simplified layout, positioned objects now always compute
     27        their static offsets, even if they explicitly specify left/top.  That way normal
     28        flow layout never has to re-run when the positioned object moves.  This makes
     29        movement of a positioned object along a single non-auto axis much faster when the
     30        other axis is auto. Because this code kicked in more often for absolutely positioned
     31        objects whose original display was inline, I went ahead and fixed the trailing space
     32        issue with those objects.  This causes a bunch of layout tests to progress.
     33
     34        Added fast/block/positioning/static-inline-position-dynamic.html and trailing-space-test.html.
     35
     36        * animations/dynamic-stylesheet-loading-expected.txt:
     37        * animations/keyframe-timing-functions-expected.txt:
     38        * fast/block/positioning/static-inline-position-dynamic.html: Added.
     39        * fast/block/positioning/trailing-space-test.html: Added.
     40        * fast/dynamic/ancestor-to-absolute-expected.txt:
     41        * fast/forms/input-appearance-elementFromPoint-expected.txt:
     42        * fast/forms/input-hit-test-border-expected.txt:
     43        * platform/mac/fast/block/positioning/002-expected.png:
     44        * platform/mac/fast/block/positioning/003-expected.png:
     45        * platform/mac/fast/block/positioning/004-expected.png:
     46        * platform/mac/fast/block/positioning/005-expected.png:
     47        * platform/mac/fast/block/positioning/006-expected.png:
     48        * platform/mac/fast/block/positioning/007-expected.png:
     49        * platform/mac/fast/block/positioning/008-expected.png:
     50        * platform/mac/fast/block/positioning/009-expected.png:
     51        * platform/mac/fast/block/positioning/010-expected.png:
     52        * platform/mac/fast/block/positioning/011-expected.png:
     53        * platform/mac/fast/block/positioning/012-expected.png:
     54        * platform/mac/fast/block/positioning/013-expected.png:
     55        * platform/mac/fast/block/positioning/014-expected.png:
     56        * platform/mac/fast/block/positioning/015-expected.png:
     57        * platform/mac/fast/block/positioning/016-expected.png:
     58        * platform/mac/fast/block/positioning/017-expected.png:
     59        * platform/mac/fast/block/positioning/018-expected.png:
     60        * platform/mac/fast/block/positioning/019-expected.png:
     61        * platform/mac/fast/block/positioning/020-expected.png:
     62        * platform/mac/fast/block/positioning/021-expected.png:
     63        * platform/mac/fast/block/positioning/022-expected.png:
     64        * platform/mac/fast/block/positioning/023-expected.png:
     65        * platform/mac/fast/block/positioning/024-expected.png:
     66        * platform/mac/fast/block/positioning/025-expected.png:
     67        * platform/mac/fast/block/positioning/026-expected.png:
     68        * platform/mac/fast/block/positioning/027-expected.png:
     69        * platform/mac/fast/block/positioning/028-expected.png:
     70        * platform/mac/fast/block/positioning/029-expected.png:
     71        * platform/mac/fast/block/positioning/030-expected.png:
     72        * platform/mac/fast/block/positioning/031-expected.png:
     73        * platform/mac/fast/block/positioning/032-expected.png:
     74        * platform/mac/fast/block/positioning/033-expected.png:
     75        * platform/mac/fast/block/positioning/034-expected.png:
     76        * platform/mac/fast/block/positioning/035-expected.png:
     77        * platform/mac/fast/block/positioning/036-expected.png:
     78        * platform/mac/fast/block/positioning/037-expected.png:
     79        * platform/mac/fast/block/positioning/038-expected.png:
     80        * platform/mac/fast/block/positioning/039-expected.png:
     81        * platform/mac/fast/block/positioning/040-expected.png:
     82        * platform/mac/fast/block/positioning/041-expected.png:
     83        * platform/mac/fast/block/positioning/042-expected.png:
     84        * platform/mac/fast/block/positioning/043-expected.png:
     85        * platform/mac/fast/block/positioning/044-expected.png:
     86        * platform/mac/fast/block/positioning/045-expected.png:
     87        * platform/mac/fast/block/positioning/046-expected.png:
     88        * platform/mac/fast/block/positioning/047-expected.checksum:
     89        * platform/mac/fast/block/positioning/047-expected.png:
     90        * platform/mac/fast/block/positioning/048-expected.png:
     91        * platform/mac/fast/block/positioning/049-expected.png:
     92        * platform/mac/fast/block/positioning/050-expected.png:
     93        * platform/mac/fast/block/positioning/056-expected.txt:
     94        * platform/mac/fast/block/positioning/061-expected.png:
     95        * platform/mac/fast/block/positioning/062-expected.png:
     96        * platform/mac/fast/block/positioning/auto/005-expected.txt:
     97        * platform/mac/fast/block/positioning/auto/006-expected.txt:
     98        * platform/mac/fast/block/positioning/auto/007-expected.png:
     99        * platform/mac/fast/block/positioning/auto/vertical-lr/005-expected.txt:
     100        * platform/mac/fast/block/positioning/auto/vertical-lr/006-expected.txt:
     101        * platform/mac/fast/block/positioning/auto/vertical-lr/007-expected.checksum:
     102        * platform/mac/fast/block/positioning/auto/vertical-lr/007-expected.png:
     103        * platform/mac/fast/block/positioning/auto/vertical-rl/005-expected.txt:
     104        * platform/mac/fast/block/positioning/auto/vertical-rl/006-expected.txt:
     105        * platform/mac/fast/block/positioning/auto/vertical-rl/007-expected.checksum:
     106        * platform/mac/fast/block/positioning/auto/vertical-rl/007-expected.png:
     107        * platform/mac/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.txt:
     108        * platform/mac/fast/block/positioning/inline-block-relposition-expected.checksum:
     109        * platform/mac/fast/block/positioning/inline-block-relposition-expected.png:
     110        * platform/mac/fast/block/positioning/inline-block-relposition-expected.txt:
     111        * platform/mac/fast/block/positioning/move-with-auto-width-expected.png:
     112        * platform/mac/fast/block/positioning/negative-rel-position-expected.png:
     113        * platform/mac/fast/block/positioning/relative-overconstrained-expected.png:
     114        * platform/mac/fast/block/positioning/relative-overflow-block-expected.txt:
     115        * platform/mac/fast/block/positioning/static-inline-position-dynamic-expected.checksum: Added.
     116        * platform/mac/fast/block/positioning/static-inline-position-dynamic-expected.png: Added.
     117        * platform/mac/fast/block/positioning/static-inline-position-dynamic-expected.txt: Added.
     118        * platform/mac/fast/block/positioning/trailing-space-test-expected.checksum: Added.
     119        * platform/mac/fast/block/positioning/trailing-space-test-expected.png: Added.
     120        * platform/mac/fast/block/positioning/trailing-space-test-expected.txt: Added.
     121        * platform/mac/fast/clip/001-expected.txt:
     122        * platform/mac/fast/clip/004-expected.txt:
     123        * platform/mac/fast/clip/006-expected.txt:
     124        * platform/mac/fast/clip/007-expected.txt:
     125        * platform/mac/fast/clip/008-expected.txt:
     126        * platform/mac/fast/clip/009-expected.txt:
     127        * platform/mac/fast/clip/010-expected.txt:
     128        * platform/mac/fast/clip/011-expected.txt:
     129        * platform/mac/fast/clip/012-expected.txt:
     130        * platform/mac/fast/clip/013-expected.txt:
     131        * platform/mac/fast/clip/014-expected.txt:
     132        * platform/mac/fast/clip/nestedTransparencyClip-expected.txt:
     133        * platform/mac/fast/clip/outline-overflowClip-expected.txt:
     134        * platform/mac/fast/forms/input-appearance-preventDefault-expected.txt:
     135        * platform/mac/fast/invalid/014-expected.txt:
     136        * platform/mac/fast/layers/layer-visibility-expected.txt:
     137        * platform/mac/fast/repaint/layout-state-scrolloffset-expected.txt:
     138        * platform/mac/fast/repaint/layout-state-scrolloffset2-expected.txt:
     139        * platform/mac/fast/repaint/layout-state-scrolloffset3-expected.txt:
     140        * platform/mac/tables/mozilla/bugs/bug51140-expected.txt:
     141
    11422011-03-25  Geoffrey Garen  <ggaren@apple.com>
    2143
  • trunk/LayoutTests/animations/dynamic-stylesheet-loading-expected.txt

    r57390 r81992  
    1 This test performs an animation and then dynamically loads a new stylesheet (which is empty). It should start animating after a 100ms delay and then stop halfway through the animation at which point we see if it is at the correct position. The loading of the stylesheet should not prevent the animation from running. 
     1This test performs an animation and then dynamically loads a new stylesheet (which is empty). It should start animating after a 100ms delay and then stop halfway through the animation at which point we see if it is at the correct position. The loading of the stylesheet should not prevent the animation from running.
    22PASS - "webkitTransform.5" property for "splash" element at 0.3s saw something close to: 100
    33
  • trunk/LayoutTests/animations/keyframe-timing-functions-expected.txt

    r39187 r81992  
    1 This test should do a linear animation. The timing-function comes from the keyframe, so this is testing whether or not the timing function in keyframes is used. 
     1This test should do a linear animation. The timing-function comes from the keyframe, so this is testing whether or not the timing function in keyframes is used.
    22PASS - "left" property for "box" element at 0.75s saw something close to: 300
    33
  • trunk/LayoutTests/fast/dynamic/ancestor-to-absolute-expected.txt

    r25132 r81992  
    1 Test that dynamically making element absolute positioned does not corrupt it's childrens layout dirty state. This passes if it does not crash. 
     1Test that dynamically making element absolute positioned does not corrupt it's childrens layout dirty state. This passes if it does not crash.
    22
  • trunk/LayoutTests/fast/forms/input-appearance-elementFromPoint-expected.txt

    r25234 r81992  
    1 This tests that elementFromPoint will get the input element. Test Passed
     1This tests that elementFromPoint will get the input element.  Test Passed 
  • trunk/LayoutTests/fast/forms/input-hit-test-border-expected.txt

    r41379 r81992  
    1 This tests hit testing on the border and padding areas of an input. Clicks in either should hit the input element. Test Passed
     1This tests hit testing on the border and padding areas of an input. Clicks in either should hit the input element.  Test Passed 
  • trunk/LayoutTests/platform/mac/fast/block/positioning/047-expected.checksum

    r71047 r81992  
    1 c6203e2d1ecd4e4292da209a89859a4b
     1f5977295ce14b2d5e2dce13ea9443788
  • trunk/LayoutTests/platform/mac/fast/block/positioning/056-expected.txt

    r25970 r81992  
    44  RenderBlock {HTML} at (0,0) size 800x600
    55    RenderBody {BODY} at (8,8) size 784x584
    6       RenderText {#text} at (0,0) size 619x18
    7         text run at (0,0) width 619: "You should see a single green stripe below. The test has failed if you don't see a perfect rectangle. "
     6      RenderText {#text} at (0,0) size 615x18
     7        text run at (0,0) width 615: "You should see a single green stripe below. The test has failed if you don't see a perfect rectangle."
    88      RenderText {#text} at (0,0) size 0x0
    99layer at (8,26) size 96x370
  • trunk/LayoutTests/platform/mac/fast/block/positioning/auto/005-expected.txt

    r63403 r81992  
    1111        text run at (0,36) width 326: "pixels of padding on the right side of the box stack. "
    1212        text run at (326,36) width 455: "The black box's top should be aligned with the end of the last line in this"
    13         text run at (0,54) width 470: "parargaph and its left side should begin right after the end of this sentence. "
     13        text run at (0,54) width 466: "parargaph and its left side should begin right after the end of this sentence."
    1414      RenderText {#text} at (0,0) size 0x0
    15 layer at (478,62) size 240x340
    16   RenderBlock (positioned) {SPAN} at (478,62) size 240x340 [border: (20px solid #000000)]
    17 layer at (598,182) size 100x100
     15layer at (474,62) size 240x340
     16  RenderBlock (positioned) {SPAN} at (474,62) size 240x340 [border: (20px solid #000000)]
     17layer at (594,182) size 100x100
    1818  RenderBlock (positioned) {DIV} at (120,120) size 100x100 [bgcolor=#008000]
    19 layer at (598,82) size 100x100
     19layer at (594,82) size 100x100
    2020  RenderBlock (positioned) {DIV} at (120,20) size 100x100 [bgcolor=#808000]
    21 layer at (598,282) size 100x100
     21layer at (594,282) size 100x100
    2222  RenderBlock (positioned) {DIV} at (120,220) size 100x100 [bgcolor=#808000]
  • trunk/LayoutTests/platform/mac/fast/block/positioning/auto/006-expected.txt

    r34507 r81992  
    1515    RenderText {#text} at (5,0) size 779x36
    1616      text run at (5,0) width 779: "The black box's top should be aligned with the end of the last line in this parargaph and its right side should begin right after"
    17       text run at (629,18) width 8 RTL: ". "
     17      text run at (633,18) width 4 RTL: "."
    1818      text run at (637,18) width 147: "the end of this sentence"
    1919    RenderText {#text} at (0,0) size 0x0
    20 layer at (397,96) size 240x340
    21   RenderBlock (positioned) {SPAN} at (389,18) size 240x340 [border: (20px solid #000000)]
    22 layer at (517,216) size 100x100
     20layer at (401,96) size 240x340
     21  RenderBlock (positioned) {SPAN} at (393,18) size 240x340 [border: (20px solid #000000)]
     22layer at (521,216) size 100x100
    2323  RenderBlock (positioned) {DIV} at (120,120) size 100x100 [bgcolor=#008000]
    24 layer at (517,116) size 100x100
     24layer at (521,116) size 100x100
    2525  RenderBlock (positioned) {DIV} at (120,20) size 100x100 [bgcolor=#808000]
    26 layer at (517,316) size 100x100
     26layer at (521,316) size 100x100
    2727  RenderBlock (positioned) {DIV} at (120,220) size 100x100 [bgcolor=#808000]
  • trunk/LayoutTests/platform/mac/fast/block/positioning/auto/vertical-lr/005-expected.txt

    r79930 r81992  
    1111        text run at (36,322) width 218: "The black box's left side should be"
    1212        text run at (54,0) width 577: "aligned with the last line in this paragraph and its top side should begin right after the end of"
    13         text run at (72,0) width 88: "this sentence. "
     13        text run at (72,0) width 84: "this sentence."
    1414      RenderText {#text} at (0,0) size 0x0
    15 layer at (80,96) size 340x240
    16   RenderBlock (positioned) {SPAN} at (80,96) size 340x240 [border: (20px solid #000000)]
    17 layer at (200,216) size 100x100
     15layer at (80,92) size 340x240
     16  RenderBlock (positioned) {SPAN} at (80,92) size 340x240 [border: (20px solid #000000)]
     17layer at (200,212) size 100x100
    1818  RenderBlock (positioned) {DIV} at (120,120) size 100x100 [bgcolor=#008000]
    19 layer at (100,216) size 100x100
     19layer at (100,212) size 100x100
    2020  RenderBlock (positioned) {DIV} at (20,120) size 100x100 [bgcolor=#808000]
    21 layer at (300,216) size 100x100
     21layer at (300,212) size 100x100
    2222  RenderBlock (positioned) {DIV} at (220,120) size 100x100 [bgcolor=#808000]
  • trunk/LayoutTests/platform/mac/fast/block/positioning/auto/vertical-lr/006-expected.txt

    r79930 r81992  
    1515    RenderText {#text} at (0,31) size 36x553
    1616      text run at (0,31) width 553: "The black box's left should be aligned with the last line in this paragraph and its top side"
    17       text run at (18,312) width 8 RTL: ". "
     17      text run at (18,316) width 4 RTL: "."
    1818      text run at (18,320) width 264: "should begin after the end of this sentence"
    1919    RenderText {#text} at (0,0) size 0x0
    20 layer at (114,80) size 340x240
    21   RenderBlock (positioned) {SPAN} at (18,72) size 340x240 [border: (20px solid #000000)]
    22 layer at (234,200) size 100x100
     20layer at (114,84) size 340x240
     21  RenderBlock (positioned) {SPAN} at (18,76) size 340x240 [border: (20px solid #000000)]
     22layer at (234,204) size 100x100
    2323  RenderBlock (positioned) {DIV} at (120,120) size 100x100 [bgcolor=#008000]
    24 layer at (134,200) size 100x100
     24layer at (134,204) size 100x100
    2525  RenderBlock (positioned) {DIV} at (20,120) size 100x100 [bgcolor=#808000]
    26 layer at (334,200) size 100x100
     26layer at (334,204) size 100x100
    2727  RenderBlock (positioned) {DIV} at (220,120) size 100x100 [bgcolor=#808000]
  • trunk/LayoutTests/platform/mac/fast/block/positioning/auto/vertical-lr/007-expected.checksum

    r79930 r81992  
    1 a6da533994f8b199ef30038629bc8e7e
     1ada3e135ce4267664f0eb15f061ef35a
  • trunk/LayoutTests/platform/mac/fast/block/positioning/auto/vertical-rl/005-expected.txt

    r79930 r81992  
    1111        text run at (36,322) width 218: "The black box's left side should be"
    1212        text run at (54,0) width 577: "aligned with the last line in this paragraph and its top side should begin right after the end of"
    13         text run at (72,0) width 88: "this sentence. "
     13        text run at (72,0) width 84: "this sentence."
    1414      RenderText {#text} at (0,0) size 0x0
    15 layer at (380,96) size 340x240
    16   RenderBlock (positioned) {SPAN} at (80,96) size 340x240 [border: (20px solid #000000)]
    17 layer at (500,216) size 100x100
     15layer at (380,92) size 340x240
     16  RenderBlock (positioned) {SPAN} at (80,92) size 340x240 [border: (20px solid #000000)]
     17layer at (500,212) size 100x100
    1818  RenderBlock (positioned) {DIV} at (120,120) size 100x100 [bgcolor=#008000]
    19 layer at (600,216) size 100x100
     19layer at (600,212) size 100x100
    2020  RenderBlock (positioned) {DIV} at (20,120) size 100x100 [bgcolor=#808000]
    21 layer at (400,216) size 100x100
     21layer at (400,212) size 100x100
    2222  RenderBlock (positioned) {DIV} at (220,120) size 100x100 [bgcolor=#808000]
  • trunk/LayoutTests/platform/mac/fast/block/positioning/auto/vertical-rl/006-expected.txt

    r79930 r81992  
    1515    RenderText {#text} at (0,22) size 36x562
    1616      text run at (0,22) width 562: "The black box's right should be aligned with the last line in this paragraph and its top side"
    17       text run at (18,312) width 8 RTL: ". "
     17      text run at (18,316) width 4 RTL: "."
    1818      text run at (18,320) width 264: "should begin after the end of this sentence"
    1919    RenderText {#text} at (0,0) size 0x0
    20 layer at (346,80) size 340x240
    21   RenderBlock (positioned) {SPAN} at (18,72) size 340x240 [border: (20px solid #000000)]
    22 layer at (466,200) size 100x100
     20layer at (346,84) size 340x240
     21  RenderBlock (positioned) {SPAN} at (18,76) size 340x240 [border: (20px solid #000000)]
     22layer at (466,204) size 100x100
    2323  RenderBlock (positioned) {DIV} at (120,120) size 100x100 [bgcolor=#008000]
    24 layer at (566,200) size 100x100
     24layer at (566,204) size 100x100
    2525  RenderBlock (positioned) {DIV} at (20,120) size 100x100 [bgcolor=#808000]
    26 layer at (366,200) size 100x100
     26layer at (366,204) size 100x100
    2727  RenderBlock (positioned) {DIV} at (220,120) size 100x100 [bgcolor=#808000]
  • trunk/LayoutTests/platform/mac/fast/block/positioning/auto/vertical-rl/007-expected.checksum

    r79930 r81992  
    1 e87b367e0b27a97a91a90a909cd4c811
     182dd94e9007b777a3483812ce50ca137
  • trunk/LayoutTests/platform/mac/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.txt

    r63403 r81992  
    44  RenderBlock {HTML} at (0,0) size 785x600
    55    RenderBody {BODY} at (8,8) size 769x584
    6       RenderText {#text} at (0,0) size 367x18
    7         text run at (0,0) width 367: "The purple box should stick to the bottom of the window. "
     6      RenderText {#text} at (0,0) size 363x18
     7        text run at (0,0) width 363: "The purple box should stick to the bottom of the window."
    88      RenderText {#text} at (0,0) size 0x0
    99      RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/block/positioning/inline-block-relposition-expected.checksum

    r78888 r81992  
    1 c4807d66cd55df1852fa44436d33f89e
     14cf57e0047b8b75399c5142cc389d9e3
  • trunk/LayoutTests/platform/mac/fast/block/positioning/inline-block-relposition-expected.txt

    r78888 r81992  
    88  RenderButton {BUTTON} at (0,2) size 100x18 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0) none (2px outset #C0C0C0)]
    99    RenderBlock (anonymous) at (8,2) size 84x13
    10       RenderText {#text} at (17,0) size 50x13
    11         text run at (17,0) width 50: "Click Me "
     10      RenderText {#text} at (19,0) size 46x13
     11        text run at (19,0) width 46: "Click Me"
    1212layer at (87,25) size 24x13
    1313  RenderBlock (positioned) {DIV} at (79,15) size 24x13
  • trunk/LayoutTests/platform/mac/fast/block/positioning/relative-overflow-block-expected.txt

    r47440 r81992  
    66      RenderText {#text} at (0,0) size 762x36
    77        text run at (0,0) width 762: "Document canvas should be big enough to fit both blue and red (relative positioned) rectangles (ie. have scrollbars if they"
    8         text run at (0,18) width 131: "don't fit to the view) "
     8        text run at (0,18) width 127: "don't fit to the view)"
    99layer at (8,44) size 504x504
    1010  RenderBlock (positioned) {DIV} at (8,44) size 504x504 [border: (2px solid #0000FF)]
  • trunk/LayoutTests/platform/mac/fast/clip/001-expected.txt

    r25970 r81992  
    44  RenderBlock {HTML} at (0,0) size 800x34
    55    RenderBody {BODY} at (8,8) size 784x18
    6       RenderText {#text} at (0,0) size 541x18
     6      RenderText {#text} at (0,0) size 537x18
    77        text run at (0,0) width 304: "You should see a 100x100 green square below. "
    8         text run at (304,0) width 237: "If you see any red, the test has failed. "
     8        text run at (304,0) width 233: "If you see any red, the test has failed."
    99layer at (8,26) size 200x200 backgroundClip at (108,126) size 100x100 clip at (108,126) size 100x100 outlineClip at (108,126) size 100x100
    1010  RenderBlock (positioned) {DIV} at (8,26) size 200x200 [bgcolor=#008000]
  • trunk/LayoutTests/platform/mac/fast/clip/004-expected.txt

    r25970 r81992  
    99        text run at (541,0) width 212: "This test is checking to make sure"
    1010        text run at (0,18) width 148: "overflow is done using "
    11         text run at (148,18) width 167: "a containing block model. "
     11        text run at (148,18) width 163: "a containing block model."
    1212      RenderText {#text} at (0,0) size 0x0
    1313layer at (8,44) size 100x100 scrollWidth 200 scrollHeight 400
  • trunk/LayoutTests/platform/mac/fast/clip/006-expected.txt

    r25970 r81992  
    1010        text run at (0,18) width 293: "checking to make sure overflow is done using "
    1111        text run at (293,18) width 478: "a containing block model, and that a fixed positioned element inside another"
    12         text run at (0,36) width 333: "fixed positioned element is not considered overflow. "
     12        text run at (0,36) width 329: "fixed positioned element is not considered overflow."
    1313      RenderText {#text} at (0,0) size 0x0
    1414layer at (8,62) size 100x100 scrollWidth 200 scrollHeight 200
  • trunk/LayoutTests/platform/mac/fast/clip/007-expected.txt

    r25970 r81992  
    1010        text run at (0,18) width 293: "checking to make sure overflow is done using "
    1111        text run at (293,18) width 446: "a containing block model, and that a fixed positioned element inside an"
    12         text run at (0,36) width 353: "absolute positioned element is not considered overflow. "
     12        text run at (0,36) width 349: "absolute positioned element is not considered overflow."
    1313      RenderText {#text} at (0,0) size 0x0
    1414layer at (8,62) size 100x100
  • trunk/LayoutTests/platform/mac/fast/clip/008-expected.txt

    r73385 r81992  
    1010        text run at (0,18) width 293: "checking to make sure overflow is done using "
    1111        text run at (293,18) width 446: "a containing block model, and that a fixed positioned element inside an"
    12         text run at (0,36) width 353: "absolute positioned element is not considered overflow. "
     12        text run at (0,36) width 349: "absolute positioned element is not considered overflow."
    1313      RenderText {#text} at (0,0) size 0x0
    1414layer at (8,62) size 100x100
  • trunk/LayoutTests/platform/mac/fast/clip/009-expected.txt

    r73385 r81992  
    88        text run at (304,0) width 237: "If you see any red, the test has failed. "
    99        text run at (541,0) width 239: "This test is checking to make sure clip"
    10         text run at (0,18) width 192: "is applying to all descendants. "
     10        text run at (0,18) width 188: "is applying to all descendants."
    1111      RenderText {#text} at (0,0) size 0x0
    1212layer at (8,44) size 100x100
  • trunk/LayoutTests/platform/mac/fast/clip/010-expected.txt

    r73385 r81992  
    88        text run at (304,0) width 237: "If you see any red, the test has failed. "
    99        text run at (541,0) width 239: "This test is checking to make sure clip"
    10         text run at (0,18) width 192: "is applying to all descendants. "
     10        text run at (0,18) width 188: "is applying to all descendants."
    1111      RenderText {#text} at (0,0) size 0x0
    1212layer at (8,44) size 100x100
  • trunk/LayoutTests/platform/mac/fast/clip/011-expected.txt

    r73385 r81992  
    88        text run at (304,0) width 237: "If you see any red, the test has failed. "
    99        text run at (541,0) width 239: "This test is checking to make sure clip"
    10         text run at (0,18) width 192: "is applying to all descendants. "
     10        text run at (0,18) width 188: "is applying to all descendants."
    1111      RenderText {#text} at (0,0) size 0x0
    1212layer at (8,44) size 100x100
  • trunk/LayoutTests/platform/mac/fast/clip/012-expected.txt

    r73385 r81992  
    88        text run at (304,0) width 237: "If you see any red, the test has failed. "
    99        text run at (541,0) width 239: "This test is checking to make sure clip"
    10         text run at (0,18) width 192: "is applying to all descendants. "
     10        text run at (0,18) width 188: "is applying to all descendants."
    1111      RenderText {#text} at (0,0) size 0x0
    1212layer at (8,44) size 100x100
  • trunk/LayoutTests/platform/mac/fast/clip/013-expected.txt

    r25970 r81992  
    88        text run at (304,0) width 237: "If you see any red, the test has failed. "
    99        text run at (541,0) width 239: "This test is checking to make sure clip"
    10         text run at (0,18) width 377: "applies to the element itself and starts from the border edge. "
     10        text run at (0,18) width 373: "applies to the element itself and starts from the border edge."
    1111      RenderText {#text} at (0,0) size 0x0
    1212layer at (8,44) size 120x120 backgroundClip at (18,54) size 100x100 clip at (18,54) size 100x100 outlineClip at (18,54) size 100x100
  • trunk/LayoutTests/platform/mac/fast/clip/014-expected.txt

    r25970 r81992  
    1010        text run at (0,18) width 617: "to make sure clip applies to the element itself, starts from the border edge, and clips out scrollbars. "
    1111        text run at (617,18) width 113: "The bottom of the"
    12         text run at (0,36) width 252: "scrolling mechanism should be clipped. "
     12        text run at (0,36) width 248: "scrolling mechanism should be clipped."
    1313      RenderText {#text} at (0,0) size 0x0
    1414layer at (8,62) size 120x220 backgroundClip at (18,72) size 100x100 clip at (18,72) size 85x100 outlineClip at (18,72) size 100x100 scrollHeight 1000
  • trunk/LayoutTests/platform/mac/fast/clip/nestedTransparencyClip-expected.txt

    r30635 r81992  
    1212layer at (8,62) size 784x18
    1313  RenderBlock {DIV} at (0,54) size 784x18
    14     RenderText {#text} at (0,0) size 42x18
    15       text run at (0,0) width 42: "Peach "
     14    RenderText {#text} at (0,0) size 38x18
     15      text run at (0,0) width 38: "Peach"
    1616    RenderText {#text} at (0,0) size 0x0
    1717layer at (8,80) size 33x18
  • trunk/LayoutTests/platform/mac/fast/clip/outline-overflowClip-expected.txt

    r63403 r81992  
    88        text run at (209,0) width 287: "It should not be clipped by the overflow rect. "
    99        text run at (496,0) width 269: "The inner div has a green outline and a red"
    10         text run at (0,18) width 49: "border. "
     10        text run at (0,18) width 45: "border."
    1111      RenderText {#text} at (0,0) size 0x0
    1212layer at (8,44) size 304x204 backgroundClip at (83,44) size 229x204 clip at (83,44) size 229x204 outlineClip at (83,44) size 229x204
    1313  RenderBlock (positioned) {DIV} at (8,44) size 304x204 [border: (2px solid #0000FF)]
    14     RenderText {#text} at (2,2) size 103x18
    15       text run at (2,2) width 103: "text in outer div "
     14    RenderText {#text} at (2,2) size 99x18
     15      text run at (2,2) width 99: "text in outer div"
    1616    RenderText {#text} at (0,0) size 0x0
    1717layer at (60,64) size 105x24 backgroundClip at (83,64) size 82x24 clip at (83,67) size 79x18 outlineClip at (83,44) size 229x204 scrollWidth 100
  • trunk/LayoutTests/platform/mac/fast/forms/input-appearance-preventDefault-expected.txt

    r63403 r81992  
    55    RenderBody {BODY} at (8,8) size 784x584
    66      RenderBR {BR} at (0,0) size 0x18
    7       RenderText {#text} at (0,18) size 666x18
    8         text run at (0,18) width 666: "This tests that preventDefault called onmousedown will prevent a caret from being placed in the text field."
    9       RenderText {#text} at (0,0) size 0x0
    10       RenderText {#text} at (0,0) size 0x0
     7      RenderText {#text} at (0,18) size 670x18
     8        text run at (0,18) width 670: "This tests that preventDefault called onmousedown will prevent a caret from being placed in the text field. "
     9      RenderText {#text} at (670,18) size 4x18
     10        text run at (670,18) width 4: " "
     11      RenderText {#text} at (674,18) size 4x18
     12        text run at (674,18) width 4: "    "
    1113layer at (12,52) size 125x19
    1214  RenderTextControl {INPUT} at (12,52) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
  • trunk/LayoutTests/platform/mac/fast/invalid/014-expected.txt

    r25970 r81992  
    55    RenderBody {BODY} at (8,8) size 784x576
    66      RenderBlock (anonymous) at (0,0) size 784x18
    7         RenderText {#text} at (0,0) size 603x18
     7        RenderText {#text} at (0,0) size 599x18
    88          text run at (0,0) width 282: "Random tests of some bizarre combinations. "
    9           text run at (282,0) width 321: "H2 should allow a form inside it, but p should not. "
     9          text run at (282,0) width 317: "H2 should allow a form inside it, but p should not."
    1010        RenderText {#text} at (0,0) size 0x0
    1111      RenderBlock {FORM} at (0,18) size 784x22
  • trunk/LayoutTests/platform/mac/fast/layers/layer-visibility-expected.txt

    r73385 r81992  
    5151    RenderText {#text} at (0,0) size 107x36
    5252      text run at (0,0) width 107: "3 green box with"
    53       text run at (0,18) width 61: "word ok: "
     53      text run at (0,18) width 57: "word ok:"
    5454    RenderText {#text} at (0,0) size 0x0
    5555layer at (278,46) size 130x34
     
    6262    RenderText {#text} at (0,0) size 107x36
    6363      text run at (0,0) width 107: "4 green box with"
    64       text run at (0,18) width 61: "word ok: "
     64      text run at (0,18) width 57: "word ok:"
    6565    RenderText {#text} at (0,0) size 0x0
    6666layer at (414,48) size 126x30
     
    7272    RenderText {#text} at (0,0) size 107x36
    7373      text run at (0,0) width 107: "5 green box with"
    74       text run at (0,18) width 61: "word ok: "
     74      text run at (0,18) width 57: "word ok:"
    7575    RenderText {#text} at (0,0) size 0x0
    7676layer at (546,46) size 130x34
     
    8484    RenderText {#text} at (0,0) size 107x36
    8585      text run at (0,0) width 107: "6 green box with"
    86       text run at (0,18) width 61: "word ok: "
     86      text run at (0,18) width 57: "word ok:"
    8787    RenderText {#text} at (0,0) size 0x0
    8888layer at (12,152) size 126x30
     
    9595    RenderText {#text} at (0,0) size 107x36
    9696      text run at (0,0) width 107: "7 green box with"
    97       text run at (0,18) width 61: "word ok: "
     97      text run at (0,18) width 57: "word ok:"
    9898    RenderText {#text} at (0,0) size 0x0
    9999layer at (148,154) size 122x26
     
    105105    RenderText {#text} at (0,0) size 122x36
    106106      text run at (0,0) width 122: "8 double green box"
    107       text run at (0,18) width 93: "with word ok: "
     107      text run at (0,18) width 89: "with word ok:"
    108108    RenderText {#text} at (0,0) size 0x0
    109109layer at (278,150) size 130x34
     
    117117    RenderText {#text} at (0,0) size 107x36
    118118      text run at (0,0) width 107: "9 green box with"
    119       text run at (0,18) width 61: "word ok: "
     119      text run at (0,18) width 57: "word ok:"
    120120    RenderText {#text} at (0,0) size 0x0
    121121layer at (416,154) size 122x26
     
    125125layer at (546,114) size 130x18
    126126  RenderBlock (relative positioned) {DIV} at (2,2) size 130x18
    127     RenderText {#text} at (0,0) size 91x18
    128       text run at (0,0) width 91: "10 green box: "
     127    RenderText {#text} at (0,0) size 87x18
     128      text run at (0,0) width 87: "10 green box:"
    129129    RenderText {#text} at (0,0) size 0x0
    130130layer at (548,134) size 126x30
     
    134134    RenderText {#text} at (0,0) size 115x36
    135135      text run at (0,0) width 115: "11 green box with"
    136       text run at (0,18) width 61: "word ok: "
     136      text run at (0,18) width 57: "word ok:"
    137137    RenderText {#text} at (0,0) size 0x0
    138138layer at (10,254) size 130x34
     
    146146    RenderText {#text} at (0,0) size 115x36
    147147      text run at (0,0) width 115: "12 green box with"
    148       text run at (0,18) width 61: "word ok: "
     148      text run at (0,18) width 57: "word ok:"
    149149    RenderText {#text} at (0,0) size 0x0
    150150layer at (144,254) size 130x34
     
    156156layer at (278,218) size 130x18
    157157  RenderBlock (relative positioned) {DIV} at (2,2) size 130x18
    158     RenderText {#text} at (0,0) size 91x18
    159       text run at (0,0) width 91: "13 green box: "
     158    RenderText {#text} at (0,0) size 87x18
     159      text run at (0,0) width 87: "13 green box:"
    160160    RenderText {#text} at (0,0) size 0x0
    161161layer at (278,236) size 130x34
     
    169169    RenderText {#text} at (0,0) size 115x36
    170170      text run at (0,0) width 115: "14 green box with"
    171       text run at (0,18) width 61: "word ok: "
     171      text run at (0,18) width 57: "word ok:"
    172172    RenderText {#text} at (0,0) size 0x0
    173173layer at (412,254) size 130x30
     
    180180    RenderText {#text} at (0,0) size 115x36
    181181      text run at (0,0) width 115: "15 green box with"
    182       text run at (0,18) width 61: "word ok: "
     182      text run at (0,18) width 57: "word ok:"
    183183    RenderText {#text} at (0,0) size 0x0
    184184layer at (546,254) size 130x30
     
    190190    RenderText {#text} at (0,0) size 115x36
    191191      text run at (0,0) width 115: "16 green box with"
    192       text run at (0,18) width 61: "word ok: "
     192      text run at (0,18) width 57: "word ok:"
    193193    RenderText {#text} at (0,0) size 0x0
    194194layer at (10,358) size 130x34
     
    205205    RenderText {#text} at (0,0) size 115x36
    206206      text run at (0,0) width 115: "17 green box with"
    207       text run at (0,18) width 61: "word ok: "
     207      text run at (0,18) width 57: "word ok:"
    208208    RenderText {#text} at (0,0) size 0x0
    209209layer at (144,358) size 130x34
     
    220220    RenderText {#text} at (0,0) size 115x36
    221221      text run at (0,0) width 115: "18 green box with"
    222       text run at (0,18) width 61: "word ok: "
     222      text run at (0,18) width 57: "word ok:"
    223223    RenderText {#text} at (0,0) size 0x0
    224224layer at (278,358) size 130x34
     
    235235    RenderText {#text} at (0,0) size 115x36
    236236      text run at (0,0) width 115: "19 green box with"
    237       text run at (0,18) width 61: "word ok: "
     237      text run at (0,18) width 57: "word ok:"
    238238    RenderText {#text} at (0,0) size 0x0
    239239layer at (412,358) size 130x34
     
    249249layer at (546,322) size 130x18
    250250  RenderBlock (relative positioned) {DIV} at (2,2) size 130x18
    251     RenderText {#text} at (0,0) size 91x18
    252       text run at (0,0) width 91: "20 green box: "
     251    RenderText {#text} at (0,0) size 87x18
     252      text run at (0,0) width 87: "20 green box:"
    253253    RenderText {#text} at (0,0) size 0x0
    254254layer at (546,340) size 130x34
     
    265265    RenderText {#text} at (0,0) size 124x36
    266266      text run at (0,0) width 124: "21 two green boxes"
    267       text run at (0,18) width 93: "with word ok: "
     267      text run at (0,18) width 89: "with word ok:"
    268268    RenderText {#text} at (0,0) size 0x0
    269269layer at (10,462) size 130x34
     
    281281    RenderText {#text} at (0,0) size 115x36
    282282      text run at (0,0) width 115: "22 green box with"
    283       text run at (0,18) width 61: "word ok: "
     283      text run at (0,18) width 57: "word ok:"
    284284    RenderText {#text} at (0,0) size 0x0
    285285layer at (146,464) size 126x30
     
    291291    RenderText {#text} at (0,0) size 115x36
    292292      text run at (0,0) width 115: "23 green box with"
    293       text run at (0,18) width 61: "word ok: "
     293      text run at (0,18) width 57: "word ok:"
    294294    RenderText {#text} at (0,0) size 0x0
    295295layer at (278,462) size 130x34
  • trunk/LayoutTests/platform/mac/fast/repaint/layout-state-scrolloffset-expected.txt

    r63403 r81992  
    44  RenderBlock {HTML} at (0,0) size 800x34
    55    RenderBody {BODY} at (8,8) size 784x18
    6       RenderText {#text} at (0,0) size 448x18
    7         text run at (0,0) width 448: "You should see the text 'after' in the inner box with no mangled pixels. "
     6      RenderText {#text} at (0,0) size 444x18
     7        text run at (0,0) width 444: "You should see the text 'after' in the inner box with no mangled pixels."
    88      RenderText {#text} at (0,0) size 0x0
    99      RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/repaint/layout-state-scrolloffset2-expected.txt

    r63403 r81992  
    44  RenderBlock {HTML} at (0,0) size 800x34
    55    RenderBody {BODY} at (8,8) size 784x18
    6       RenderText {#text} at (0,0) size 420x18
    7         text run at (0,0) width 420: "You should see the text 'after' in the inner box, no mangled pixels. "
     6      RenderText {#text} at (0,0) size 416x18
     7        text run at (0,0) width 416: "You should see the text 'after' in the inner box, no mangled pixels."
    88      RenderText {#text} at (0,0) size 0x0
    99      RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/repaint/layout-state-scrolloffset3-expected.txt

    r63403 r81992  
    44  RenderBlock {HTML} at (0,0) size 800x34
    55    RenderBody {BODY} at (8,8) size 784x18
    6       RenderText {#text} at (0,0) size 448x18
    7         text run at (0,0) width 448: "You should see the text 'after' in the inner box with no mangled pixels. "
     6      RenderText {#text} at (0,0) size 444x18
     7        text run at (0,0) width 444: "You should see the text 'after' in the inner box with no mangled pixels."
    88      RenderText {#text} at (0,0) size 0x0
    99      RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug51140-expected.txt

    r32872 r81992  
    1313          RenderText {#text} at (31,0) size 72x18
    1414            text run at (31,0) width 72: "closepopup"
    15         RenderText {#text} at (103,0) size 4x18
    16           text run at (103,0) width 4: " "
     15        RenderText {#text} at (0,0) size 0x0
    1716      RenderTable {TABLE} at (0,18) size 40x28 [border: (1px outset #808080)]
    1817        RenderTableSection {TBODY} at (1,1) size 38x26
  • trunk/Source/WebCore/ChangeLog

    r81991 r81992  
     12011-03-24  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=56909
     6       
     7        Add a simplified normal flow layout path optimization for overflow recomputation
     8        and for positioned objects inside relative positioned containers.
     9
     10        Currently there is an optimized code path for positioned objects, but as soon as
     11        we encounter a normal flow object in the containing block chain, we lose the
     12        optimization.
     13
     14        This patch adds a new type of style difference called SimplifiedLayout that is
     15        returned when only overflow needs to be recomputed. Whenever a transform changes,
     16        this is the hint returned now instead of a full layout.
     17       
     18        In addition, when positioned objects need layout and start marking up the
     19        containing block chain, we now propagate the fact that the layout is simplified
     20        all the way up to the root, even when we encounter normal flow containing
     21        blocks.
     22       
     23        The layoutOnlyPositionedObjects function has been renamed to simplifiedLayout()
     24        and is now used for all of these cases (in addition to what it handled before).
     25       
     26        The simplified layout optimization (even in ToT) did not work correctly when
     27        static distances needed to be recomputed. In order to make static distance
     28        computations work with simplified layout, positioned objects now always compute
     29        their static offsets, even if they explicitly specify left/top.  That way normal
     30        flow layout never has to re-run when the positioned object moves.  This makes
     31        movement of a positioned object along a single non-auto axis much faster when the
     32        other axis is auto. Because this code kicked in more often for absolutely positioned
     33        objects whose original display was inline, I went ahead and fixed the trailing space
     34        issue with those objects.  This causes a bunch of layout tests to progress.
     35
     36        Added fast/block/positioning/static-inline-position-dynamic.html and trailing-space-test.html.
     37
     38        * rendering/RenderBlock.cpp:
     39        (WebCore::RenderBlock::layoutBlock):
     40        (WebCore::RenderBlock::adjustPositionedBlock):
     41        (WebCore::RenderBlock::simplifiedNormalFlowLayout):
     42        (WebCore::RenderBlock::simplifiedLayout):
     43        * rendering/RenderBlock.h:
     44        * rendering/RenderBlockLineLayout.cpp:
     45        (WebCore::setStaticPositions):
     46        (WebCore::RenderBlock::findNextLineBreak):
     47        * rendering/RenderBox.cpp:
     48        (WebCore::RenderBox::styleDidChange):
     49        (WebCore::RenderBox::positionLineBox):
     50        * rendering/RenderBoxModelObject.cpp:
     51        (WebCore::RenderBoxModelObject::styleWillChange):
     52        * rendering/RenderFlexibleBox.cpp:
     53        (WebCore::RenderFlexibleBox::layoutBlock):
     54        (WebCore::RenderFlexibleBox::layoutHorizontalBox):
     55        (WebCore::RenderFlexibleBox::layoutVerticalBox):
     56        * rendering/RenderObject.cpp:
     57        (WebCore::RenderObject::RenderObject):
     58        (WebCore::RenderObject::adjustStyleDifference):
     59        (WebCore::RenderObject::setStyle):
     60        (WebCore::RenderObject::styleDidChange):
     61        * rendering/RenderObject.h:
     62        (WebCore::RenderObject::needsLayout):
     63        (WebCore::RenderObject::needsPositionedMovementLayoutOnly):
     64        (WebCore::RenderObject::needsSimplifiedNormalFlowLayout):
     65        (WebCore::RenderObject::setNeedsLayout):
     66        (WebCore::RenderObject::setChildNeedsLayout):
     67        (WebCore::RenderObject::setNeedsSimplifiedNormalFlowLayout):
     68        (WebCore::RenderObject::markContainingBlocksForLayout):
     69        * rendering/RenderTable.cpp:
     70        (WebCore::RenderTable::layout):
     71        * rendering/style/RenderStyle.cpp:
     72        (WebCore::RenderStyle::diff):
     73        * rendering/style/RenderStyleConstants.h:
     74        * rendering/svg/RenderSVGText.cpp:
     75        (WebCore::RenderSVGText::layout):
     76
    1772011-03-25  Martin Robinson  <mrobinson@igalia.com>
    278
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r81965 r81992  
    3535#include "HTMLNames.h"
    3636#include "HitTestResult.h"
     37#include "InlineIterator.h"
    3738#include "InlineTextBox.h"
    3839#include "PaintInfo.h"
     
    11341135        return;                                      // cause us to come in here.  Just bail.
    11351136
    1136     if (!relayoutChildren && layoutOnlyPositionedObjects())
     1137    if (!relayoutChildren && simplifiedLayout())
    11371138        return;
    11381139
     
    14211422{
    14221423    bool isHorizontal = isHorizontalWritingMode();
    1423     bool hasStaticInlinePosition = child->style()->hasStaticInlinePosition(isHorizontal);
    14241424    bool hasStaticBlockPosition = child->style()->hasStaticBlockPosition(isHorizontal);
    14251425    RenderLayer* childLayer = child->layer();
    14261426       
    1427     if (hasStaticInlinePosition)
    1428         childLayer->setStaticInlinePosition(borderAndPaddingStart());
    1429 
    1430     if (hasStaticBlockPosition) {
    1431         int logicalTop = logicalHeight();
    1432         if (!marginInfo.canCollapseWithMarginBefore()) {
    1433             child->computeBlockDirectionMargins(this);
    1434             int marginBefore = marginBeforeForChild(child);
    1435             int collapsedBeforePos = marginInfo.positiveMargin();
    1436             int collapsedBeforeNeg = marginInfo.negativeMargin();
    1437             if (marginBefore > 0) {
    1438                 if (marginBefore > collapsedBeforePos)
    1439                     collapsedBeforePos = marginBefore;
    1440             } else {
    1441                 if (-marginBefore > collapsedBeforeNeg)
    1442                     collapsedBeforeNeg = -marginBefore;
    1443             }
    1444             logicalTop += (collapsedBeforePos - collapsedBeforeNeg) - marginBefore;
    1445         }
    1446         if (childLayer->staticBlockPosition() != logicalTop) {
    1447             childLayer->setStaticBlockPosition(logicalTop);
     1427    childLayer->setStaticInlinePosition(borderAndPaddingStart());
     1428
     1429    int logicalTop = logicalHeight();
     1430    if (!marginInfo.canCollapseWithMarginBefore()) {
     1431        child->computeBlockDirectionMargins(this);
     1432        int marginBefore = marginBeforeForChild(child);
     1433        int collapsedBeforePos = marginInfo.positiveMargin();
     1434        int collapsedBeforeNeg = marginInfo.negativeMargin();
     1435        if (marginBefore > 0) {
     1436            if (marginBefore > collapsedBeforePos)
     1437                collapsedBeforePos = marginBefore;
     1438        } else {
     1439            if (-marginBefore > collapsedBeforeNeg)
     1440                collapsedBeforeNeg = -marginBefore;
     1441        }
     1442        logicalTop += (collapsedBeforePos - collapsedBeforeNeg) - marginBefore;
     1443    }
     1444    if (childLayer->staticBlockPosition() != logicalTop) {
     1445        childLayer->setStaticBlockPosition(logicalTop);
     1446        if (hasStaticBlockPosition)
    14481447            child->setChildNeedsLayout(true, false);
    1449         }
    14501448    }
    14511449}
     
    20782076}
    20792077
    2080 bool RenderBlock::layoutOnlyPositionedObjects()
    2081 {
    2082     if (!posChildNeedsLayout() || normalChildNeedsLayout() || selfNeedsLayout())
     2078void RenderBlock::simplifiedNormalFlowLayout()
     2079{
     2080    if (childrenInline()) {
     2081        ListHashSet<RootInlineBox*> lineBoxes;
     2082        bool endOfInline = false;
     2083        RenderObject* o = bidiFirst(this, 0, false);
     2084        while (o) {
     2085            if (!o->isPositioned() && (o->isReplaced() || o->isFloating())) {
     2086                o->layoutIfNeeded();
     2087                if (toRenderBox(o)->inlineBoxWrapper()) {
     2088                    RootInlineBox* box = toRenderBox(o)->inlineBoxWrapper()->root();
     2089                    lineBoxes.add(box);
     2090                }
     2091            } else if (o->isText() || (o->isRenderInline() && !endOfInline))
     2092                o->setNeedsLayout(false);
     2093            o = bidiNext(this, o, 0, false, &endOfInline);
     2094        }
     2095
     2096        // FIXME: Glyph overflow will get lost in this case, but not really a big deal.
     2097        GlyphOverflowAndFallbackFontsMap textBoxDataMap;                 
     2098        for (ListHashSet<RootInlineBox*>::const_iterator it = lineBoxes.begin(); it != lineBoxes.end(); ++it) {
     2099            RootInlineBox* box = *it;
     2100            box->computeOverflow(box->lineTop(), box->lineBottom(), document()->inNoQuirksMode(), textBoxDataMap);
     2101        }
     2102    } else {
     2103        for (RenderBox* box = firstChildBox(); box; box = box->nextSiblingBox()) {
     2104            if (!box->isPositioned())
     2105                box->layoutIfNeeded();
     2106        }
     2107    }
     2108}
     2109
     2110bool RenderBlock::simplifiedLayout()
     2111{
     2112    if ((!posChildNeedsLayout() && !needsSimplifiedNormalFlowLayout()) || normalChildNeedsLayout() || selfNeedsLayout())
    20832113        return false;
    20842114
    20852115    LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasColumns() || hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
    2086 
     2116   
    20872117    if (needsPositionedMovementLayout()) {
    20882118        tryLayoutDoingPositionedMovementOnly();
     
    20912121    }
    20922122
    2093     // All we have to is lay out our positioned objects.
    2094     layoutPositionedObjects(false);
     2123    // Lay out positioned descendants or objects that just need to recompute overflow.
     2124    if (needsSimplifiedNormalFlowLayout())
     2125        simplifiedNormalFlowLayout();
     2126
     2127    // Lay out our positioned objects if our positioned child bit is set.
     2128    if (posChildNeedsLayout())
     2129        layoutPositionedObjects(false);
    20952130
    20962131    // Recompute our overflow information.
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r81816 r81992  
    298298
    299299    virtual bool hasLineIfEmpty() const;
    300     bool layoutOnlyPositionedObjects();
     300   
     301    bool simplifiedLayout();
     302    void simplifiedNormalFlowLayout();
    301303
    302304    void computeOverflow(int oldClientAfterEdge, bool recomputeFloats = false);
     
    494496    void fitBelowFloats(float widthToFit, bool firstLine, float& availableWidth);
    495497    typedef std::pair<RenderText*, LazyLineBreakIterator> LineBreakIteratorInfo;
    496     InlineIterator findNextLineBreak(InlineBidiResolver&, bool firstLine, bool& isLineEmpty, LineBreakIteratorInfo&, bool& previousLineBrokeCleanly, bool& hyphenated, EClear*, FloatingObject* lastFloatFromPreviousLine);
     498    InlineIterator findNextLineBreak(InlineBidiResolver&, bool firstLine, bool& isLineEmpty, LineBreakIteratorInfo&, bool& previousLineBrokeCleanly, bool& hyphenated,
     499                                     EClear*, FloatingObject* lastFloatFromPreviousLine, Vector<RenderBox*>& positionedObjects);
    497500    RootInlineBox* constructLine(unsigned runCount, BidiRun* firstRun, BidiRun* lastRun, bool firstLine, bool lastLine, RenderObject* endObject);
    498501    InlineFlowBox* createLineBoxes(RenderObject*, bool firstLine);
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r81965 r81992  
    552552}
    553553
     554
     555static void setStaticPositions(RenderBlock* block, RenderBox* child)
     556{
     557    // FIXME: The math here is actually not really right. It's a best-guess approximation that
     558    // will work for the common cases
     559    RenderObject* containerBlock = child->container();
     560    int blockHeight = block->logicalHeight();
     561    if (containerBlock->isRenderInline()) {
     562        // A relative positioned inline encloses us. In this case, we also have to determine our
     563        // position as though we were an inline. Set |staticInlinePosition| and |staticBlockPosition| on the relative positioned
     564        // inline so that we can obtain the value later.
     565        toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->startOffsetForLine(blockHeight, false));
     566        toRenderInline(containerBlock)->layer()->setStaticBlockPosition(blockHeight);
     567    }
     568
     569    if (child->style()->isOriginalDisplayInlineType())
     570        child->layer()->setStaticInlinePosition(block->startOffsetForLine(blockHeight, false));
     571    else
     572        child->layer()->setStaticInlinePosition(block->borderAndPaddingStart());
     573    child->layer()->setStaticBlockPosition(blockHeight);
     574}
     575
    554576void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintLogicalTop, int& repaintLogicalBottom)
    555577{
     
    703725            EClear clear = CNONE;
    704726            bool hyphenated;
     727            Vector<RenderBox*> positionedObjects;
    705728           
    706729            InlineIterator oldEnd = end;
    707730            FloatingObject* lastFloatFromPreviousLine = (m_floatingObjects && !m_floatingObjects->set().isEmpty()) ? m_floatingObjects->set().last() : 0;
    708             end = findNextLineBreak(resolver, firstLine, isLineEmpty, lineBreakIteratorInfo, previousLineBrokeCleanly, hyphenated, &clear, lastFloatFromPreviousLine);
     731            end = findNextLineBreak(resolver, firstLine, isLineEmpty, lineBreakIteratorInfo, previousLineBrokeCleanly, hyphenated, &clear, lastFloatFromPreviousLine, positionedObjects);
    709732            if (resolver.position().atEnd()) {
    710733                resolver.deleteRuns();
     
    854877                }
    855878
     879                for (size_t i = 0; i < positionedObjects.size(); ++i)
     880                    setStaticPositions(this, positionedObjects[i]);
     881
    856882                firstLine = false;
    857883                newLine(clear);
     
    13271353}
    13281354
    1329 static void setStaticPositions(RenderBlock* block, RenderBox* child)
    1330 {
    1331     // FIXME: The math here is actually not really right. It's a best-guess approximation that
    1332     // will work for the common cases
    1333     RenderObject* containerBlock = child->container();
    1334     if (containerBlock->isRenderInline()) {
    1335         // A relative positioned inline encloses us. In this case, we also have to determine our
    1336         // position as though we were an inline. Set |staticInlinePosition| and |staticBlockPosition| on the relative positioned
    1337         // inline so that we can obtain the value later.
    1338         toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->startOffsetForLine(block->logicalHeight(), false));
    1339         toRenderInline(containerBlock)->layer()->setStaticBlockPosition(block->logicalHeight());
    1340     }
    1341 
    1342     bool isHorizontal = block->isHorizontalWritingMode();
    1343     bool hasStaticInlinePosition = child->style()->hasStaticInlinePosition(isHorizontal);
    1344     bool hasStaticBlockPosition = child->style()->hasStaticBlockPosition(isHorizontal);
    1345 
    1346     if (hasStaticInlinePosition) {
    1347         if (child->style()->isOriginalDisplayInlineType())
    1348             child->layer()->setStaticInlinePosition(block->startOffsetForLine(block->logicalHeight(), false));
    1349         else
    1350             child->layer()->setStaticInlinePosition(block->borderAndPaddingStart());
    1351     }
    1352 
    1353     if (hasStaticBlockPosition)
    1354         child->layer()->setStaticBlockPosition(block->logicalHeight());
    1355 }
    1356 
    13571355// FIXME: The entire concept of the skipTrailingWhitespace function is flawed, since we really need to be building
    13581356// line boxes even for containers that may ultimately collapse away.  Otherwise we'll never get positioned
     
    14831481
    14841482InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool firstLine, bool& isLineEmpty, LineBreakIteratorInfo& lineBreakIteratorInfo, bool& previousLineBrokeCleanly,
    1485                                               bool& hyphenated, EClear* clear, FloatingObject* lastFloatFromPreviousLine)
     1483                                              bool& hyphenated, EClear* clear, FloatingObject* lastFloatFromPreviousLine, Vector<RenderBox*>& positionedBoxes)
    14861484{
    14871485    ASSERT(resolver.position().block == this);
     
    15141512    bool currentCharacterIsWS = false;
    15151513    RenderObject* trailingSpaceObject = 0;
     1514    Vector<RenderBox*, 4> trailingPositionedBoxes;
    15161515
    15171516    InlineIterator lBreak = resolver.position();
     
    15981597                RenderBox* box = toRenderBox(o);
    15991598                bool isInlineType = box->style()->isOriginalDisplayInlineType();
    1600                 bool needToSetStaticInlinePosition = box->style()->hasStaticInlinePosition(isHorizontalWritingMode());
    1601                 if (needToSetStaticInlinePosition && !isInlineType) {
     1599                if (!isInlineType)
    16021600                    box->layer()->setStaticInlinePosition(borderAndPaddingStart());
    1603                     needToSetStaticInlinePosition = false;
    1604                 }
    1605 
    1606                 // If our original display was an INLINE type, then we can go ahead
    1607                 // and determine our static y position now.
    1608                 bool needToSetStaticBlockPosition = box->style()->hasStaticBlockPosition(isHorizontalWritingMode());
    1609                 if (needToSetStaticBlockPosition && isInlineType) {
     1601                else  {
     1602                    // If our original display was an INLINE type, then we can go ahead
     1603                    // and determine our static y position now.
    16101604                    box->layer()->setStaticBlockPosition(logicalHeight());
    1611                     needToSetStaticBlockPosition = false;
    16121605                }
    16131606               
    1614                 bool needToCreateLineBox = needToSetStaticInlinePosition || needToSetStaticBlockPosition;
    1615                 RenderObject* c = o->container();
    1616                 if (c->isRenderInline() && (!needToSetStaticInlinePosition || !needToSetStaticBlockPosition))
    1617                     needToCreateLineBox = true;
    1618 
    16191607                // If we're ignoring spaces, we have to stop and include this object and
    16201608                // then start ignoring spaces again.
    1621                 if (needToCreateLineBox) {
    1622                     trailingSpaceObject = 0;
     1609                if (isInlineType || o->container()->isRenderInline()) {
    16231610                    ignoreStart.obj = o;
    16241611                    ignoreStart.pos = 0;
     
    16271614                        addMidpoint(lineMidpointState, ignoreStart); // Start ignoring again.
    16281615                    }
    1629                    
    1630                 }
     1616                    if (trailingSpaceObject)
     1617                        trailingPositionedBoxes.append(box);
     1618                } else
     1619                    positionedBoxes.append(box);
    16311620            }
    16321621        } else if (o->isRenderInline()) {
     
    16441633                if (ignoringSpaces) {
    16451634                    trailingSpaceObject = 0;
     1635                    trailingPositionedBoxes.clear();
    16461636                    addMidpoint(lineMidpointState, InlineIterator(0, o, 0)); // Stop ignoring spaces.
    16471637                    addMidpoint(lineMidpointState, InlineIterator(0, o, 0)); // Start ignoring again.
     
    16781668            currentCharacterIsWS = false;
    16791669            trailingSpaceObject = 0;
     1670            trailingPositionedBoxes.clear();
    16801671
    16811672            // Optimize for a common case. If we can't find whitespace after the list
     
    19471938                if (collapseWhiteSpace && currentCharacterIsSpace && !ignoringSpaces)
    19481939                    trailingSpaceObject = o;
    1949                 else if (!o->style()->collapseWhiteSpace() || !currentCharacterIsSpace)
     1940                else if (!o->style()->collapseWhiteSpace() || !currentCharacterIsSpace) {
    19501941                    trailingSpaceObject = 0;
     1942                    trailingPositionedBoxes.clear();
     1943                }
    19511944                   
    19521945                pos++;
     
    20122005        if (checkForBreak && (w + tmpW > width)) {
    20132006            // if we have floats, try to get below them.
    2014             if (currentCharacterIsSpace && !ignoringSpaces && o->style()->collapseWhiteSpace())
     2007            if (currentCharacterIsSpace && !ignoringSpaces && o->style()->collapseWhiteSpace()) {
    20152008                trailingSpaceObject = 0;
     2009                trailingPositionedBoxes.clear();
     2010            }
    20162011
    20172012            if (w)
     
    20932088        if (lineMidpointState.numMidpoints % 2) {
    20942089            InlineIterator* midpoints = lineMidpointState.midpoints.data();
    2095             midpoints[lineMidpointState.numMidpoints - 1].pos--;
    2096         }
    2097         //else if (lBreak.pos > 0)
    2098         //    lBreak.pos--;
    2099         else if (lBreak.obj == 0 && trailingSpaceObject->isText()) {
     2090            midpoints[lineMidpointState.numMidpoints - trailingPositionedBoxes.size() * 2 - 1].pos--;
     2091        } else if (!lBreak.obj && trailingSpaceObject->isText()) {
    21002092            // Add a new end midpoint that stops right at the very end.
    21012093            RenderText* text = toRenderText(trailingSpaceObject);
     
    21042096            InlineIterator endMid(0, trailingSpaceObject, pos);
    21052097            addMidpoint(lineMidpointState, endMid);
     2098            for (size_t i = 0; i < trailingPositionedBoxes.size(); ++i) {
     2099                ignoreStart.obj = trailingPositionedBoxes[i];
     2100                ignoreStart.pos = 0;
     2101                addMidpoint(lineMidpointState, ignoreStart); // Stop ignoring spaces.
     2102                addMidpoint(lineMidpointState, ignoreStart); // Start ignoring again.
     2103            }
    21062104        }
    21072105    }
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r81965 r81992  
    289289    RenderBoxModelObject::styleDidChange(diff, oldStyle);
    290290
    291     if (needsLayout() && oldStyle && (oldStyle->logicalHeight().isPercent() || oldStyle->logicalMinHeight().isPercent() || oldStyle->logicalMaxHeight().isPercent()))
    292         RenderBlock::removePercentHeightDescendant(this);
     291    if (needsLayout() && oldStyle) {
     292        if (oldStyle && (oldStyle->logicalHeight().isPercent() || oldStyle->logicalMinHeight().isPercent() || oldStyle->logicalMaxHeight().isPercent()))
     293            RenderBlock::removePercentHeightDescendant(this);
     294
     295        // Normally we can do optimized positioning layout for absolute/fixed positioned objects. There is one special case, however, which is
     296        // when the positioned object's margin-before is changed. In this case the parent has to get a layout in order to run margin collapsing
     297        // to determine the new static position.
     298        if (isPositioned() && style()->hasStaticBlockPosition(isHorizontalWritingMode()) && oldStyle->marginBefore() != style()->marginBefore()
     299            && parent() && !parent()->normalChildNeedsLayout())
     300            parent()->setChildNeedsLayout(true);
     301    }
    293302
    294303    // If our zoom factor changes and we have a defined scrollLeft/Top, we need to adjust that value into the
     
    13051314        // Cache the x position only if we were an INLINE type originally.
    13061315        bool wasInline = style()->isOriginalDisplayInlineType();
    1307         if (wasInline && style()->hasStaticInlinePosition(box->isHorizontal())) {
     1316        if (wasInline) {
    13081317            // The value is cached in the xPos of the box.  We only need this value if
    13091318            // our object was inline originally, since otherwise it would have ended up underneath
    13101319            // the inlines.
    13111320            layer()->setStaticInlinePosition(lroundf(box->logicalLeft()));
    1312             setChildNeedsLayout(true, false); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
    1313         } else if (!wasInline && style()->hasStaticBlockPosition(box->isHorizontal())) {
     1321            if (style()->hasStaticInlinePosition(box->isHorizontal()))
     1322                setChildNeedsLayout(true, false); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
     1323        } else {
    13141324            // Our object was a block originally, so we make our normal flow position be
    13151325            // just below the line box (as though all the inlines that came before us got
     
    13171327            // in flow).  This value was cached in the y() of the box.
    13181328            layer()->setStaticBlockPosition(box->logicalTop());
    1319             setChildNeedsLayout(true, false); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
     1329            if (style()->hasStaticBlockPosition(box->isHorizontal()))
     1330                setChildNeedsLayout(true, false); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
    13201331        }
    13211332
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r81816 r81992  
    304304        }
    305305       
    306         if (diff == StyleDifferenceLayout) {
     306        if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLayout) {
    307307            // When a layout hint happens, we go ahead and do a repaint of the layer, since the layer could
    308308            // end up being destroyed.
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r81816 r81992  
    210210    ASSERT(needsLayout());
    211211
    212     if (!relayoutChildren && layoutOnlyPositionedObjects())
     212    if (!relayoutChildren && simplifiedLayout())
    213213        return;
    214214
     
    414414                child->containingBlock()->insertPositionedObject(child);
    415415                RenderLayer* childLayer = child->layer();
    416                 if (child->style()->hasStaticInlinePosition(style()->isHorizontalWritingMode()))
    417                     childLayer->setStaticInlinePosition(xPos);
    418                 if (child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode())) {
    419                     if (childLayer->staticBlockPosition() != yPos) {
    420                         childLayer->setStaticBlockPosition(yPos);
     416                childLayer->setStaticInlinePosition(xPos);
     417                if (childLayer->staticBlockPosition() != yPos) {
     418                    childLayer->setStaticBlockPosition(yPos);
     419                    if (child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode()))
    421420                        child->setChildNeedsLayout(true, false);
    422                     }
    423421                }
    424422                child = iterator.next();
     
    677675                child->containingBlock()->insertPositionedObject(child);
    678676                RenderLayer* childLayer = child->layer();
    679                 if (child->style()->hasStaticInlinePosition(style()->isHorizontalWritingMode())) {
    680                     if (style()->isLeftToRightDirection())
    681                         childLayer->setStaticInlinePosition(borderLeft() + paddingLeft());
    682                     else
    683                         childLayer->setStaticInlinePosition(borderRight() + paddingRight());
    684                 }
    685                 if (child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode())) {
    686                     if (childLayer->staticBlockPosition() != height()) {
    687                         childLayer->setStaticBlockPosition(height());
     677                childLayer->setStaticInlinePosition(borderStart() + paddingStart());
     678                if (childLayer->staticBlockPosition() != height()) {
     679                    childLayer->setStaticBlockPosition(height());
     680                    if (child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode()))
    688681                        child->setChildNeedsLayout(true, false);
    689                     }
    690682                }
    691683                child = iterator.next();
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r81965 r81992  
    192192    , m_normalChildNeedsLayout(false)
    193193    , m_posChildNeedsLayout(false)
     194    , m_needsSimplifiedNormalFlowLayout(false)
    194195    , m_preferredLogicalWidthsDirty(false)
    195196    , m_floating(false)
     
    16871688        // hence the !isText() check.
    16881689        // FIXME: when transforms are taken into account for overflow, we will need to do a layout.
    1689         if (!isText() && (!hasLayer() || !toRenderBoxModelObject(this)->layer()->isComposited()))
    1690             diff = StyleDifferenceLayout;
    1691         else if (diff < StyleDifferenceRecompositeLayer)
     1690        if (!isText() && (!hasLayer() || !toRenderBoxModelObject(this)->layer()->isComposited())) {
     1691            if (!hasLayer())
     1692                diff = StyleDifferenceLayout; // FIXME: Do this for now since SimplifiedLayout cannot handle updating floating objects lists.
     1693            else if (diff < StyleDifferenceSimplifiedLayout)
     1694                diff = StyleDifferenceSimplifiedLayout;
     1695        } else if (diff < StyleDifferenceRecompositeLayer)
    16921696            diff = StyleDifferenceRecompositeLayer;
    16931697    }
     
    17681772        else if (updatedDiff == StyleDifferenceLayoutPositionedMovementOnly)
    17691773            setNeedsPositionedMovementLayout();
     1774        else if (updatedDiff == StyleDifferenceSimplifiedLayout)
     1775            setNeedsSimplifiedNormalFlowLayout();
    17701776    }
    17711777   
     
    18811887        return;
    18821888   
    1883     if (diff == StyleDifferenceLayout) {
     1889    if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLayout) {
    18841890        RenderCounter::rendererStyleChanged(this, oldStyle, m_style.get());
    18851891
     
    18921898            markContainingBlocksForLayout();
    18931899
    1894         setNeedsLayoutAndPrefWidthsRecalc();
     1900        if (diff == StyleDifferenceLayout)
     1901            setNeedsLayoutAndPrefWidthsRecalc();
     1902        else
     1903            setNeedsSimplifiedNormalFlowLayout();
    18951904    } else if (diff == StyleDifferenceLayoutPositionedMovementOnly)
    18961905        setNeedsPositionedMovementLayout();
  • trunk/Source/WebCore/rendering/RenderObject.h

    r81816 r81992  
    416416    bool mustRepaintBackgroundOrBorder() const;
    417417    bool hasBackground() const { return style()->hasBackground(); }
    418     bool needsLayout() const { return m_needsLayout || m_normalChildNeedsLayout || m_posChildNeedsLayout || m_needsPositionedMovementLayout; }
     418    bool needsLayout() const { return m_needsLayout || m_normalChildNeedsLayout || m_posChildNeedsLayout || m_needsSimplifiedNormalFlowLayout || m_needsPositionedMovementLayout; }
    419419    bool selfNeedsLayout() const { return m_needsLayout; }
    420420    bool needsPositionedMovementLayout() const { return m_needsPositionedMovementLayout; }
    421     bool needsPositionedMovementLayoutOnly() const { return m_needsPositionedMovementLayout && !m_needsLayout && !m_normalChildNeedsLayout && !m_posChildNeedsLayout; }
     421    bool needsPositionedMovementLayoutOnly() const { return m_needsPositionedMovementLayout && !m_needsLayout && !m_normalChildNeedsLayout && !m_posChildNeedsLayout && !m_needsSimplifiedNormalFlowLayout; }
    422422    bool posChildNeedsLayout() const { return m_posChildNeedsLayout; }
     423    bool needsSimplifiedNormalFlowLayout() const { return m_needsSimplifiedNormalFlowLayout; }
    423424    bool normalChildNeedsLayout() const { return m_normalChildNeedsLayout; }
    424425   
     
    489490    void setChildNeedsLayout(bool b, bool markParents = true);
    490491    void setNeedsPositionedMovementLayout();
     492    void setNeedsSimplifiedNormalFlowLayout();
    491493    void setPreferredLogicalWidthsDirty(bool, bool markParents = true);
    492494    void invalidateContainerPreferredLogicalWidths();
     
    847849    bool m_normalChildNeedsLayout    : 1;
    848850    bool m_posChildNeedsLayout       : 1;
     851    bool m_needsSimplifiedNormalFlowLayout  : 1;
    849852    bool m_preferredLogicalWidthsDirty           : 1;
    850853    bool m_floating                  : 1;
     
    932935        m_everHadLayout = true;
    933936        m_posChildNeedsLayout = false;
     937        m_needsSimplifiedNormalFlowLayout = false;
    934938        m_normalChildNeedsLayout = false;
    935939        m_needsPositionedMovementLayout = false;
     
    947951    } else {
    948952        m_posChildNeedsLayout = false;
     953        m_needsSimplifiedNormalFlowLayout = false;
    949954        m_normalChildNeedsLayout = false;
    950955        m_needsPositionedMovementLayout = false;
     
    956961    bool alreadyNeededLayout = needsLayout();
    957962    m_needsPositionedMovementLayout = true;
     963    if (!alreadyNeededLayout) {
     964        markContainingBlocksForLayout();
     965        if (hasLayer())
     966            setLayerNeedsFullRepaint();
     967    }
     968}
     969
     970inline void RenderObject::setNeedsSimplifiedNormalFlowLayout()
     971{
     972    bool alreadyNeededLayout = needsLayout();
     973    m_needsSimplifiedNormalFlowLayout = true;
    958974    if (!alreadyNeededLayout) {
    959975        markContainingBlocksForLayout();
     
    983999    RenderObject* last = this;
    9841000
     1001    bool simplifiedNormalFlowLayout = needsSimplifiedNormalFlowLayout() && !selfNeedsLayout() && !normalChildNeedsLayout();
     1002
    9851003    while (o) {
    9861004        // Don't mark the outermost object of an unrooted subtree. That object will be
     
    9901008            return;
    9911009        if (!last->isText() && (last->style()->position() == FixedPosition || last->style()->position() == AbsolutePosition)) {
    992             if (last->style()->top().isAuto() && last->style()->bottom().isAuto()) {
    993                 RenderObject* parent = last->parent();
    994                 if (!parent->normalChildNeedsLayout()) {
    995                     parent->setChildNeedsLayout(true, false);
    996                     if (parent != newRoot)
    997                         parent->markContainingBlocksForLayout(scheduleRelayout, newRoot);
    998                 }
    999             }
    10001010            if (o->m_posChildNeedsLayout)
    10011011                return;
    10021012            o->m_posChildNeedsLayout = true;
     1013            simplifiedNormalFlowLayout = true;
     1014            ASSERT(!o->isSetNeedsLayoutForbidden());
     1015        } else if (simplifiedNormalFlowLayout) {
     1016            if (o->m_needsSimplifiedNormalFlowLayout)
     1017                return;
     1018            o->m_needsSimplifiedNormalFlowLayout = true;
    10031019            ASSERT(!o->isSetNeedsLayoutForbidden());
    10041020        } else {
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r81816 r81992  
    262262    ASSERT(needsLayout());
    263263
    264     if (layoutOnlyPositionedObjects())
     264    if (simplifiedLayout())
    265265        return;
    266266
  • trunk/Source/WebCore/rendering/RenderText.h

    r78846 r81992  
    126126    bool isAllCollapsibleWhitespace();
    127127   
     128    bool knownToHaveNoOverflowAndNoFallbackFonts() const { return m_knownToHaveNoOverflowAndNoFallbackFonts; }
     129
    128130protected:
    129131    virtual void styleWillChange(StyleDifference, const RenderStyle*) { }
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r81816 r81992  
    494494        return StyleDifferenceLayout;
    495495
     496    if ((visibility() == COLLAPSE) != (other->visibility() == COLLAPSE))
     497        return StyleDifferenceLayout;
     498
    496499    if ((rareNonInheritedData->opacity == 1 && other->rareNonInheritedData->opacity < 1) ||
    497500        (rareNonInheritedData->opacity < 1 && other->rareNonInheritedData->opacity == 1)) {
    498         // FIXME: We should add an optimized form of layout that just recomputes visual overflow.
     501        // FIXME: We would like to use SimplifiedLayout here, but we can't quite do that yet.
     502        // We need to make sure SimplifiedLayout can operate correctly on RenderInlines (we will need
     503        // to add a selfNeedsSimplifiedLayout bit in order to not get confused and taint every line).
     504        // In addition we need to solve the floating object issue when layers come and go. Right now
     505        // a full layout is necessary to keep floating object lists sane.
    499506        return StyleDifferenceLayout;
    500507    }
    501508
    502     if ((visibility() == COLLAPSE) != (other->visibility() == COLLAPSE))
    503         return StyleDifferenceLayout;
    504                    
    505509#if ENABLE(SVG)
    506510    // SVGRenderStyle::diff() might have returned StyleDifferenceRepaint, eg. if fill changes.
     
    520524                return StyleDifferenceLayoutPositionedMovementOnly;
    521525
    522             // FIXME: We will need to do a bit of work in RenderObject/Box::setStyle before we
    523             // can stop doing a layout when relative positioned objects move.  In particular, we'll need
    524             // to update scrolling positions and figure out how to do a repaint properly of the updated layer.
    525             //if (other->position() == RelativePosition)
    526             //    return RepaintLayer;
    527             //else
    528                 return StyleDifferenceLayout;
     526            // FIXME: We would like to use SimplifiedLayout for relative positioning, but we can't quite do that yet.
     527            // We need to make sure SimplifiedLayout can operate correctly on RenderInlines (we will need
     528            // to add a selfNeedsSimplifiedLayout bit in order to not get confused and taint every line).
     529            return StyleDifferenceLayout;
    529530        } else if (m_box->zIndex() != other->m_box->zIndex() || m_box->hasAutoZIndex() != other->m_box->hasAutoZIndex() ||
    530531                 visual->clip != other->visual->clip || visual->hasClip != other->visual->hasClip)
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r81816 r81992  
    5252    StyleDifferenceRepaintLayer,
    5353    StyleDifferenceLayoutPositionedMovementOnly,
     54    StyleDifferenceSimplifiedLayout,
    5455    StyleDifferenceLayout
    5556};
  • trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp

    r81816 r81992  
    135135    // All if branches that could cause early exit in RenderBlocks layoutBlock() method are turned into assertions.
    136136    ASSERT(!isInline());
    137     ASSERT(!layoutOnlyPositionedObjects());
     137    ASSERT(!simplifiedLayout());
    138138    ASSERT(!scrollsOverflow());
    139139    ASSERT(!hasControlClip());
Note: See TracChangeset for help on using the changeset viewer.