Changeset 165720 in webkit


Ignore:
Timestamp:
Mar 16, 2014 11:35:27 PM (10 years ago)
Author:
mihnea@adobe.com
Message:

[CSSRegions]Do not compute region range for a box unless the parent has one
https://bugs.webkit.org/show_bug.cgi?id=130249

Reviewed by Andrei Bucur.

Source/WebCore:

If the containing block does not have a region range computed, do not attempt to compute
a region range for a child. In such cases, the range computation for a child can lead to
a result that is wrong, possibly leading to an incorrect clipping.

Test: fast/regions/inline-block-flowed-in-regions.html

  • rendering/RenderBlock.cpp:

(WebCore::canComputeRegionRangeForBox):
(WebCore::RenderBlock::computeRegionRangeForBoxChild):
(WebCore::RenderBlock::estimateRegionRangeForBoxChild):
(WebCore::RenderBlock::updateRegionRangeForBoxChild):

  • rendering/RenderFlowThread.h:

LayoutTests:

  • fast/regions/inline-block-flowed-in-regions-expected.html: Added.
  • fast/regions/inline-block-flowed-in-regions.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r165702 r165720  
     12014-03-16  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSSRegions]Do not compute region range for a box unless the parent has one
     4        https://bugs.webkit.org/show_bug.cgi?id=130249
     5
     6        Reviewed by Andrei Bucur.
     7
     8        * fast/regions/inline-block-flowed-in-regions-expected.html: Added.
     9        * fast/regions/inline-block-flowed-in-regions.html: Added.
     10
    1112014-03-16  Frédéric Wang  <fred.wang@free.fr>
    212
  • trunk/Source/WebCore/ChangeLog

    r165717 r165720  
     12014-03-16  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSSRegions]Do not compute region range for a box unless the parent has one
     4        https://bugs.webkit.org/show_bug.cgi?id=130249
     5
     6        Reviewed by Andrei Bucur.
     7
     8        If the containing block does not have a region range computed, do not attempt to compute
     9        a region range for a child. In such cases, the range computation for a child can lead to
     10        a result that is wrong, possibly leading to an incorrect clipping.
     11
     12        Test: fast/regions/inline-block-flowed-in-regions.html
     13
     14        * rendering/RenderBlock.cpp:
     15        (WebCore::canComputeRegionRangeForBox):
     16        (WebCore::RenderBlock::computeRegionRangeForBoxChild):
     17        (WebCore::RenderBlock::estimateRegionRangeForBoxChild):
     18        (WebCore::RenderBlock::updateRegionRangeForBoxChild):
     19        * rendering/RenderFlowThread.h:
     20
    1212014-03-16  Andreas Kling  <akling@apple.com>
    222
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r165607 r165720  
    50385038}
    50395039
     5040static bool canComputeRegionRangeForBox(const RenderBlock* parentBlock, const RenderBox& childBox, const RenderFlowThread* flowThreadContainingBlock)
     5041{
     5042    ASSERT(parentBlock);
     5043    ASSERT(!childBox.isRenderFlowThread());
     5044
     5045    if (!flowThreadContainingBlock)
     5046        return false;
     5047
     5048    if (!flowThreadContainingBlock->hasRegions())
     5049        return false;
     5050
     5051    if (!childBox.canHaveOutsideRegionRange())
     5052        return false;
     5053
     5054    return flowThreadContainingBlock->hasRegionRangeForBox(parentBlock);
     5055}
     5056
    50405057void RenderBlock::computeRegionRangeForBoxChild(const RenderBox& box) const
    50415058{
    50425059    RenderFlowThread* flowThread = flowThreadContainingBlock();
    5043     if (!flowThread || !flowThread->hasRegions())
    5044         return;
     5060    ASSERT(canComputeRegionRangeForBox(this, box, flowThread));
    50455061
    50465062    RenderRegion* startRegion;
     
    50605076{
    50615077    RenderFlowThread* flowThread = flowThreadContainingBlock();
    5062     if (!flowThread || !flowThread->hasRegions() || !box.canHaveOutsideRegionRange())
     5078    if (!canComputeRegionRangeForBox(this, box, flowThread))
    50635079        return;
    50645080
     
    50815097{
    50825098    RenderFlowThread* flowThread = flowThreadContainingBlock();
    5083     if (!flowThread || !flowThread->hasRegions() || !box.canHaveOutsideRegionRange())
     5099    if (!canComputeRegionRangeForBox(this, box, flowThread))
    50845100        return false;
    50855101
  • trunk/Source/WebCore/rendering/RenderFlowThread.h

    r165377 r165720  
    125125    void setRegionRangeForBox(const RenderBox*, RenderRegion*, RenderRegion*);
    126126    void getRegionRangeForBox(const RenderBox*, RenderRegion*& startRegion, RenderRegion*& endRegion) const;
     127    bool hasRegionRangeForBox(const RenderBox* box) const { ASSERT(box); return m_regionRangeMap.contains(box); }
    127128
    128129    // Check if the object is in region and the region is part of this flow thread.
Note: See TracChangeset for help on using the changeset viewer.