Changeset 132685 in webkit


Ignore:
Timestamp:
Oct 26, 2012 12:57:52 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Exclusions] Block children have incorrect offset when shape-inside element lays out below other elements
https://bugs.webkit.org/show_bug.cgi?id=98189

Patch by Bear Travis <betravis@adobe.com> on 2012-10-26
Reviewed by Dirk Schulze.

Source/WebCore:

The initial code assumed that each block created a new layout state, such that
LayoutState::layoutOffset would be specific to each block child of a shape-inside.
Typically, however, block children of a shape-inside do not create a new layout state,
and therefore we use the current element's offset instead.

Test: fast/exclusions/shape-inside/shape-inside-subsequent-blocks.html

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlock::layoutRunsAndFloatsInRange): Modified to use only logicalTop
rather than LayoutState::layoutOffset::width/height and logicalTop.

LayoutTests:

Test that block content in subsequent shape-insides lays out correctly. Introducing a script
that can eventually be used to simplify the rectangle cases.

  • fast/exclusions/resources/simple-rectangle.js: Added.

(createRectangleTest): Generate a shape-inside rectangle test using the given parameters.
(createRectangleTestResult): Generate a shape-inside rectangle expected result using
the given parameters.

  • fast/exclusions/shape-inside/shape-inside-subsequent-blocks-expected.html: Added.
  • fast/exclusions/shape-inside/shape-inside-subsequent-blocks.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r132682 r132685  
     12012-10-26  Bear Travis  <betravis@adobe.com>
     2
     3        [CSS Exclusions] Block children have incorrect offset when shape-inside element lays out below other elements
     4        https://bugs.webkit.org/show_bug.cgi?id=98189
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Test that block content in subsequent shape-insides lays out correctly. Introducing a script
     9        that can eventually be used to simplify the rectangle cases.
     10
     11        * fast/exclusions/resources/simple-rectangle.js: Added.
     12        (createRectangleTest): Generate a shape-inside rectangle test using the given parameters.
     13        (createRectangleTestResult): Generate a shape-inside rectangle expected result using
     14        the given parameters.
     15        * fast/exclusions/shape-inside/shape-inside-subsequent-blocks-expected.html: Added.
     16        * fast/exclusions/shape-inside/shape-inside-subsequent-blocks.html: Added.
     17
    1182012-10-26  Dirk Schulze  <krit@webkit.org>
    219
  • trunk/Source/WebCore/ChangeLog

    r132684 r132685  
     12012-10-26  Bear Travis  <betravis@adobe.com>
     2
     3        [CSS Exclusions] Block children have incorrect offset when shape-inside element lays out below other elements
     4        https://bugs.webkit.org/show_bug.cgi?id=98189
     5
     6        Reviewed by Dirk Schulze.
     7
     8        The initial code assumed that each block created a new layout state, such that
     9        LayoutState::layoutOffset would be specific to each block child of a shape-inside.
     10        Typically, however, block children of a shape-inside do not create a new layout state,
     11        and therefore we use the current element's offset instead.
     12
     13        Test: fast/exclusions/shape-inside/shape-inside-subsequent-blocks.html
     14
     15        * rendering/RenderBlockLineLayout.cpp:
     16        (WebCore::RenderBlock::layoutRunsAndFloatsInRange): Modified to use only logicalTop
     17        rather than LayoutState::layoutOffset::width/height and logicalTop.
     18
    1192012-10-26  Elliott Sprehn  <esprehn@chromium.org>
    220
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r132127 r132685  
    14041404    if (exclusionShapeInsideInfo) {
    14051405        if (exclusionShapeInsideInfo != this->exclusionShapeInsideInfo()) {
    1406             // FIXME: If layout state is disabled, the offset will be incorrect.
    1407             LayoutSize layoutOffset = view()->layoutState()->layoutOffset();
    1408             absoluteLogicalTop = logicalTop() + (isHorizontalWritingMode() ? layoutOffset.height() : layoutOffset.width());
     1406            // FIXME Bug 100284: If subsequent LayoutStates are pushed, we will have to add
     1407            // their offsets from the original shape-inside container.
     1408            absoluteLogicalTop = logicalTop();
    14091409        }
    14101410        // Begin layout at the logical top of our shape inside.
Note: See TracChangeset for help on using the changeset viewer.