• stavila@adobe.com's avatar
    [CSS Regions] Implement visual overflow for first & last regions · 81613fc9
    stavila@adobe.com authored
    https://bugs.webkit.org/show_bug.cgi?id=118665
    
    Source/WebCore:
    
    In order to properly propagate the visual overflow of elements flowed inside regions,
    the responsiblity of painting and hit-testing content inside flow threads has been
    moved to the flow thread layer's level.
    Each region keeps the associated overflow with each box in the RenderBoxRegionInfo
    structure, including one for the flow thread itself. This data is used during
    painting and hit-testing.
    
    Reviewed by David Hyatt.
    
    Tests: fast/regions/overflow-first-and-last-regions-in-container-hidden.html
           fast/regions/overflow-first-and-last-regions.html
           fast/regions/overflow-nested-regions.html
           fast/regions/overflow-region-float.html
           fast/regions/overflow-region-inline.html
           fast/regions/overflow-region-transform.html
    
    * rendering/InlineFlowBox.cpp:
    (WebCore::InlineFlowBox::setLayoutOverflow):
    (WebCore::InlineFlowBox::setVisualOverflow):
    * rendering/InlineFlowBox.h:
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::addOverflowFromChildren):
    (WebCore::RenderBlock::paint):
    (WebCore::RenderBlock::paintObject):
    (WebCore::RenderBlock::estimateRegionRangeForBoxChild):
    (WebCore::RenderBlock::updateRegionRangeForBoxChild):
    * rendering/RenderBlockFlow.cpp:
    (WebCore::RenderBlockFlow::hasNextPage):
    (WebCore::RenderBlockFlow::relayoutForPagination):
    * rendering/RenderBlockLineLayout.cpp:
    (WebCore::RenderBlockFlow::positionNewFloatOnLine):
    * rendering/RenderBox.cpp:
    (WebCore::RenderBox::borderBoxRectInRegion):
    (WebCore::RenderBox::computeRectForRepaint):
    (WebCore::RenderBox::addLayoutOverflow):
    (WebCore::RenderBox::addVisualOverflow):
    (WebCore::RenderBox::isUnsplittableForPagination):
    (WebCore::RenderBox::overflowRectForPaintRejection):
    * rendering/RenderBox.h:
    (WebCore::RenderBox::canHaveOutsideRegionRange):
    * rendering/RenderBoxModelObject.cpp:
    (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
    (WebCore::RenderBoxModelObject::paintFillLayerExtended):
    * rendering/RenderBoxModelObject.h:
    * rendering/RenderBoxRegionInfo.h:
    (WebCore::RenderBoxRegionInfo::createOverflow):
    * rendering/RenderFlowThread.cpp:
    (WebCore::RenderFlowThread::objectShouldPaintInFlowRegion):
    (WebCore::RenderFlowThread::mapFromLocalToFlowThread):
    (WebCore::RenderFlowThread::mapFromFlowThreadToLocal):
    (WebCore::RenderFlowThread::decorationsClipRectForBoxInRegion):
    (WebCore::RenderFlowThread::flipForWritingModeLocalCoordinates):
    (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
    (WebCore::RenderFlowThread::addRegionsVisualOverflow):
    (WebCore::CurrentRenderFlowThreadMaintainer::CurrentRenderFlowThreadMaintainer):
    * rendering/RenderFlowThread.h:
    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::updateLayerPositions):
    (WebCore::expandClipRectForRegionAndReflection):
    (WebCore::expandClipRectForDescendantsAndReflection):
    (WebCore::RenderLayer::paintLayer):
    (WebCore::RenderLayer::paintLayerContents):
    (WebCore::RenderLayer::updatePaintingInfoForFragments):
    (WebCore::RenderLayer::paintForegroundForFragments):
    (WebCore::RenderLayer::hitTest):
    (WebCore::RenderLayer::hitTestLayer):
    (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
    (WebCore::RenderLayer::calculateClipRects):
    (WebCore::RenderLayer::parentClipRects):
    (WebCore::RenderLayer::calculateRects):
    (WebCore::RenderLayer::intersectsDamageRect):
    (WebCore::RenderLayer::updateDescendantsLayerListsIfNeeded):
    (WebCore::RenderLayer::repaintIncludingDescendants):
    (WebCore::RenderLayer::paintNamedFlowThreadInsideRegion):
    (WebCore::RenderLayer::paintFlowThreadIfRegion):
    (WebCore::RenderLayer::hitTestFlowThreadIfRegion):
    * rendering/RenderLayer.h:
    (WebCore::ClipRect::inflateX):
    (WebCore::ClipRect::inflateY):
    (WebCore::ClipRect::inflate):
    * rendering/RenderLayerCompositor.cpp:
    (WebCore::RenderLayerCompositor::computeCompositingRequirements):
    * rendering/RenderListItem.cpp:
    (WebCore::RenderListItem::addOverflowFromChildren):
    * rendering/RenderMultiColumnSet.cpp:
    (WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect):
    (WebCore::RenderMultiColumnSet::repaintFlowThreadContent):
    * rendering/RenderMultiColumnSet.h:
    * rendering/RenderNamedFlowFragment.cpp:
    (WebCore::RenderNamedFlowFragment::createStyle):
    (WebCore::RenderNamedFlowFragment::namedFlowThread):
    * rendering/RenderNamedFlowFragment.h:
    * rendering/RenderOverflow.h:
    * rendering/RenderRegion.cpp:
    (WebCore::RenderRegion::flowThreadPortionOverflowRect):
    (WebCore::RenderRegion::flowThreadPortionLocation):
    (WebCore::RenderRegion::regionContainerLayer):
    (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
    (WebCore::RenderRegion::computeOverflowFromFlowThread):
    (WebCore::RenderRegion::repaintFlowThreadContent):
    (WebCore::RenderRegion::repaintFlowThreadContentRectangle):
    (WebCore::RenderRegion::insertedIntoTree):
    (WebCore::RenderRegion::ensureOverflowForBox):
    (WebCore::RenderRegion::rectFlowPortionForBox):
    (WebCore::RenderRegion::addLayoutOverflowForBox):
    (WebCore::RenderRegion::addVisualOverflowForBox):
    (WebCore::RenderRegion::layoutOverflowRectForBox):
    (WebCore::RenderRegion::visualOverflowRectForBox):
    (WebCore::RenderRegion::visualOverflowRectForBoxForPropagation):
    * rendering/RenderRegion.h:
    * rendering/RenderReplaced.cpp:
    (WebCore::RenderReplaced::shouldPaint):
    * rendering/RootInlineBox.cpp:
    (WebCore::RootInlineBox::paint):
    
    LayoutTests:
    
    Rebased some tests due to regions layers changes.
    Updated some tests to increase clarity. Some of them were only passing because two
    regions were close together and the fact that an element was being painted
    inside the wrong region was not visible. Floats are now also unsplittable.
            - bottom-overflow-out-of-first-region
            - float-pushed-width-change-2
            - float-pushed-width-change
            - webkit-flow-float-unable-to-push
    
    Changed top-overflow-out-of-second-region to reftest.
    
    Added new tests for testing the visual overflow in different situations
    (transformed, inline, opacity, floating).
    
    Reviewed by David Hyatt.
    
    * fast/regions/bottom-overflow-out-of-first-region-expected.html:
    * fast/regions/bottom-overflow-out-of-first-region.html:
    * fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005-expected.html:
    * fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005.html:
    * fast/regions/element-in-named-flow-absolute-from-fixed-expected.txt:
    * fast/regions/element-in-named-flow-fixed-from-absolute-expected.txt:
    * fast/regions/element-inflow-fixed-from-outflow-static-expected.txt:
    * fast/regions/element-outflow-static-from-inflow-fixed-expected.txt:
    * fast/regions/float-pushed-width-change-2-expected.html:
    * fast/regions/float-pushed-width-change-2.html:
    * fast/regions/float-pushed-width-change-expected.html:
    * fast/regions/float-pushed-width-change.html:
    * fast/regions/layers/dynamic-layer-added-with-no-layout-expected.txt: Added.
    * fast/regions/layers/dynamic-layer-removed-with-no-layout-expected.txt: Added.
    * fast/regions/layers/regions-promoted-to-layers-expected.txt: Added.
    * fast/regions/layers/regions-promoted-to-layers-horizontal-bt-expected.txt: Added.
    * fast/regions/layers/regions-promoted-to-layers-vertical-lr-expected.txt: Added.
    * fast/regions/layers/regions-promoted-to-layers-vertical-rl-expected.txt: Added.
    * fast/regions/outline-sides-in-region-expected.html:
    * fast/regions/outline-sides-in-region.html:
    * fast/regions/overflow-first-and-last-regions-expected.html: Added.
    * fast/regions/overflow-first-and-last-regions-in-container-hidden-expected.html: Added.
    * fast/regions/overflow-first-and-last-regions-in-container-hidden.html: Added.
    * fast/regions/overflow-first-and-last-regions.html: Added.
    * fast/regions/overflow-last-region-expected.html: Removed.
    * fast/regions/overflow-last-region.html: Removed.
    * fast/regions/overflow-nested-regions-expected.html: Added.
    * fast/regions/overflow-nested-regions.html: Added.
    * fast/regions/overflow-region-float-expected.html: Added.
    * fast/regions/overflow-region-float.html: Added.
    * fast/regions/overflow-region-inline-expected.html: Added.
    * fast/regions/overflow-region-inline.html: Added.
    * fast/regions/overflow-region-transform-expected.html: Added.
    * fast/regions/overflow-region-transform.html: Added.
    * fast/regions/overflow-scrollable-rotated-fragment-expected.html:
    * fast/regions/overflow-scrollable-rotated-fragment.html:
    * fast/regions/top-overflow-out-of-second-region-expected.html: Copied from LayoutTests/fast/regions/top-overflow-out-of-second-region.html.
    * fast/regions/top-overflow-out-of-second-region.html:
    * fast/regions/webkit-flow-float-unable-to-push-expected.html:
    * fast/regions/webkit-flow-float-unable-to-push.html:
    * platform/gtk/fast/regions/text-region-split-vertical-rl-expected.txt: Removed.
    * platform/mac-wk2/TestExpectations:
    * platform/mac/fast/regions/top-overflow-out-of-second-region-expected.png: Removed.
    * platform/mac/fast/regions/top-overflow-out-of-second-region-expected.txt: Removed.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    81613fc9
TestExpectations 31.6 KB