Changeset 165615 in webkit


Ignore:
Timestamp:
Mar 14, 2014 5:49:15 AM (10 years ago)
Author:
mihnea@adobe.com
Message:

[CSSRegions] Inline-block child of content node incorrectly clipped
https://bugs.webkit.org/show_bug.cgi?id=130229

Reviewed by Andrei Bucur.

Source/WebCore:

Constrain the target box rect to the region box rect only if we are able
to determine the region range for box. If we cannot do that, getRegionRangeForBox
returns null values for start and end region and we should not perform the clamping.

Test: fast/regions/inlineblock-child-inlineblock-contentnode-in-region.html

  • rendering/RenderRegion.cpp:

(WebCore::RenderRegion::rectFlowPortionForBox):

LayoutTests:

  • fast/regions/inlineblock-child-inlineblock-contentnode-in-region-expected.html: Added.
  • fast/regions/inlineblock-child-inlineblock-contentnode-in-region.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r165612 r165615  
     12014-03-14  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSSRegions] Inline-block child of content node incorrectly clipped
     4        https://bugs.webkit.org/show_bug.cgi?id=130229
     5
     6        Reviewed by Andrei Bucur.
     7
     8        * fast/regions/inlineblock-child-inlineblock-contentnode-in-region-expected.html: Added.
     9        * fast/regions/inlineblock-child-inlineblock-contentnode-in-region.html: Added.
     10
    1112014-03-14  Sergio Villar Senin  <svillar@igalia.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r165614 r165615  
     12014-03-14  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSSRegions] Inline-block child of content node incorrectly clipped
     4        https://bugs.webkit.org/show_bug.cgi?id=130229
     5
     6        Reviewed by Andrei Bucur.
     7
     8        Constrain the target box rect to the region box rect only if we are able
     9        to determine the region range for box. If we cannot do that, getRegionRangeForBox
     10        returns null values for start and end region and we should not perform the clamping.
     11
     12        Test: fast/regions/inlineblock-child-inlineblock-contentnode-in-region.html
     13
     14        * rendering/RenderRegion.cpp:
     15        (WebCore::RenderRegion::rectFlowPortionForBox):
     16
    1172014-03-14  Zan Dobersek  <zdobersek@igalia.com>
    218
  • trunk/Source/WebCore/rendering/RenderRegion.cpp

    r165130 r165615  
    472472LayoutRect RenderRegion::rectFlowPortionForBox(const RenderBox* box, const LayoutRect& rect) const
    473473{
     474    LayoutRect mappedRect = m_flowThread->mapFromLocalToFlowThread(box, rect);
     475
    474476    RenderRegion* startRegion = 0;
    475477    RenderRegion* endRegion = 0;
    476478    m_flowThread->getRegionRangeForBox(box, startRegion, endRegion);
    477479
    478     LayoutRect mappedRect = m_flowThread->mapFromLocalToFlowThread(box, rect);
    479     if (flowThread()->isHorizontalWritingMode()) {
    480         if (this != startRegion)
    481             mappedRect.shiftYEdgeTo(std::max<LayoutUnit>(logicalTopForFlowThreadContent(), mappedRect.y()));
    482 
    483         if (this != endRegion)
    484             mappedRect.setHeight(std::max<LayoutUnit>(0, std::min<LayoutUnit>(logicalBottomForFlowThreadContent() - mappedRect.y(), mappedRect.height())));
    485     } else {
    486         if (this != startRegion)
    487             mappedRect.shiftXEdgeTo(std::max<LayoutUnit>(logicalTopForFlowThreadContent(), mappedRect.x()));
    488            
    489         if (this != endRegion)
    490             mappedRect.setWidth(std::max<LayoutUnit>(0, std::min<LayoutUnit>(logicalBottomForFlowThreadContent() - mappedRect.x(), mappedRect.width())));
     480    if (startRegion && endRegion) {
     481        if (flowThread()->isHorizontalWritingMode()) {
     482            if (this != startRegion)
     483                mappedRect.shiftYEdgeTo(std::max<LayoutUnit>(logicalTopForFlowThreadContent(), mappedRect.y()));
     484            if (this != endRegion)
     485                mappedRect.setHeight(std::max<LayoutUnit>(0, std::min<LayoutUnit>(logicalBottomForFlowThreadContent() - mappedRect.y(), mappedRect.height())));
     486        } else {
     487            if (this != startRegion)
     488                mappedRect.shiftXEdgeTo(std::max<LayoutUnit>(logicalTopForFlowThreadContent(), mappedRect.x()));
     489            if (this != endRegion)
     490                mappedRect.setWidth(std::max<LayoutUnit>(0, std::min<LayoutUnit>(logicalBottomForFlowThreadContent() - mappedRect.x(), mappedRect.width())));
     491        }
    491492    }
    492493
Note: See TracChangeset for help on using the changeset viewer.