Changeset 168967 in webkit
- Timestamp:
- May 16, 2014 6:22:00 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r168966 r168967 1 2014-05-16 Andrei Bucur <abucur@adobe.com> 2 3 [CSS Regions] Reduce the RenderRegion invasiveness in rendering code 4 https://bugs.webkit.org/show_bug.cgi?id=132121 5 6 Reviewed by Antti Koivisto. 7 8 Remove the RenderRegion / RenderNamedFlowFragment parameters and fields from 9 the painting / hit testing data structures and use a stateful approach to 10 correctly handle regions. 11 12 When painting or hit testing, the current flow thread is saved along the current 13 region. They are accessed through the |currentRenderNamedFlowFragment| helper 14 method on RenderObject or RenderLayer. 15 16 The patch also changes a bunch of 0s to nullptrs. 17 18 Tests: No new tests, no functional change. 19 20 * html/shadow/MediaControlElements.cpp: 21 (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): 22 * rendering/HitTestLocation.cpp: 23 (WebCore::HitTestLocation::HitTestLocation): 24 (WebCore::HitTestLocation::operator=): 25 * rendering/HitTestLocation.h: 26 (WebCore::HitTestLocation::region): Deleted. 27 * rendering/HitTestResult.h: 28 * rendering/PaintInfo.h: 29 (WebCore::PaintInfo::PaintInfo): 30 * rendering/RenderBlock.cpp: 31 (WebCore::RenderBlock::paint): 32 (WebCore::RenderBlock::paintObject): 33 (WebCore::RenderBlock::selectionGaps): 34 (WebCore::RenderBlock::nodeAtPoint): 35 * rendering/RenderBox.cpp: 36 (WebCore::RenderBox::nodeAtPoint): 37 (WebCore::RenderBox::paintBoxDecorations): 38 (WebCore::RenderBox::pushContentsClip): 39 * rendering/RenderBoxModelObject.cpp: 40 (WebCore::RenderBoxModelObject::paintMaskForTextFillBox): 41 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 42 * rendering/RenderBoxModelObject.h: 43 * rendering/RenderLayer.cpp: 44 (WebCore::RenderLayer::paint): 45 (WebCore::RenderLayer::paintLayer): 46 (WebCore::RenderLayer::paintLayerContents): 47 (WebCore::RenderLayer::paintLayerByApplyingTransform): 48 (WebCore::RenderLayer::collectFragments): 49 (WebCore::RenderLayer::updatePaintingInfoForFragments): 50 (WebCore::RenderLayer::paintTransformedLayerIntoFragments): 51 (WebCore::RenderLayer::paintBackgroundForFragments): 52 (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): 53 (WebCore::RenderLayer::paintOutlineForFragments): 54 (WebCore::RenderLayer::paintMaskForFragments): 55 (WebCore::RenderLayer::hitTest): 56 (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows): 57 (WebCore::RenderLayer::hitTestLayer): 58 (WebCore::RenderLayer::hitTestTransformedLayerInFragments): 59 (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer): 60 (WebCore::RenderLayer::calculateClipRects): 61 * rendering/RenderLayer.h: 62 * rendering/RenderLayerBacking.cpp: 63 (WebCore::RenderLayerBacking::updateCompositedBounds): 64 (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): 65 * rendering/RenderLayerCompositor.cpp: 66 (WebCore::RenderLayerCompositor::addToOverlapMap): 67 (WebCore::RenderLayerCompositor::clippedByAncestor): 68 * rendering/RenderObject.cpp: 69 (WebCore::RenderObject::currentRenderNamedFlowFragment): 70 * rendering/RenderObject.h: 71 * rendering/RenderReplaced.cpp: 72 (WebCore::RenderReplaced::shouldPaint): 73 * rendering/RenderReplica.cpp: 74 (WebCore::RenderReplica::paint): 75 * rendering/RenderTable.cpp: 76 (WebCore::RenderTable::nodeAtPoint): 77 * rendering/RenderTableSection.cpp: 78 (WebCore::RenderTableSection::nodeAtPoint): 79 * rendering/RenderTreeAsText.cpp: 80 (WebCore::writeLayers): 81 * rendering/RootInlineBox.cpp: 82 (WebCore::RootInlineBox::paint): 83 * rendering/svg/RenderSVGRoot.cpp: 84 (WebCore::RenderSVGRoot::paintReplaced): 85 1 86 2014-05-16 Kiran <kiran.guduru@samsung.com> 2 87 -
trunk/Source/WebCore/html/shadow/MediaControlElements.cpp
r168905 r168967 1480 1480 return nullptr; 1481 1481 1482 layer->paint(buffer->context(), paintingRect, PaintBehaviorFlattenCompositingLayers, nullptr, nullptr,RenderLayer::PaintLayerPaintingCompositingAllPhases);1482 layer->paint(buffer->context(), paintingRect, PaintBehaviorFlattenCompositingLayers, nullptr, RenderLayer::PaintLayerPaintingCompositingAllPhases); 1483 1483 1484 1484 return buffer->copyImage(); -
trunk/Source/WebCore/rendering/HitTestLocation.cpp
r168905 r168967 48 48 49 49 HitTestLocation::HitTestLocation() 50 : m_region(0) 51 , m_isRectBased(false) 50 : m_isRectBased(false) 52 51 , m_isRectilinear(true) 53 52 { … … 59 58 , m_transformedPoint(point) 60 59 , m_transformedRect(m_boundingBox) 61 , m_region(0)62 60 , m_isRectBased(false) 63 61 , m_isRectilinear(true) … … 70 68 , m_transformedPoint(point) 71 69 , m_transformedRect(m_boundingBox) 72 , m_region(0)73 70 , m_isRectBased(false) 74 71 , m_isRectilinear(true) … … 79 76 : m_transformedPoint(point) 80 77 , m_transformedRect(quad) 81 , m_region(0)82 78 , m_isRectBased(true) 83 79 { … … 91 87 , m_boundingBox(rectForPoint(centerPoint, topPadding, rightPadding, bottomPadding, leftPadding)) 92 88 , m_transformedPoint(centerPoint) 93 , m_region(0)94 89 , m_isRectBased(topPadding || rightPadding || bottomPadding || leftPadding) 95 90 , m_isRectilinear(true) … … 98 93 } 99 94 100 HitTestLocation::HitTestLocation(const HitTestLocation& other, const LayoutSize& offset , RenderRegion* region)95 HitTestLocation::HitTestLocation(const HitTestLocation& other, const LayoutSize& offset) 101 96 : m_point(other.m_point) 102 97 , m_boundingBox(other.m_boundingBox) 103 98 , m_transformedPoint(other.m_transformedPoint) 104 99 , m_transformedRect(other.m_transformedRect) 105 , m_region(region ? region : other.m_region)106 100 , m_isRectBased(other.m_isRectBased) 107 101 , m_isRectilinear(other.m_isRectilinear) … … 115 109 , m_transformedPoint(other.m_transformedPoint) 116 110 , m_transformedRect(other.m_transformedRect) 117 , m_region(other.m_region)118 111 , m_isRectBased(other.m_isRectBased) 119 112 , m_isRectilinear(other.m_isRectilinear) … … 131 124 m_transformedPoint = other.m_transformedPoint; 132 125 m_transformedRect = other.m_transformedRect; 133 m_region = other.m_region;134 126 m_isRectBased = other.m_isRectBased; 135 127 m_isRectilinear = other.m_isRectilinear; -
trunk/Source/WebCore/rendering/HitTestLocation.h
r168905 r168967 43 43 class URL; 44 44 class Node; 45 class RenderRegion;46 45 class Scrollbar; 47 46 … … 56 55 HitTestLocation(const LayoutPoint& centerPoint, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding); 57 56 // Make a copy the HitTestLocation in a new region by applying given offset to internal point and area. 58 HitTestLocation(const HitTestLocation&, const LayoutSize& offset , RenderRegion* = 0);57 HitTestLocation(const HitTestLocation&, const LayoutSize& offset); 59 58 HitTestLocation(const HitTestLocation&); 60 59 ~HitTestLocation(); … … 63 62 const LayoutPoint& point() const { return m_point; } 64 63 IntPoint roundedPoint() const { return roundedIntPoint(m_point); } 65 66 RenderRegion* region() const { return m_region; }67 64 68 65 // Rect-based hit test related methods. … … 96 93 FloatQuad m_transformedRect; 97 94 98 RenderRegion* m_region; // The region we're inside.99 100 95 bool m_isRectBased; 101 96 bool m_isRectilinear; -
trunk/Source/WebCore/rendering/HitTestResult.h
r168905 r168967 44 44 class URL; 45 45 class Node; 46 class RenderRegion;47 46 class Scrollbar; 48 47 -
trunk/Source/WebCore/rendering/PaintInfo.h
r168905 r168967 41 41 class RenderInline; 42 42 class RenderLayerModelObject; 43 class RenderNamedFlowFragment;44 43 class RenderObject; 45 44 … … 52 51 struct PaintInfo { 53 52 PaintInfo(GraphicsContext* newContext, const LayoutRect& newRect, PaintPhase newPhase, PaintBehavior newPaintBehavior, 54 RenderObject* newSubtreePaintRoot = nullptr, RenderNamedFlowFragment* namedFlowFragment = nullptr,ListHashSet<RenderInline*>* newOutlineObjects = nullptr,53 RenderObject* newSubtreePaintRoot = nullptr, ListHashSet<RenderInline*>* newOutlineObjects = nullptr, 55 54 OverlapTestRequestMap* overlapTestRequests = nullptr, const RenderLayerModelObject* newPaintContainer = nullptr) 56 55 : context(newContext) … … 59 58 , paintBehavior(newPaintBehavior) 60 59 , subtreePaintRoot(newSubtreePaintRoot) 61 , renderNamedFlowFragment(namedFlowFragment)62 60 , outlineObjects(newOutlineObjects) 63 61 , overlapTestRequests(overlapTestRequests) … … 108 106 PaintBehavior paintBehavior; 109 107 RenderObject* subtreePaintRoot; // used to draw just one element and its visual children 110 RenderNamedFlowFragment* renderNamedFlowFragment;111 108 ListHashSet<RenderInline*>* outlineObjects; // used to list outlines that should be painted by a block with inline children 112 109 OverlapTestRequestMap* overlapTestRequests; -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r168905 r168967 1463 1463 PaintPhase phase = paintInfo.phase; 1464 1464 1465 RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment(); 1465 1466 // Check our region range to make sure we need to be painting in this region. 1466 if ( paintInfo.renderNamedFlowFragment && !paintInfo.renderNamedFlowFragment->flowThread()->objectShouldFragmentInFlowRegion(this, paintInfo.renderNamedFlowFragment))1467 if (namedFlowFragment && !namedFlowFragment->flowThread()->objectShouldFragmentInFlowRegion(this, namedFlowFragment)) 1467 1468 return; 1468 1469 … … 1471 1472 // paints the root's background. 1472 1473 if (!isRoot()) { 1473 LayoutRect overflowBox = overflowRectForPaintRejection( paintInfo.renderNamedFlowFragment);1474 LayoutRect overflowBox = overflowRectForPaintRejection(namedFlowFragment); 1474 1475 flipForWritingMode(overflowBox); 1475 1476 overflowBox.inflate(maximalOutlineSize(paintInfo.phase)); … … 1601 1602 bool didClipToRegion = false; 1602 1603 1603 if (paintInfo.paintContainer && paintInfo.renderNamedFlowFragment && paintInfo.paintContainer->isRenderNamedFlowThread()) { 1604 RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment(); 1605 if (paintInfo.paintContainer && namedFlowFragment && paintInfo.paintContainer->isRenderNamedFlowThread()) { 1604 1606 // If this box goes beyond the current region, then make sure not to overflow the region. 1605 1607 // This (overflowing region X altough also fragmented to region X+1) could happen when one of this box's children … … 1610 1612 didClipToRegion = true; 1611 1613 1612 paintInfo.context->clip(toRenderNamedFlowThread(paintInfo.paintContainer)->decorationsClipRectForBoxInNamedFlowFragment(*this, * paintInfo.renderNamedFlowFragment));1614 paintInfo.context->clip(toRenderNamedFlowThread(paintInfo.paintContainer)->decorationsClipRectForBoxInNamedFlowFragment(*this, *namedFlowFragment)); 1613 1615 } 1614 1616 … … 1918 1920 } 1919 1921 1920 if (paintInfo && paintInfo->renderNamedFlowFragment && paintInfo->paintContainer->isRenderFlowThread()) { 1922 RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment(); 1923 if (paintInfo && namedFlowFragment && paintInfo->paintContainer->isRenderFlowThread()) { 1921 1924 // Make sure the current object is actually flowed into the region being painted. 1922 if (!toRenderFlowThread(paintInfo->paintContainer)->objectShouldFragmentInFlowRegion(this, paintInfo->renderNamedFlowFragment))1925 if (!toRenderFlowThread(paintInfo->paintContainer)->objectShouldFragmentInFlowRegion(this, namedFlowFragment)) 1923 1926 return result; 1924 1927 } … … 2458 2461 LayoutSize localOffset = toLayoutSize(adjustedLocation); 2459 2462 2463 RenderFlowThread* flowThread = flowThreadContainingBlock(); 2464 RenderNamedFlowFragment* namedFlowFragment = flowThread ? toRenderNamedFlowFragment(flowThread->currentRegion()) : nullptr; 2460 2465 // If we are now searching inside a region, make sure this element 2461 2466 // is being fragmented into this region. 2462 if (locationInContainer.region()) { 2463 RenderFlowThread* flowThread = flowThreadContainingBlock(); 2464 ASSERT(flowThread); 2465 if (!flowThread->objectShouldFragmentInFlowRegion(this, locationInContainer.region())) 2466 return false; 2467 } 2467 if (namedFlowFragment && !flowThread->objectShouldFragmentInFlowRegion(this, namedFlowFragment)) 2468 return false; 2468 2469 2469 2470 if (!isRenderView()) { … … 2522 2523 bool useOverflowClip = hasOverflowClip() && !hasSelfPaintingLayer(); 2523 2524 bool useClip = (hasControlClip() || useOverflowClip); 2524 bool checkChildren = !useClip || (hasControlClip() ? locationInContainer.intersects(controlClipRect(adjustedLocation)) : locationInContainer.intersects(overflowClipRect(adjustedLocation, locationInContainer.region(), IncludeOverlayScrollbarSize)));2525 bool checkChildren = !useClip || (hasControlClip() ? locationInContainer.intersects(controlClipRect(adjustedLocation)) : locationInContainer.intersects(overflowClipRect(adjustedLocation, namedFlowFragment, IncludeOverlayScrollbarSize))); 2525 2526 if (checkChildren) { 2526 2527 // Hit test descendants first. -
trunk/Source/WebCore/rendering/RenderBox.cpp
r168905 r168967 1137 1137 } 1138 1138 1139 RenderRegion* regionToUse = locationInContainer.region(); 1140 if (regionToUse) { 1141 RenderFlowThread* flowThread = regionToUse->flowThread(); 1142 1143 // If the box is not contained by this region there's no point in going further. 1144 if (!flowThread->objectShouldFragmentInFlowRegion(this, regionToUse)) 1145 return false; 1146 } 1139 RenderFlowThread* flowThread = flowThreadContainingBlock(); 1140 RenderRegion* regionToUse = flowThread ? toRenderNamedFlowFragment(flowThread->currentRegion()) : nullptr; 1141 1142 // If the box is not contained by this region there's no point in going further. 1143 if (regionToUse && !flowThread->objectShouldFragmentInFlowRegion(this, regionToUse)) 1144 return false; 1147 1145 1148 1146 // Check our bounds next. For this purpose always assume that we can only be hit in the … … 1214 1212 return; 1215 1213 1216 LayoutRect paintRect = borderBoxRectInRegion( paintInfo.renderNamedFlowFragment);1214 LayoutRect paintRect = borderBoxRectInRegion(currentRenderNamedFlowFragment()); 1217 1215 paintRect.moveBy(paintOffset); 1218 1216 … … 1686 1684 paintInfo.phase = PaintPhaseChildBlockBackgrounds; 1687 1685 } 1688 IntRect clipRect = pixelSnappedIntRect(isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, paintInfo.renderNamedFlowFragment, IgnoreOverlayScrollbarSize, paintInfo.phase));1686 IntRect clipRect = pixelSnappedIntRect(isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, currentRenderNamedFlowFragment(), IgnoreOverlayScrollbarSize, paintInfo.phase)); 1689 1687 paintInfo.context->save(); 1690 1688 if (style().hasBorderRadius()) -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r168905 r168967 595 595 } 596 596 597 void RenderBoxModelObject::paintMaskForTextFillBox(ImageBuffer* maskImage, const IntRect& maskRect, InlineFlowBox* box, const LayoutRect& scrolledPaintRect , RenderNamedFlowFragment* namedFlowFragment)597 void RenderBoxModelObject::paintMaskForTextFillBox(ImageBuffer* maskImage, const IntRect& maskRect, InlineFlowBox* box, const LayoutRect& scrolledPaintRect) 598 598 { 599 599 GraphicsContext* maskImageContext = maskImage->context(); … … 602 602 // Now add the text to the clip. We do this by painting using a special paint phase that signals to 603 603 // InlineTextBoxes that they should just add their contents to the clip. 604 PaintInfo info(maskImageContext, maskRect, PaintPhaseTextClip, PaintBehaviorForceBlackText, 0 , namedFlowFragment);604 PaintInfo info(maskImageContext, maskRect, PaintPhaseTextClip, PaintBehaviorForceBlackText, 0); 605 605 if (box) { 606 606 const RootInlineBox& rootBox = box->root(); … … 716 716 // Clip to the overflow area. 717 717 RenderBox* thisBox = toRenderBox(this); 718 context->clip(thisBox->overflowClipRect(rect.location(), paintInfo.renderNamedFlowFragment));718 context->clip(thisBox->overflowClipRect(rect.location(), currentRenderNamedFlowFragment())); 719 719 720 720 // Adjust the paint rect to reflect a scrolled content box with borders at the ends. … … 751 751 if (!maskImage) 752 752 return; 753 paintMaskForTextFillBox(maskImage.get(), maskRect, box, scrolledPaintRect , paintInfo.renderNamedFlowFragment);753 paintMaskForTextFillBox(maskImage.get(), maskRect, box, scrolledPaintRect); 754 754 755 755 // The mask has been created. Now we just need to clip to it. -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r168905 r168967 328 328 float thickness, float drawThickness, BoxSide, const RenderStyle&, 329 329 Color, EBorderStyle, BackgroundBleedAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge); 330 void paintMaskForTextFillBox(ImageBuffer*, const IntRect&, InlineFlowBox*, const LayoutRect& , RenderNamedFlowFragment*);330 void paintMaskForTextFillBox(ImageBuffer*, const IntRect&, InlineFlowBox*, const LayoutRect&); 331 331 332 332 void pixelSnapBackgroundImageGeometryForPainting(BackgroundImageGeometry&) const; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r168905 r168967 3534 3534 } 3535 3535 3536 void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* subtreePaintRoot, RenderNamedFlowFragment* namedFlowFragment,PaintLayerFlags paintFlags)3536 void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* subtreePaintRoot, PaintLayerFlags paintFlags) 3537 3537 { 3538 3538 OverlapTestRequestMap overlapTestRequests; 3539 3539 3540 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, LayoutSize(), subtreePaintRoot, namedFlowFragment,&overlapTestRequests);3540 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, LayoutSize(), subtreePaintRoot, &overlapTestRequests); 3541 3541 paintLayer(context, paintingInfo, paintFlags); 3542 3542 … … 3682 3682 // This is true as long as we clamp the range of a box to its containing block range. 3683 3683 3684 // FIXME: Hack to disable region information for in flow threads. Implement this logic in a different way. 3685 LayerPaintingInfo& info = const_cast<LayerPaintingInfo&>(paintingInfo); 3686 RenderNamedFlowFragment* namedFlowFragment = info.renderNamedFlowFragment; 3684 // Disable named flow region information for in flow threads such as multi-col. 3685 std::unique_ptr<CurrentRenderFlowThreadDisabler> flowThreadDisabler; 3686 if (enclosingPaginationLayer()) 3687 flowThreadDisabler = std::make_unique<CurrentRenderFlowThreadDisabler>(&renderer().view()); 3688 3689 RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment(); 3687 3690 if (namedFlowFragment) { 3688 if (enclosingPaginationLayer()) 3689 info.renderNamedFlowFragment = nullptr; 3690 else { 3691 ASSERT(namedFlowFragment->isValid()); 3692 if (!namedFlowFragment->flowThread()->objectShouldFragmentInFlowRegion(&renderer(), namedFlowFragment)) 3693 return; 3694 } 3691 ASSERT(namedFlowFragment->isValid()); 3692 if (!namedFlowFragment->flowThread()->objectShouldFragmentInFlowRegion(&renderer(), namedFlowFragment)) 3693 return; 3695 3694 } 3696 3695 … … 3702 3701 TransformationMatrix layerTransform = renderableTransform(paintingInfo.paintBehavior); 3703 3702 // If the transform can't be inverted, then don't paint anything. 3704 if (!layerTransform.isInvertible()) { 3705 info.renderNamedFlowFragment = namedFlowFragment; 3703 if (!layerTransform.isInvertible()) 3706 3704 return; 3707 }3708 3705 3709 3706 // If we have a transparency layer enclosing us and we are the root of a transform, then we need to establish the transparency … … 3718 3715 if (enclosingPaginationLayer()) { 3719 3716 paintTransformedLayerIntoFragments(context, paintingInfo, paintFlags); 3720 info.renderNamedFlowFragment = namedFlowFragment;3721 3717 return; 3722 3718 } … … 3725 3721 ClipRect clipRect = paintingInfo.paintDirtyRect; 3726 3722 if (parent()) { 3727 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, paintingInfo.renderNamedFlowFragment,(paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects,3723 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, 3728 3724 IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip); 3729 3725 clipRect = backgroundClipRect(clipRectsContext); … … 3740 3736 parent()->restoreClip(context, paintingInfo.paintDirtyRect, clipRect); 3741 3737 3742 info.renderNamedFlowFragment = namedFlowFragment;3743 3738 return; 3744 3739 } 3745 3740 3746 3741 paintLayerContentsAndReflection(context, paintingInfo, paintFlags); 3747 info.renderNamedFlowFragment = namedFlowFragment;3748 3742 } 3749 3743 … … 4059 4053 paintDirtyRect = selfClipRect(); 4060 4054 } 4061 collectFragments(layerFragments, localPaintingInfo.rootLayer, localPaintingInfo.renderNamedFlowFragment,paintDirtyRect,4055 collectFragments(layerFragments, localPaintingInfo.rootLayer, paintDirtyRect, 4062 4056 (localPaintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize, 4063 4057 (isPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, &offsetFromRoot); … … 4156 4150 // Now do a paint with the root layer shifted to be us. 4157 4151 LayerPaintingInfo transformedPaintingInfo(this, LayoutRect(enclosingRectForPainting(transform.inverse().mapRect(paintingInfo.paintDirtyRect), deviceScaleFactor)), paintingInfo.paintBehavior, 4158 adjustedSubPixelAccumulation, paintingInfo.subtreePaintRoot, paintingInfo. renderNamedFlowFragment, paintingInfo.overlapTestRequests);4152 adjustedSubPixelAccumulation, paintingInfo.subtreePaintRoot, paintingInfo.overlapTestRequests); 4159 4153 paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags); 4160 4154 } … … 4203 4197 } 4204 4198 4205 void RenderLayer::collectFragments(LayerFragments& fragments, const RenderLayer* rootLayer, RenderRegion* region,const LayoutRect& dirtyRect,4199 void RenderLayer::collectFragments(LayerFragments& fragments, const RenderLayer* rootLayer, const LayoutRect& dirtyRect, 4206 4200 ClipRectsType clipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy, ShouldRespectOverflowClip respectOverflowClip, const LayoutPoint* offsetFromRoot, 4207 4201 const LayoutRect* layerBoundingBox, ShouldApplyRootOffsetToFragments applyRootOffsetToFragments) … … 4211 4205 // For unpaginated layers, there is only one fragment. 4212 4206 LayerFragment fragment; 4213 ClipRectsContext clipRectsContext(rootLayer, region,clipRectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip);4207 ClipRectsContext clipRectsContext(rootLayer, clipRectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip); 4214 4208 calculateRects(clipRectsContext, dirtyRect, fragment.layerBounds, fragment.backgroundRect, fragment.foregroundRect, fragment.outlineRect, offsetFromRoot); 4215 4209 fragments.append(fragment); … … 4223 4217 // Calculate clip rects relative to the enclosingPaginationLayer. The purpose of this call is to determine our bounds clipped to intermediate 4224 4218 // layers between us and the pagination context. It's important to minimize the number of fragments we need to create and this helps with that. 4225 ClipRectsContext paginationClipRectsContext(paginationLayer, region,clipRectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip);4219 ClipRectsContext paginationClipRectsContext(paginationLayer, clipRectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip); 4226 4220 LayoutRect layerBoundsInFlowThread; 4227 4221 ClipRect backgroundRectInFlowThread; … … 4248 4242 4249 4243 // Now collect ancestor fragments. 4250 parentPaginationLayer->collectFragments(ancestorFragments, rootLayer, region,dirtyRect, clipRectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip, nullptr, &layerFragmentBoundingBoxInParentPaginationLayer, ApplyRootOffsetToFragments);4244 parentPaginationLayer->collectFragments(ancestorFragments, rootLayer, dirtyRect, clipRectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip, nullptr, &layerFragmentBoundingBoxInParentPaginationLayer, ApplyRootOffsetToFragments); 4251 4245 4252 4246 if (ancestorFragments.isEmpty()) … … 4310 4304 ClipRect ancestorClipRect = dirtyRect; 4311 4305 if (paginationLayer->parent()) { 4312 ClipRectsContext clipRectsContext(rootLayer, region,clipRectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip);4306 ClipRectsContext clipRectsContext(rootLayer, clipRectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip); 4313 4307 ancestorClipRect = paginationLayer->backgroundClipRect(clipRectsContext); 4314 4308 ancestorClipRect.intersect(dirtyRect); … … 4346 4340 if (this != localPaintingInfo.rootLayer || !(localPaintFlags & PaintLayerPaintingOverflowContents)) { 4347 4341 LayoutPoint newOffsetFromRoot = *offsetFromRoot + fragment.paginationOffset; 4348 fragment.shouldPaintContent &= intersectsDamageRect(fragment.layerBounds, fragment.backgroundRect.rect(), localPaintingInfo.rootLayer, &newOffsetFromRoot, localPaintingInfo.renderNamedFlowFragment,fragment.hasBoundingBox ? &fragment.boundingBox : 0);4342 fragment.shouldPaintContent &= intersectsDamageRect(fragment.layerBounds, fragment.backgroundRect.rect(), localPaintingInfo.rootLayer, &newOffsetFromRoot, fragment.hasBoundingBox ? &fragment.boundingBox : 0); 4349 4343 } 4350 4344 } … … 4356 4350 LayoutPoint offsetOfPaginationLayerFromRoot; 4357 4351 LayoutRect transformedExtent = transparencyClipBox(this, enclosingPaginationLayer(), PaintingTransparencyClipBox, RootOfTransparencyClipBox, paintingInfo.paintBehavior); 4358 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, paintingInfo.rootLayer, paintingInfo. renderNamedFlowFragment, paintingInfo.paintDirtyRect,4352 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, 4359 4353 (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize, 4360 4354 (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, &offsetOfPaginationLayerFromRoot, &transformedExtent); … … 4371 4365 enclosingPaginationLayer()->convertToLayerCoords(paintingInfo.rootLayer, offsetOfPaginationLayerFromRoot); 4372 4366 4373 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), paintingInfo.renderNamedFlowFragment,(paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects,4367 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, 4374 4368 IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip); 4375 4369 LayoutRect parentClipRect = backgroundClipRect(clipRectsContext).rect(); … … 4405 4399 // Paint the background. 4406 4400 // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info. 4407 PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhaseBlockBackground, paintBehavior, subtreePaintRootForRenderer, localPaintingInfo.renderNamedFlowFragment, 0, 0, &localPaintingInfo.rootLayer->renderer());4401 PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhaseBlockBackground, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer()); 4408 4402 renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation)); 4409 4403 … … 4478 4472 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, fragment.foregroundRect); 4479 4473 4480 PaintInfo paintInfo(context, fragment.foregroundRect.rect(), phase, paintBehavior, subtreePaintRootForRenderer, localPaintingInfo.renderNamedFlowFragment, 0, 0, &localPaintingInfo.rootLayer->renderer());4474 PaintInfo paintInfo(context, fragment.foregroundRect.rect(), phase, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer()); 4481 4475 if (phase == PaintPhaseForeground) 4482 4476 paintInfo.overlapTestRequests = localPaintingInfo.overlapTestRequests; … … 4497 4491 4498 4492 // Paint our own outline 4499 PaintInfo paintInfo(context, fragment.outlineRect.rect(), PaintPhaseSelfOutline, paintBehavior, subtreePaintRootForRenderer, localPaintingInfo.renderNamedFlowFragment, 0, 0, &localPaintingInfo.rootLayer->renderer());4493 PaintInfo paintInfo(context, fragment.outlineRect.rect(), PaintPhaseSelfOutline, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer()); 4500 4494 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, fragment.outlineRect, DoNotIncludeSelfForBorderRadius); 4501 4495 renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation)); … … 4517 4511 // Paint the mask. 4518 4512 // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info. 4519 PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhaseMask, PaintBehaviorNormal, subtreePaintRootForRenderer, localPaintingInfo.renderNamedFlowFragment, 0, 0, &localPaintingInfo.rootLayer->renderer());4513 PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhaseMask, PaintBehaviorNormal, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer()); 4520 4514 renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation)); 4521 4515 … … 4551 4545 hitTestArea.intersect(renderer().view().frameView().visibleContentRect(LegacyIOSDocumentVisibleRect)); 4552 4546 4553 RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestArea, hitTestLocation, false);4547 RenderLayer* insideLayer = hitTestLayer(this, nullptr, request, result, hitTestArea, hitTestLocation, false); 4554 4548 if (!insideLayer) { 4555 4549 // We didn't hit any layer. If we are the root layer and the mouse is -- or just was -- down, … … 4700 4694 4701 4695 HitTestResult tempResult(result.hitTestLocation()); 4702 RenderLayer* hitLayer = fixedLayer->hitTestLayer(fixedLayer->renderer().flowThreadContainingBlock()->layer(), 0, request, tempResult,4696 RenderLayer* hitLayer = fixedLayer->hitTestLayer(fixedLayer->renderer().flowThreadContainingBlock()->layer(), nullptr, request, tempResult, 4703 4697 hitTestRect, hitTestLocation, false, transformState, zOffsetForDescendants); 4704 4698 … … 4735 4729 return 0; 4736 4730 4731 RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment(); 4732 4737 4733 // Prevent hitting the fixed layers inside the flow thread when hitting through regions. 4738 if (renderer().fixedPositionedWithNamedFlowContainingBlock() && hitTestLocation.region())4734 if (renderer().fixedPositionedWithNamedFlowContainingBlock() && namedFlowFragment) 4739 4735 return 0; 4740 4736 … … 4742 4738 // This is true as long as we clamp the range of a box to its containing block range. 4743 4739 // FIXME: Fix hit testing with in-flow threads included in out-of-flow threads. 4744 if ( hitTestLocation.region()) {4745 ASSERT( hitTestLocation.region()->isValid());4746 RenderFlowThread* flowThread = hitTestLocation.region()->flowThread();4747 if (!flowThread->objectShouldFragmentInFlowRegion(&renderer(), hitTestLocation.region()))4740 if (namedFlowFragment) { 4741 ASSERT(namedFlowFragment->isValid()); 4742 RenderFlowThread* flowThread = namedFlowFragment->flowThread(); 4743 if (!flowThread->objectShouldFragmentInFlowRegion(&renderer(), namedFlowFragment)) 4748 4744 return 0; 4749 4745 } … … 4758 4754 // Make sure the parent's clip rects have been calculated. 4759 4755 if (parent()) { 4760 ClipRectsContext clipRectsContext(rootLayer, hitTestLocation.region(),RootRelativeClipRects, IncludeOverlayScrollbarSize);4756 ClipRectsContext clipRectsContext(rootLayer, RootRelativeClipRects, IncludeOverlayScrollbarSize); 4761 4757 ClipRect clipRect = backgroundClipRect(clipRectsContext); 4762 4758 // Go ahead and test the enclosing clip now. … … 4848 4844 // Collect the fragments. This will compute the clip rectangles for each layer fragment. 4849 4845 LayerFragments layerFragments; 4850 collectFragments(layerFragments, rootLayer, hitTest Location.region(), hitTestRect, RootRelativeClipRects, IncludeOverlayScrollbarSize);4846 collectFragments(layerFragments, rootLayer, hitTestRect, RootRelativeClipRects, IncludeOverlayScrollbarSize); 4851 4847 4852 4848 if (canResize() && hitTestResizerInFragments(layerFragments, hitTestLocation)) { … … 4953 4949 LayoutPoint offsetOfPaginationLayerFromRoot; 4954 4950 LayoutRect transformedExtent = transparencyClipBox(this, enclosingPaginationLayer(), HitTestingTransparencyClipBox, RootOfTransparencyClipBox); 4955 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, rootLayer, hitTest Location.region(), hitTestRect,4951 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, rootLayer, hitTestRect, 4956 4952 RootRelativeClipRects, IncludeOverlayScrollbarSize, RespectOverflowClip, &offsetOfPaginationLayerFromRoot, &transformedExtent); 4957 4953 … … 4967 4963 enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOfPaginationLayerFromRoot); 4968 4964 4969 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), hitTestLocation.region(),RootRelativeClipRects, IncludeOverlayScrollbarSize);4965 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), RootRelativeClipRects, IncludeOverlayScrollbarSize); 4970 4966 LayoutRect parentClipRect = backgroundClipRect(clipRectsContext).rect(); 4971 4967 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPaginationLayerFromRoot); … … 5130 5126 } 5131 5127 5132 void RenderLayer::mapLayerClipRectsToFragmentationLayer(RenderNamedFlowFragment* namedFlowFragment, ClipRects& clipRects) const 5133 { 5134 ASSERT(namedFlowFragment && namedFlowFragment->parent() && namedFlowFragment->parent()->isRenderNamedFlowFragmentContainer()); 5135 5136 ClipRectsContext targetClipRectsContext(&namedFlowFragment->fragmentContainerLayer(), 0, TemporaryClipRects); 5128 bool RenderLayer::mapLayerClipRectsToFragmentationLayer(ClipRects& clipRects) const 5129 { 5130 RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment(); 5131 if (!namedFlowFragment) 5132 return false; 5133 5134 ASSERT(namedFlowFragment->parent() && namedFlowFragment->parent()->isRenderNamedFlowFragmentContainer()); 5135 5136 CurrentRenderFlowThreadDisabler flowThreadDisabler(&renderer().view()); 5137 ClipRectsContext targetClipRectsContext(&namedFlowFragment->fragmentContainerLayer(), TemporaryClipRects); 5137 5138 namedFlowFragment->fragmentContainerLayer().calculateClipRects(targetClipRectsContext, clipRects); 5138 5139 … … 5154 5155 newPosClipRect.move(moveOffset); 5155 5156 clipRects.setPosClipRect(newPosClipRect); 5157 5158 return true; 5156 5159 } 5157 5160 … … 5167 5170 bool useCached = clipRectsType != TemporaryClipRects; 5168 5171 5169 if (renderer().isRenderNamedFlowThread() && clipRectsContext.region) { 5170 mapLayerClipRectsToFragmentationLayer(toRenderNamedFlowFragment(clipRectsContext.region), clipRects); 5171 return; 5172 } 5172 if (renderer().isRenderNamedFlowThread() && mapLayerClipRectsToFragmentationLayer(clipRects)) 5173 return; 5173 5174 5174 5175 // For transformed layers, the root layer was shifted to be us, so there is no need to … … 5216 5217 5217 5218 if (renderer().hasOverflowClip()) { 5218 ClipRect newOverflowClip = toRenderBox(renderer()).overflowClipRectForChildLayers(offset, c lipRectsContext.region, clipRectsContext.overlayScrollbarSizeRelevancy);5219 ClipRect newOverflowClip = toRenderBox(renderer()).overflowClipRectForChildLayers(offset, currentRenderNamedFlowFragment(), clipRectsContext.overlayScrollbarSizeRelevancy); 5219 5220 if (renderer().style().hasBorderRadius()) 5220 5221 newOverflowClip.setHasRadius(true); … … 5224 5225 } 5225 5226 if (renderer().hasClip()) { 5226 LayoutRect newPosClip = toRenderBox(renderer()).clipRect(offset, c lipRectsContext.region);5227 LayoutRect newPosClip = toRenderBox(renderer()).clipRect(offset, currentRenderNamedFlowFragment()); 5227 5228 clipRects.setPosClipRect(intersection(newPosClip, clipRects.posClipRect())); 5228 5229 clipRects.setOverflowClipRect(intersection(newPosClip, clipRects.overflowClipRect())); … … 5235 5236 { 5236 5237 ASSERT(parent()); 5237 if (renderer().isRenderNamedFlowThread() && clipRectsContext.region) { 5238 mapLayerClipRectsToFragmentationLayer(toRenderNamedFlowFragment(clipRectsContext.region), clipRects); 5239 return; 5240 } 5238 if (renderer().isRenderNamedFlowThread() && mapLayerClipRectsToFragmentationLayer(clipRects)) 5239 return; 5241 5240 5242 5241 if (clipRectsContext.clipRectsType == TemporaryClipRects) { … … 5300 5299 convertToLayerCoords(clipRectsContext.rootLayer, offset); 5301 5300 5301 5302 RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment(); 5302 5303 // If the view is scrolled, the flow thread is not scrolled with it and we should 5303 5304 // take the scroll offset into account. 5304 if (clipRectsContext.rootLayer->isOutOfFlowRenderFlowThread() && ! clipRectsContext.region) {5305 if (clipRectsContext.rootLayer->isOutOfFlowRenderFlowThread() && !namedFlowFragment) { 5305 5306 FloatPoint absPos = renderer().view().localToAbsolute(FloatPoint(), IsFixed); 5306 5307 offset += LayoutSize(absPos.x(), absPos.y()); … … 5312 5313 outlineRect = backgroundRect; 5313 5314 5314 RenderFlowThread* flowThread = clipRectsContext.region ? clipRectsContext.region->flowThread() : 0;5315 RenderFlowThread* flowThread = namedFlowFragment ? namedFlowFragment->flowThread() : 0; 5315 5316 if (isSelfPaintingLayer() && flowThread && !renderer().isInFlowRenderFlowThread()) { 5316 ASSERT( clipRectsContext.region->isValid());5317 ASSERT(namedFlowFragment->isValid()); 5317 5318 const RenderBoxModelObject& boxModelObject = toRenderBoxModelObject(renderer()); 5318 LayoutRect layerBoundsWithVisualOverflow = clipRectsContext.region->visualOverflowRectForBox(&boxModelObject);5319 LayoutRect layerBoundsWithVisualOverflow = namedFlowFragment->visualOverflowRectForBox(&boxModelObject); 5319 5320 5320 5321 // Layers are in physical coordinates so the origin must be moved to the physical top-left of the flowthread. … … 5335 5336 foregroundRect = backgroundRect; 5336 5337 outlineRect = backgroundRect; 5337 5338 5338 5339 // If the region does not clip its overflow, inflate the outline rect. 5339 if ( clipRectsContext.region->isRenderNamedFlowFragment()) {5340 if (!( clipRectsContext.region->parent()->hasOverflowClip() && (&toRenderNamedFlowFragment(clipRectsContext.region)->fragmentContainerLayer() != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip)))5340 if (namedFlowFragment) { 5341 if (!(namedFlowFragment->parent()->hasOverflowClip() && (&namedFlowFragment->fragmentContainerLayer() != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip))) 5341 5342 outlineRect.inflate(renderer().maximalOutlineSize(PaintPhaseOutline)); 5342 5343 } … … 5347 5348 // This layer establishes a clip of some kind. 5348 5349 if (renderer().hasOverflowClip() && (this != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip)) { 5349 foregroundRect.intersect(toRenderBox(renderer()).overflowClipRect(offset, clipRectsContext.region, clipRectsContext.overlayScrollbarSizeRelevancy));5350 foregroundRect.intersect(toRenderBox(renderer()).overflowClipRect(offset, namedFlowFragment, clipRectsContext.overlayScrollbarSizeRelevancy)); 5350 5351 if (renderer().style().hasBorderRadius()) 5351 5352 foregroundRect.setHasRadius(true); … … 5354 5355 if (renderer().hasClip()) { 5355 5356 // Clip applies to *us* as well, so go ahead and update the damageRect. 5356 LayoutRect newPosClip = toRenderBox(renderer()).clipRect(offset, clipRectsContext.region);5357 LayoutRect newPosClip = toRenderBox(renderer()).clipRect(offset, namedFlowFragment); 5357 5358 backgroundRect.intersect(newPosClip); 5358 5359 foregroundRect.intersect(newPosClip); … … 5366 5367 // FIXME: Does not do the right thing with CSS regions yet, since we don't yet factor in the 5367 5368 // individual region boxes as overflow. 5368 LayoutRect layerBoundsWithVisualOverflow = clipRectsContext.region ? clipRectsContext.region->visualOverflowRectForBox(renderBox()) : renderBox()->visualOverflowRect();5369 LayoutRect layerBoundsWithVisualOverflow = namedFlowFragment ? namedFlowFragment->visualOverflowRectForBox(renderBox()) : renderBox()->visualOverflowRect(); 5369 5370 renderBox()->flipForWritingMode(layerBoundsWithVisualOverflow); // Layers are in physical coordinates, so the overflow has to be flipped. 5370 5371 layerBoundsWithVisualOverflow.moveBy(offset); … … 5373 5374 } else { 5374 5375 // Shift the bounds to be for our region only. 5375 LayoutRect bounds = renderBox()->borderBoxRectInRegion( clipRectsContext.region);5376 if ( clipRectsContext.region)5377 bounds = clipRectsContext.region->rectFlowPortionForBox(renderBox(), bounds);5376 LayoutRect bounds = renderBox()->borderBoxRectInRegion(namedFlowFragment); 5377 if (namedFlowFragment) 5378 bounds = namedFlowFragment->rectFlowPortionForBox(renderBox(), bounds); 5378 5379 5379 5380 bounds.moveBy(offset); … … 5403 5404 LayoutRect layerBounds; 5404 5405 ClipRect backgroundRect, foregroundRect, outlineRect; 5405 ClipRectsContext clipRectsContext(clippingRootLayer, 0,TemporaryClipRects);5406 ClipRectsContext clipRectsContext(clippingRootLayer, TemporaryClipRects); 5406 5407 // Need to use temporary clip rects, because the value of 'dontClipToOverflow' may be different from the painting path (<rdar://problem/11844909>). 5407 5408 calculateRects(clipRectsContext, renderer().view().unscaledDocumentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect); … … 5416 5417 LayoutRect layerBounds; 5417 5418 ClipRect backgroundRect, foregroundRect, outlineRect; 5418 ClipRectsContext clipRectsContext(clippingRootLayer, 0,PaintingClipRects);5419 ClipRectsContext clipRectsContext(clippingRootLayer, PaintingClipRects); 5419 5420 calculateRects(clipRectsContext, renderer().view().documentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect); 5420 5421 return clippingRootLayer->renderer().localToAbsoluteQuad(FloatQuad(backgroundRect.rect())).enclosingBoundingBox(); … … 5434 5435 LayoutRect layerBounds; 5435 5436 ClipRect backgroundRect, foregroundRect, outlineRect; 5436 ClipRectsContext clipRectsContext(clippingRootLayer, 0,PaintingClipRects);5437 ClipRectsContext clipRectsContext(clippingRootLayer, PaintingClipRects); 5437 5438 calculateRects(clipRectsContext, LayoutRect::infiniteRect(), layerBounds, backgroundRect, foregroundRect, outlineRect, &offsetFromRoot); 5438 5439 … … 5443 5444 if (renderer().hasClip()) { 5444 5445 // CSS clip may be larger than our border box. 5445 LayoutRect cssClipRect = toRenderBox(renderer()).clipRect(offsetFromRoot, c lipRectsContext.region);5446 LayoutRect cssClipRect = toRenderBox(renderer()).clipRect(offsetFromRoot, currentRenderNamedFlowFragment()); 5446 5447 clipExceedsBounds = !clipRect.contains(cssClipRect); 5447 5448 } … … 5477 5478 rect.move(-scrolledContentOffset()); 5478 5479 if (renderer().hasOverflowClip() && !usesCompositedScrolling()) 5479 rect.intersect(toRenderBox(renderer()).overflowClipRect(LayoutPoint(), 0)); // FIXME: Regions not accounted for.5480 rect.intersect(toRenderBox(renderer()).overflowClipRect(LayoutPoint(), nullptr)); // FIXME: Regions not accounted for. 5480 5481 if (renderer().hasClip()) 5481 rect.intersect(toRenderBox(renderer()).clipRect(LayoutPoint(), 0)); // FIXME: Regions not accounted for.5482 rect.intersect(toRenderBox(renderer()).clipRect(LayoutPoint(), nullptr)); // FIXME: Regions not accounted for. 5482 5483 if (!rect.isEmpty()) 5483 5484 renderer().repaintRectangle(rect); 5484 5485 } 5485 5486 5486 bool RenderLayer::intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromRoot, RenderRegion* region,const LayoutRect* cachedBoundingBox) const5487 bool RenderLayer::intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromRoot, const LayoutRect* cachedBoundingBox) const 5487 5488 { 5488 5489 // Always examine the canvas and the root. … … 5501 5502 } 5502 5503 5504 RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment(); 5503 5505 // When using regions, some boxes might have their frame rect relative to the flow thread, which could 5504 5506 // cause the paint rejection algorithm to prevent them from painting when using different width regions. 5505 5507 // e.g. an absolutely positioned box with bottom:0px and right:0px would have it's frameRect.x relative 5506 5508 // to the flow thread, not the last region (in which it will end up because of bottom:0px) 5507 if ( region&& renderer().flowThreadContainingBlock()) {5509 if (namedFlowFragment && renderer().flowThreadContainingBlock()) { 5508 5510 LayoutRect b = layerBounds; 5509 b.moveBy( region->visualOverflowRectForBox(toRenderBoxModelObject(&renderer())).location());5511 b.moveBy(namedFlowFragment->visualOverflowRectForBox(toRenderBoxModelObject(&renderer())).location()); 5510 5512 b.inflate(renderer().view().maximalOutlineSize()); 5511 5513 if (b.intersects(damageRect)) … … 5671 5673 if (RenderLayer* reflection = reflectionLayer()) { 5672 5674 if (!reflection->isComposited()) { 5673 LayoutRect childUnionBounds = reflection->calculateLayerBounds(this, 0, descendantFlags);5675 LayoutRect childUnionBounds = reflection->calculateLayerBounds(this, nullptr, descendantFlags); 5674 5676 unionBounds.unite(childUnionBounds); 5675 5677 } … … 5687 5689 RenderLayer* curLayer = negZOrderList->at(i); 5688 5690 if (flags & IncludeCompositedDescendants || !curLayer->isComposited()) { 5689 LayoutRect childUnionBounds = curLayer->calculateLayerBounds(this, 0, descendantFlags);5691 LayoutRect childUnionBounds = curLayer->calculateLayerBounds(this, nullptr, descendantFlags); 5690 5692 unionBounds.unite(childUnionBounds); 5691 5693 } … … 5699 5701 // The RenderNamedFlowThread is ignored when we calculate the bounds of the RenderView. 5700 5702 if ((flags & IncludeCompositedDescendants || !curLayer->isComposited()) && !curLayer->isFlowThreadCollectingGraphicsLayersUnderRegions()) { 5701 LayoutRect childUnionBounds = curLayer->calculateLayerBounds(this, 0, descendantFlags);5703 LayoutRect childUnionBounds = curLayer->calculateLayerBounds(this, nullptr, descendantFlags); 5702 5704 unionBounds.unite(childUnionBounds); 5703 5705 } … … 5713 5715 ASSERT(!curLayer->isFlowThreadCollectingGraphicsLayersUnderRegions()); 5714 5716 if (flags & IncludeCompositedDescendants || !curLayer->isComposited()) { 5715 LayoutRect curAbsBounds = curLayer->calculateLayerBounds(this, 0, descendantFlags);5717 LayoutRect curAbsBounds = curLayer->calculateLayerBounds(this, nullptr, descendantFlags); 5716 5718 unionBounds.unite(curAbsBounds); 5717 5719 } … … 6687 6689 context->translate(adjustedPaintOffset.x(), adjustedPaintOffset.y()); 6688 6690 6691 CurrentRenderFlowThreadMaintainer flowThreadMaintainer(toRenderFlowThread(&renderer())); 6692 CurrentRenderRegionMaintainer regionMaintainer(*region); 6693 6689 6694 region->setRegionObjectsRegionStyle(); 6690 paint(context, paintDirtyRect, paintBehavior, 0, region, paintFlags | PaintLayerTemporaryClipRects);6695 paint(context, paintDirtyRect, paintBehavior, nullptr, paintFlags | PaintLayerTemporaryClipRects); 6691 6696 region->restoreRegionObjectsOriginalStyle(); 6692 6697 … … 6783 6788 6784 6789 // Make a new temporary HitTestLocation in the new region. 6785 HitTestLocation newHitTestLocation(hitTestLocation, hitTestOffset , region);6790 HitTestLocation newHitTestLocation(hitTestLocation, hitTestOffset); 6786 6791 6787 6792 // Expand the hit-test rect to the flow thread's coordinate system. … … 6789 6794 hitTestRectInFlowThread.move(hitTestOffset.width(), hitTestOffset.height()); 6790 6795 hitTestRectInFlowThread.expand(LayoutSize(fabs((double)hitTestOffset.width()), fabs((double)hitTestOffset.height()))); 6796 6797 CurrentRenderFlowThreadMaintainer flowThreadMaintainer(flowThread); 6798 CurrentRenderRegionMaintainer regionMaintainer(*region); 6791 6799 6792 6800 HitTestResult tempResult(result.hitTestLocation()); … … 6806 6814 } 6807 6815 6816 RenderNamedFlowFragment* RenderLayer::currentRenderNamedFlowFragment() const 6817 { 6818 return renderer().currentRenderNamedFlowFragment(); 6819 } 6820 6808 6821 } // namespace WebCore 6809 6822 -
trunk/Source/WebCore/rendering/RenderLayer.h
r168905 r168967 352 352 RenderLayer* lastChild() const { return m_last; } 353 353 354 void addChild(RenderLayer* newChild, RenderLayer* beforeChild = 0);354 void addChild(RenderLayer* newChild, RenderLayer* beforeChild = nullptr); 355 355 RenderLayer* removeChild(RenderLayer*); 356 356 … … 413 413 414 414 // Scrolling methods for layers that can scroll their overflow. 415 void scrollByRecursively(const IntSize&, ScrollOffsetClamping = ScrollOffsetUnclamped, ScrollableArea** scrolledArea = 0);415 void scrollByRecursively(const IntSize&, ScrollOffsetClamping = ScrollOffsetUnclamped, ScrollableArea** scrolledArea = nullptr); 416 416 void scrollToOffset(const IntSize&, ScrollOffsetClamping = ScrollOffsetUnclamped); 417 417 void scrollToXOffset(int x, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(IntSize(x, scrollYOffset()), clamp); } … … 667 667 // front. The hitTest method looks for mouse events by walking 668 668 // layers that intersect the point from front to back. 669 void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = PaintBehaviorNormal, RenderObject* subtreePaintRoot = 0, 670 RenderNamedFlowFragment* = 0, PaintLayerFlags = 0); 669 void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = PaintBehaviorNormal, RenderObject* subtreePaintRoot = nullptr, PaintLayerFlags = 0); 671 670 bool hitTest(const HitTestRequest&, HitTestResult&); 672 671 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); 673 void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior, RenderObject* subtreePaintRoot = 0);672 void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior, RenderObject* subtreePaintRoot = nullptr); 674 673 675 674 void paintNamedFlowThreadInsideRegion(GraphicsContext*, RenderNamedFlowFragment*, LayoutRect, LayoutPoint, PaintBehavior = PaintBehaviorNormal, PaintLayerFlags = 0); 676 675 677 676 struct ClipRectsContext { 678 ClipRectsContext(const RenderLayer* inRootLayer, RenderRegion* inRegion,ClipRectsType inClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, ShouldRespectOverflowClip inRespectOverflowClip = RespectOverflowClip)677 ClipRectsContext(const RenderLayer* inRootLayer, ClipRectsType inClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, ShouldRespectOverflowClip inRespectOverflowClip = RespectOverflowClip) 679 678 : rootLayer(inRootLayer) 680 , region(inRegion)681 679 , clipRectsType(inClipRectsType) 682 680 , overlayScrollbarSizeRelevancy(inOverlayScrollbarSizeRelevancy) … … 684 682 { } 685 683 const RenderLayer* rootLayer; 686 RenderRegion* region;687 684 ClipRectsType clipRectsType; 688 685 OverlayScrollbarSizeRelevancy overlayScrollbarSizeRelevancy; … … 695 692 // Pass offsetFromRoot if known. 696 693 void calculateRects(const ClipRectsContext&, const LayoutRect& paintDirtyRect, LayoutRect& layerBounds, 697 ClipRect& backgroundRect, ClipRect& foregroundRect, ClipRect& outlineRect, const LayoutPoint* offsetFromRoot = 0) const;694 ClipRect& backgroundRect, ClipRect& foregroundRect, ClipRect& outlineRect, const LayoutPoint* offsetFromRoot = nullptr) const; 698 695 699 696 // Compute and cache clip rects computed with the given layer as the root … … 714 711 715 712 // Pass offsetFromRoot if known. 716 bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromRoot = 0, RenderRegion* = 0, const LayoutRect* cachedBoundingBox = 0) const;713 bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromRoot = nullptr, const LayoutRect* cachedBoundingBox = nullptr) const; 717 714 718 715 enum CalculateLayerBoundsFlag { … … 729 726 730 727 // Bounding box relative to some ancestor layer. Pass offsetFromRoot if known. 731 LayoutRect boundingBox(const RenderLayer* rootLayer, CalculateLayerBoundsFlags = 0, const LayoutPoint* offsetFromRoot = 0) const;728 LayoutRect boundingBox(const RenderLayer* rootLayer, CalculateLayerBoundsFlags = 0, const LayoutPoint* offsetFromRoot = nullptr) const; 732 729 // Bounding box in the coordinates of this layer. 733 730 LayoutRect localBoundingBox(CalculateLayerBoundsFlags = 0) const; … … 749 746 750 747 // Can pass offsetFromRoot if known. 751 LayoutRect calculateLayerBounds(const RenderLayer* ancestorLayer, const LayoutPoint* offsetFromRoot = 0, CalculateLayerBoundsFlags = DefaultCalculateLayerBoundsFlags) const;748 LayoutRect calculateLayerBounds(const RenderLayer* ancestorLayer, const LayoutPoint* offsetFromRoot = nullptr, CalculateLayerBoundsFlags = DefaultCalculateLayerBoundsFlags) const; 752 749 753 750 // WARNING: This method returns the offset for the parent as this is what updateLayerPositions expects. … … 907 904 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<const RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIteration); 908 905 909 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, const RenderGeometryMap* = 0);906 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, const RenderGeometryMap* = nullptr); 910 907 void computeRepaintRectsIncludingDescendants(); 911 908 void clearRepaintRects(); … … 932 929 bool updateLayerPosition(); 933 930 934 void updateLayerPositions(RenderGeometryMap* = 0, UpdateLayerPositionsFlags = defaultFlags);931 void updateLayerPositions(RenderGeometryMap* = nullptr, UpdateLayerPositionsFlags = defaultFlags); 935 932 936 933 enum UpdateLayerPositionsAfterScrollFlag { … … 964 961 965 962 struct LayerPaintingInfo { 966 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, RenderObject* inSubtreePaintRoot = 0, RenderNamedFlowFragment* namedFlowFragment = 0, OverlapTestRequestMap* inOverlapTestRequests = 0)963 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, RenderObject* inSubtreePaintRoot = nullptr, OverlapTestRequestMap* inOverlapTestRequests = nullptr) 967 964 : rootLayer(inRootLayer) 968 965 , subtreePaintRoot(inSubtreePaintRoot) 969 966 , paintDirtyRect(inDirtyRect) 970 967 , subPixelAccumulation(inSubPixelAccumulation) 971 , renderNamedFlowFragment(namedFlowFragment)972 968 , overlapTestRequests(inOverlapTestRequests) 973 969 , paintBehavior(inPaintBehavior) … … 978 974 LayoutRect paintDirtyRect; // relative to rootLayer; 979 975 LayoutSize subPixelAccumulation; 980 RenderNamedFlowFragment* renderNamedFlowFragment; // May be null.981 976 OverlapTestRequestMap* overlapTestRequests; // May be null. 982 977 PaintBehavior paintBehavior; … … 998 993 void paintList(Vector<RenderLayer*>*, GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags); 999 994 1000 void collectFragments(LayerFragments&, const RenderLayer* rootLayer, RenderRegion*,const LayoutRect& dirtyRect,995 void collectFragments(LayerFragments&, const RenderLayer* rootLayer, const LayoutRect& dirtyRect, 1001 996 ClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, 1002 ShouldRespectOverflowClip = RespectOverflowClip, const LayoutPoint* offsetFromRoot = 0, const LayoutRect* layerBoundingBox = 0, ShouldApplyRootOffsetToFragments = IgnoreRootOffsetForFragments);997 ShouldRespectOverflowClip = RespectOverflowClip, const LayoutPoint* offsetFromRoot = nullptr, const LayoutRect* layerBoundingBox = nullptr, ShouldApplyRootOffsetToFragments = IgnoreRootOffsetForFragments); 1003 998 void updatePaintingInfoForFragments(LayerFragments&, const LayerPaintingInfo&, PaintLayerFlags, bool shouldPaintContent, const LayoutPoint* offsetFromRoot); 1004 999 void paintBackgroundForFragments(const LayerFragments&, GraphicsContext*, GraphicsContext* transparencyLayerContext, … … 1014 1009 1015 1010 RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLayer, const HitTestRequest& request, HitTestResult& result, 1016 1017 const HitTestingTransformState* transformState = 0, double* zOffset = 0);1011 const LayoutRect& hitTestRect, const HitTestLocation&, bool appliedTransform, 1012 const HitTestingTransformState* = nullptr, double* zOffset = nullptr); 1018 1013 RenderLayer* hitTestLayerByApplyingTransform(RenderLayer* rootLayer, RenderLayer* containerLayer, const HitTestRequest&, HitTestResult&, 1019 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingTransformState* = 0, double* zOffset = 0,1014 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingTransformState* = nullptr, double* zOffset = nullptr, 1020 1015 const LayoutPoint& translationOffset = LayoutPoint()); 1021 1016 RenderLayer* hitTestList(Vector<RenderLayer*>*, RenderLayer* rootLayer, const HitTestRequest& request, HitTestResult& result, 1022 1023 const HitTestingTransformState* transformState, double* zOffsetForDescendants, double* zOffset,1024 1017 const LayoutRect& hitTestRect, const HitTestLocation&, 1018 const HitTestingTransformState*, double* zOffsetForDescendants, double* zOffset, 1019 const HitTestingTransformState* unflattenedTransformState, bool depthSortDescendants); 1025 1020 1026 1021 RenderLayer* hitTestFixedLayersInNamedFlows(RenderLayer* rootLayer, … … 1033 1028 1034 1029 PassRefPtr<HitTestingTransformState> createLocalTransformState(RenderLayer* rootLayer, RenderLayer* containerLayer, 1035 1036 1037 1030 const LayoutRect& hitTestRect, const HitTestLocation&, 1031 const HitTestingTransformState* containerTransformState, 1032 const LayoutPoint& translationOffset = LayoutPoint()) const; 1038 1033 1039 1034 bool hitTestContents(const HitTestRequest&, HitTestResult&, const LayoutRect& layerBounds, const HitTestLocation&, HitTestFilter) const; … … 1041 1036 bool hitTestResizerInFragments(const LayerFragments&, const HitTestLocation&) const; 1042 1037 RenderLayer* hitTestTransformedLayerInFragments(RenderLayer* rootLayer, RenderLayer* containerLayer, const HitTestRequest&, HitTestResult&, 1043 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingTransformState* = 0, double* zOffset = 0);1038 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingTransformState* = nullptr, double* zOffset = nullptr); 1044 1039 1045 1040 bool listBackgroundIsKnownToBeOpaqueInRect(const Vector<RenderLayer*>*, const LayoutRect&) const; … … 1103 1098 void setAncestorChainHasVisibleDescendant(); 1104 1099 1105 void updateDescendantDependentFlags(HashSet<const RenderObject*>* outOfFlowDescendantContainingBlocks = 0);1100 void updateDescendantDependentFlags(HashSet<const RenderObject*>* outOfFlowDescendantContainingBlocks = nullptr); 1106 1101 bool checkIfDescendantClippingContextNeedsUpdate(bool isClipping); 1107 1102 … … 1191 1186 double* zOffset, const HitTestingTransformState* unflattenedTransformState, bool depthSortDescendants); 1192 1187 void paintFlowThreadIfRegionForFragments(const LayerFragments&, GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags); 1193 void mapLayerClipRectsToFragmentationLayer(RenderNamedFlowFragment*, ClipRects&) const; 1188 bool mapLayerClipRectsToFragmentationLayer(ClipRects&) const; 1189 1190 RenderNamedFlowFragment* currentRenderNamedFlowFragment() const; 1194 1191 1195 1192 private: -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r168905 r168967 461 461 462 462 if (&m_owningLayer != rootLayer) 463 clippingBounds.intersect(m_owningLayer.backgroundClipRect(RenderLayer::ClipRectsContext(rootLayer, 0,AbsoluteClipRects)).rect()); // FIXME: Incorrect for CSS regions.463 clippingBounds.intersect(m_owningLayer.backgroundClipRect(RenderLayer::ClipRectsContext(rootLayer, AbsoluteClipRects)).rect()); // FIXME: Incorrect for CSS regions. 464 464 465 465 LayoutPoint delta; … … 777 777 // for a compositing layer, rootLayer is the layer itself. 778 778 ShouldRespectOverflowClip shouldRespectOverflowClip = compAncestor->isolatesCompositedBlending() ? RespectOverflowClip : IgnoreOverflowClip; 779 RenderLayer::ClipRectsContext clipRectsContext(compAncestor, 0,TemporaryClipRects, IgnoreOverlayScrollbarSize, shouldRespectOverflowClip);779 RenderLayer::ClipRectsContext clipRectsContext(compAncestor, TemporaryClipRects, IgnoreOverlayScrollbarSize, shouldRespectOverflowClip); 780 780 LayoutRect parentClipRect = m_owningLayer.backgroundClipRect(clipRectsContext).rect(); // FIXME: Incorrect for CSS regions. 781 781 ASSERT(parentClipRect != LayoutRect::infiniteRect()); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r168905 r168967 1020 1020 } 1021 1021 1022 IntRect clipRect = pixelSnappedIntRect(layer.backgroundClipRect(RenderLayer::ClipRectsContext(&rootRenderLayer(), 0,AbsoluteClipRects)).rect()); // FIXME: Incorrect for CSS regions.1022 IntRect clipRect = pixelSnappedIntRect(layer.backgroundClipRect(RenderLayer::ClipRectsContext(&rootRenderLayer(), AbsoluteClipRects)).rect()); // FIXME: Incorrect for CSS regions. 1023 1023 1024 1024 // On iOS, pageScaleFactor() is not applied by RenderView, so we should not scale here. … … 2337 2337 } 2338 2338 2339 return layer.backgroundClipRect(RenderLayer::ClipRectsContext(computeClipRoot, 0,TemporaryClipRects)).rect() != LayoutRect::infiniteRect(); // FIXME: Incorrect for CSS regions.2339 return layer.backgroundClipRect(RenderLayer::ClipRectsContext(computeClipRoot, TemporaryClipRects)).rect() != LayoutRect::infiniteRect(); // FIXME: Incorrect for CSS regions. 2340 2340 } 2341 2341 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r168905 r168967 55 55 #include "RenderLayer.h" 56 56 #include "RenderLayerBacking.h" 57 #include "RenderNamedFlowThread.h" 57 #include "RenderNamedFlowFragment.h" 58 #include "RenderNamedFlowThread.h" 58 59 #include "RenderSVGResourceContainer.h" 59 60 #include "RenderScrollbarPart.h" … … 2474 2475 } 2475 2476 2477 RenderNamedFlowFragment* RenderObject::currentRenderNamedFlowFragment() const 2478 { 2479 if (flowThreadState() == NotInsideFlowThread) 2480 return nullptr; 2481 2482 RenderFlowThread* flowThread = view().flowThreadController().currentRenderFlowThread(); 2483 if (!flowThread) 2484 return nullptr; 2485 2486 ASSERT(flowThread == flowThreadContainingBlock()); 2487 2488 // FIXME: Once regions are fully integrated with the compositing system we should uncomment this assert. 2489 // This assert needs to be disabled because it's possible to ask for the ancestor clipping rectangle of 2490 // a layer without knowing the containing region in advance. 2491 // ASSERT(flowThread->currentRegion() && flowThread->currentRegion()->isRenderNamedFlowFragment()); 2492 2493 RenderNamedFlowFragment* namedFlowFragment = toRenderNamedFlowFragment(flowThread->currentRegion()); 2494 return namedFlowFragment; 2495 } 2496 2476 2497 } // namespace WebCore 2477 2498 -
trunk/Source/WebCore/rendering/RenderObject.h
r168905 r168967 218 218 return locateFlowThreadContainingBlock(); 219 219 } 220 221 RenderNamedFlowFragment* currentRenderNamedFlowFragment() const; 220 222 221 223 // FIXME: The meaning of this function is unclear. -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r168905 r168967 207 207 return false; 208 208 209 RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment(); 209 210 // Check our region range to make sure we need to be painting in this region. 210 if ( paintInfo.renderNamedFlowFragment && !paintInfo.renderNamedFlowFragment->flowThread()->objectShouldFragmentInFlowRegion(this, paintInfo.renderNamedFlowFragment))211 if (namedFlowFragment && !namedFlowFragment->flowThread()->objectShouldFragmentInFlowRegion(this, namedFlowFragment)) 211 212 return false; 212 213 -
trunk/Source/WebCore/rendering/RenderReplica.cpp
r168905 r168967 75 75 // computing using the wrong rootLayer 76 76 RenderLayer* rootPaintingLayer = layer()->transform() ? layer()->parent() : layer()->enclosingTransformedAncestor(); 77 RenderLayer::LayerPaintingInfo paintingInfo(rootPaintingLayer, paintInfo.rect, PaintBehaviorNormal, LayoutSize(), 0 , paintInfo.renderNamedFlowFragment);77 RenderLayer::LayerPaintingInfo paintingInfo(rootPaintingLayer, paintInfo.rect, PaintBehaviorNormal, LayoutSize(), 0); 78 78 RenderLayer::PaintLayerFlags flags = RenderLayer::PaintLayerHaveTransparency | RenderLayer::PaintLayerAppliedTransform | RenderLayer::PaintLayerTemporaryClipRects | RenderLayer::PaintLayerPaintingReflection; 79 79 layer()->parent()->paintLayer(paintInfo.context, paintingInfo, flags); -
trunk/Source/WebCore/rendering/RenderTable.cpp
r168905 r168967 38 38 #include "RenderIterator.h" 39 39 #include "RenderLayer.h" 40 #include "RenderNamedFlowFragment.h" 40 41 #include "RenderTableCaption.h" 41 42 #include "RenderTableCell.h" … … 1494 1495 1495 1496 // Check kids first. 1496 if (!hasOverflowClip() || locationInContainer.intersects(overflowClipRect(adjustedLocation, locationInContainer.region()))) {1497 if (!hasOverflowClip() || locationInContainer.intersects(overflowClipRect(adjustedLocation, currentRenderNamedFlowFragment()))) { 1497 1498 for (RenderObject* child = lastChild(); child; child = child->previousSibling()) { 1498 1499 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child->isTableCaption())) { -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r168905 r168967 30 30 #include "HTMLNames.h" 31 31 #include "PaintInfo.h" 32 #include "RenderNamedFlowFragment.h" 32 33 #include "RenderTableCell.h" 33 34 #include "RenderTableCol.h" … … 1495 1496 LayoutPoint adjustedLocation = accumulatedOffset + location(); 1496 1497 1497 if (hasOverflowClip() && !locationInContainer.intersects(overflowClipRect(adjustedLocation, locationInContainer.region())))1498 if (hasOverflowClip() && !locationInContainer.intersects(overflowClipRect(adjustedLocation, currentRenderNamedFlowFragment()))) 1498 1499 return false; 1499 1500 -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r168905 r168967 742 742 LayoutRect layerBounds; 743 743 ClipRect damageRect, clipRectToApply, outlineRect; 744 l->calculateRects(RenderLayer::ClipRectsContext(rootLayer, 0,TemporaryClipRects), paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect);744 l->calculateRects(RenderLayer::ClipRectsContext(rootLayer, TemporaryClipRects), paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect); 745 745 746 746 // Ensure our lists are up-to-date. -
trunk/Source/WebCore/rendering/RootInlineBox.cpp
r168905 r168967 174 174 void RootInlineBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom) 175 175 { 176 RenderNamedFlowFragment* namedFlowFragment = renderer().currentRenderNamedFlowFragment(); 177 176 178 // Check if we are in the correct region. 177 if ( paintInfo.renderNamedFlowFragment) {179 if (namedFlowFragment) { 178 180 RenderRegion* region = containingRegion(); 179 if (region && region != reinterpret_cast<RenderRegion*>( paintInfo.renderNamedFlowFragment))181 if (region && region != reinterpret_cast<RenderRegion*>(namedFlowFragment)) 180 182 return; 181 183 } -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r168905 r168967 265 265 // Apply initial viewport clip 266 266 if (shouldApplyViewportClip()) 267 childPaintInfo.context->clip(pixelSnappedIntRect(overflowClipRect(paintOffset, paintInfo.renderNamedFlowFragment)));267 childPaintInfo.context->clip(pixelSnappedIntRect(overflowClipRect(paintOffset, currentRenderNamedFlowFragment()))); 268 268 269 269 // Convert from container offsets (html renderers) to a relative transform (svg renderers).
Note: See TracChangeset
for help on using the changeset viewer.