Changeset 147250 in webkit


Ignore:
Timestamp:
Mar 29, 2013 2:13:02 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Exclusions] shape outside segments not properly calculated for ellipses
https://bugs.webkit.org/show_bug.cgi?id=112587

Patch by Bem Jones-Bey <Bem Jones-Bey> on 2013-03-29
Reviewed by Julien Chaffraix.

Source/WebCore:

When converting the line top coordinates from the parent's coordinate
space to the coordinate space of the float, the offset given by the
shape was not being accounted for. This patch accounts for that
offset.

Test: fast/exclusions/shape-outside-floats/shape-outside-floats-non-zero-y.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::logicalLeftOffsetForLine): Fix the coordinate conversion.
(WebCore::RenderBlock::logicalRightOffsetForLine): Ditto.

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded): Ditto.

LayoutTests:

Check that shapes with a non-zero y value are properly wrapped.

  • fast/exclusions/shape-outside-floats/shape-outside-floats-non-zero-y.html: Added.
  • fast/exclusions/resources/rounded-rectangle.js:

(generateSimulatedShapeOutsideOnFloat): For simulating, we ignore the
x and y values, since we're not attempting to draw the float's content
in the right place, we just want to simulate the shape's effect.

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147249 r147250  
     12013-03-29  Bem Jones-Bey  <bjonesbe@adobe.com>
     2
     3        [CSS Exclusions] shape outside segments not properly calculated for ellipses
     4        https://bugs.webkit.org/show_bug.cgi?id=112587
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        Check that shapes with a non-zero y value are properly wrapped.
     9       
     10        * fast/exclusions/shape-outside-floats/shape-outside-floats-non-zero-y.html: Added.
     11        * fast/exclusions/resources/rounded-rectangle.js:
     12        (generateSimulatedShapeOutsideOnFloat): For simulating, we ignore the
     13        x and y values, since we're not attempting to draw the float's content
     14        in the right place, we just want to simulate the shape's effect.
     15
    1162013-03-29  Hans Muller  <hmuller@adobe.com>
    217
  • trunk/LayoutTests/fast/exclusions/resources/rounded-rectangle.js

    r145982 r147250  
    213213
    214214    element.insertAdjacentHTML('afterend', simulationHTML);
     215    // For simulating, we ignore the x and y values, since we're not attempting
     216    // to draw the float's content in the right place, we just want to simulate
     217    // the shape's effect.
    215218    if (floatValue == "right")
    216219        dimensions.shapeX = -dimensions.shapeWidth;
    217     simulateShapeOutline(elementId, stylesheet, dimensions);
    218 }
     220    else
     221        dimensions.shapeX = 0;
     222    dimensions.shapeY = 0;
     223    simulateShapeOutline(elementId, stylesheet, dimensions);
     224}
  • trunk/Source/WebCore/ChangeLog

    r147249 r147250  
     12013-03-29  Bem Jones-Bey  <bjonesbe@adobe.com>
     2
     3        [CSS Exclusions] shape outside segments not properly calculated for ellipses
     4        https://bugs.webkit.org/show_bug.cgi?id=112587
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        When converting the line top coordinates from the parent's coordinate
     9        space to the coordinate space of the float, the offset given by the
     10        shape was not being accounted for. This patch accounts for that
     11        offset.
     12
     13        Test: fast/exclusions/shape-outside-floats/shape-outside-floats-non-zero-y.html
     14
     15        * rendering/RenderBlock.cpp:
     16        (WebCore::RenderBlock::logicalLeftOffsetForLine): Fix the coordinate conversion.
     17        (WebCore::RenderBlock::logicalRightOffsetForLine): Ditto.
     18        * rendering/RenderBlockLineLayout.cpp:
     19        (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded): Ditto.
     20
    1212013-03-29  Hans Muller  <hmuller@adobe.com>
    222
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r147245 r147250  
    43274327        if (const FloatingObject* lastFloat = adapter.lastFloat()) {
    43284328            if (ExclusionShapeOutsideInfo* shapeOutside = lastFloat->renderer()->exclusionShapeOutsideInfo()) {
    4329                 shapeOutside->computeSegmentsForLine(logicalTop - logicalTopForFloat(lastFloat), logicalHeight);
     4329                shapeOutside->computeSegmentsForLine(logicalTop - logicalTopForFloat(lastFloat) + shapeOutside->shapeLogicalTop(), logicalHeight);
    43304330                left += shapeOutside->rightSegmentShapeBoundingBoxDelta();
    43314331            }
     
    43844384        if (const FloatingObject* lastFloat = adapter.lastFloat()) {
    43854385            if (ExclusionShapeOutsideInfo* shapeOutside = lastFloat->renderer()->exclusionShapeOutsideInfo()) {
    4386                 shapeOutside->computeSegmentsForLine(logicalTop - logicalTopForFloat(lastFloat), logicalHeight);
     4386                shapeOutside->computeSegmentsForLine(logicalTop - logicalTopForFloat(lastFloat) + shapeOutside->shapeLogicalTop(), logicalHeight);
    43874387                rightFloatOffset += shapeOutside->leftSegmentShapeBoundingBoxDelta();
    43884388            }
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r147156 r147250  
    179179    ExclusionShapeOutsideInfo* shapeOutsideInfo = newFloat->renderer()->exclusionShapeOutsideInfo();
    180180    if (shapeOutsideInfo)
    181         shapeOutsideInfo->computeSegmentsForLine(m_block->logicalHeight() - m_block->logicalTopForFloat(newFloat), logicalHeightForLine(m_block, m_isFirstLine));
     181        shapeOutsideInfo->computeSegmentsForLine(m_block->logicalHeight() - m_block->logicalTopForFloat(newFloat) + shapeOutsideInfo->shapeLogicalTop(), logicalHeightForLine(m_block, m_isFirstLine));
    182182#endif
    183183
Note: See TracChangeset for help on using the changeset viewer.