Changeset 164482 in webkit
- Timestamp:
- Feb 21, 2014 7:29:49 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r164481 r164482 1 2014-02-21 Radu Stavila <stavila@adobe.com> 2 3 [CSS Regions] Use the named-flow-specific object RenderNamedFlowFragment instead of the generic RenderRegion whenever possible 4 https://bugs.webkit.org/show_bug.cgi?id=128599 5 6 Reviewed by Andrei Bucur. 7 8 Use the named flow specific RenderNamedFlowFragment instead of the generic RenderRegion, whenever possible. 9 Move named flow specific methods from RenderRegion to RenderNamedFlowFragment. 10 11 No new tests required. 12 13 * dom/Element.cpp: 14 (WebCore::Element::renderNamedFlowFragment): 15 (WebCore::Element::webkitRegionOverset): 16 (WebCore::Element::webkitGetRegionFlowRanges): 17 * dom/Element.h: 18 * inspector/InspectorCSSAgent.cpp: 19 (WebCore::InspectorCSSAgent::buildArrayForRegions): 20 * rendering/PaintInfo.h: 21 (WebCore::PaintInfo::PaintInfo): 22 * rendering/RenderBlock.cpp: 23 (WebCore::RenderBlock::paint): 24 (WebCore::RenderBlock::paintObject): 25 * rendering/RenderBox.cpp: 26 (WebCore::RenderBox::paintBoxDecorations): 27 (WebCore::RenderBox::pushContentsClip): 28 (WebCore::RenderBox::layoutOverflowRectForPropagation): 29 * rendering/RenderBox.h: 30 * rendering/RenderBoxModelObject.cpp: 31 (WebCore::RenderBoxModelObject::paintMaskForTextFillBox): 32 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 33 * rendering/RenderBoxModelObject.h: 34 * rendering/RenderInline.h: 35 * rendering/RenderLayer.cpp: 36 (WebCore::RenderLayer::paint): 37 (WebCore::RenderLayer::paintLayer): 38 (WebCore::RenderLayer::paintLayerContents): 39 (WebCore::RenderLayer::paintLayerByApplyingTransform): 40 (WebCore::RenderLayer::updatePaintingInfoForFragments): 41 (WebCore::RenderLayer::paintTransformedLayerIntoFragments): 42 (WebCore::RenderLayer::paintBackgroundForFragments): 43 (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): 44 (WebCore::RenderLayer::paintOutlineForFragments): 45 (WebCore::RenderLayer::paintMaskForFragments): 46 (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer): 47 (WebCore::RenderLayer::calculateClipRects): 48 * rendering/RenderLayer.h: 49 * rendering/RenderNamedFlowFragment.cpp: 50 (WebCore::RenderNamedFlowFragment::getRanges): 51 * rendering/RenderNamedFlowFragment.h: 52 * rendering/RenderNamedFlowThread.cpp: 53 (WebCore::RenderNamedFlowThread::updateWritingMode): 54 (WebCore::compareRenderNamedFlowFragments): 55 (WebCore::addFragmentToList): 56 (WebCore::RenderNamedFlowThread::addFragmentToNamedFlowThread): 57 (WebCore::RenderNamedFlowThread::addRegionToThread): 58 (WebCore::RenderNamedFlowThread::removeRegionFromThread): 59 (WebCore::RenderNamedFlowThread::computeOversetStateForRegions): 60 (WebCore::RenderNamedFlowThread::checkInvalidRegions): 61 (WebCore::RenderNamedFlowThread::getRanges): 62 (WebCore::RenderNamedFlowThread::checkRegionsWithStyling): 63 (WebCore::RenderNamedFlowThread::clearRenderObjectCustomStyle): 64 * rendering/RenderNamedFlowThread.h: 65 * rendering/RenderRegion.cpp: 66 * rendering/RenderRegion.h: 67 * rendering/RenderReplaced.cpp: 68 (WebCore::RenderReplaced::shouldPaint): 69 * rendering/RenderReplica.cpp: 70 (WebCore::RenderReplica::paint): 71 * rendering/RootInlineBox.cpp: 72 (WebCore::RootInlineBox::paint): 73 * rendering/svg/RenderSVGRoot.cpp: 74 (WebCore::RenderSVGRoot::paintReplaced): 75 1 76 2014-02-21 Andrei Bucur <abucur@adobe.com> 2 77 -
trunk/Source/WebCore/dom/Element.cpp
r164195 r164482 2550 2550 } 2551 2551 2552 Render Region* Element::renderRegion() const2552 RenderNamedFlowFragment* Element::renderNamedFlowFragment() const 2553 2553 { 2554 2554 if (renderer() && renderer()->isRenderNamedFlowFragmentContainer()) 2555 2555 return toRenderBlockFlow(renderer())->renderNamedFlowFragment(); 2556 2556 2557 return 0;2557 return nullptr; 2558 2558 } 2559 2559 … … 2581 2581 2582 2582 DEFINE_STATIC_LOCAL(AtomicString, undefinedState, ("undefined", AtomicString::ConstructFromLiteral)); 2583 if (!document().cssRegionsEnabled() || !render Region())2583 if (!document().cssRegionsEnabled() || !renderNamedFlowFragment()) 2584 2584 return undefinedState; 2585 2585 2586 switch (render Region()->regionOversetState()) {2586 switch (renderNamedFlowFragment()->regionOversetState()) { 2587 2587 case RegionFit: { 2588 2588 DEFINE_STATIC_LOCAL(AtomicString, fitState, ("fit", AtomicString::ConstructFromLiteral)); … … 2613 2613 document().updateLayoutIgnorePendingStylesheets(); 2614 2614 if (renderer() && renderer()->isRenderNamedFlowFragmentContainer()) { 2615 RenderNamedFlowFragment* region= toRenderBlockFlow(renderer())->renderNamedFlowFragment();2616 if ( region->isValid())2617 region->getRanges(rangeObjects);2615 RenderNamedFlowFragment* namedFlowFragment = toRenderBlockFlow(renderer())->renderNamedFlowFragment(); 2616 if (namedFlowFragment->isValid()) 2617 namedFlowFragment->getRanges(rangeObjects); 2618 2618 } 2619 2619 -
trunk/Source/WebCore/dom/Element.h
r164248 r164482 48 48 class PlatformWheelEvent; 49 49 class PseudoElement; 50 class Render Region;50 class RenderNamedFlowFragment; 51 51 class ShadowRoot; 52 52 … … 527 527 PassRef<RenderStyle> styleForRenderer(); 528 528 529 Render Region* renderRegion() const;529 RenderNamedFlowFragment* renderNamedFlowFragment() const; 530 530 531 531 #if ENABLE(CSS_REGIONS) -
trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp
r164245 r164482 49 49 #include "Node.h" 50 50 #include "NodeList.h" 51 #include "Render Region.h"51 #include "RenderNamedFlowFragment.h" 52 52 #include "SVGStyleElement.h" 53 53 #include "StyleProperties.h" … … 1197 1197 Inspector::TypeBuilder::CSS::Region::RegionOverset::Enum regionOverset; 1198 1198 1199 switch (toElement(regionList->item(i))->render Region()->regionOversetState()) {1199 switch (toElement(regionList->item(i))->renderNamedFlowFragment()->regionOversetState()) { 1200 1200 case RegionFit: 1201 1201 regionOverset = Inspector::TypeBuilder::CSS::Region::RegionOverset::Fit; -
trunk/Source/WebCore/rendering/PaintInfo.h
r163440 r164482 41 41 class RenderInline; 42 42 class RenderLayerModelObject; 43 class RenderNamedFlowFragment; 43 44 class RenderObject; 44 class RenderRegion;45 45 46 46 typedef HashMap<OverlapTestRequestClient*, IntRect> OverlapTestRequestMap; … … 52 52 struct PaintInfo { 53 53 PaintInfo(GraphicsContext* newContext, const LayoutRect& newRect, PaintPhase newPhase, PaintBehavior newPaintBehavior, 54 RenderObject* newSubtreePaintRoot = nullptr, Render Region* region= nullptr, ListHashSet<RenderInline*>* newOutlineObjects = nullptr,54 RenderObject* newSubtreePaintRoot = nullptr, RenderNamedFlowFragment* namedFlowFragment = nullptr, ListHashSet<RenderInline*>* newOutlineObjects = nullptr, 55 55 OverlapTestRequestMap* overlapTestRequests = nullptr, const RenderLayerModelObject* newPaintContainer = nullptr) 56 : context(newContext)57 , rect(newRect)58 , phase(newPhase)59 , paintBehavior(newPaintBehavior)60 , subtreePaintRoot(newSubtreePaintRoot)61 , renderRegion(region)62 , outlineObjects(newOutlineObjects)63 , overlapTestRequests(overlapTestRequests)64 , paintContainer(newPaintContainer)56 : context(newContext) 57 , rect(newRect) 58 , phase(newPhase) 59 , paintBehavior(newPaintBehavior) 60 , subtreePaintRoot(newSubtreePaintRoot) 61 , renderNamedFlowFragment(namedFlowFragment) 62 , outlineObjects(newOutlineObjects) 63 , overlapTestRequests(overlapTestRequests) 64 , paintContainer(newPaintContainer) 65 65 { 66 66 } … … 108 108 PaintBehavior paintBehavior; 109 109 RenderObject* subtreePaintRoot; // used to draw just one element and its visual children 110 Render Region* renderRegion;110 RenderNamedFlowFragment* renderNamedFlowFragment; 111 111 ListHashSet<RenderInline*>* outlineObjects; // used to list outlines that should be painted by a block with inline children 112 112 OverlapTestRequestMap* overlapTestRequests; -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r164006 r164482 1998 1998 1999 1999 // Check our region range to make sure we need to be painting in this region. 2000 if (paintInfo.render Region && !paintInfo.renderRegion->flowThread()->objectShouldPaintInFlowRegion(this, paintInfo.renderRegion))2000 if (paintInfo.renderNamedFlowFragment && !paintInfo.renderNamedFlowFragment->flowThread()->objectShouldPaintInFlowRegion(this, paintInfo.renderNamedFlowFragment)) 2001 2001 return; 2002 2002 … … 2005 2005 // paints the root's background. 2006 2006 if (!isRoot()) { 2007 LayoutRect overflowBox = overflowRectForPaintRejection(paintInfo.render Region);2007 LayoutRect overflowBox = overflowRectForPaintRejection(paintInfo.renderNamedFlowFragment); 2008 2008 flipForWritingMode(overflowBox); 2009 2009 overflowBox.inflate(maximalOutlineSize(paintInfo.phase)); … … 2302 2302 bool didClipToRegion = false; 2303 2303 2304 if (paintInfo.paintContainer && paintInfo.render Region&& paintInfo.paintContainer->isRenderFlowThread()) {2304 if (paintInfo.paintContainer && paintInfo.renderNamedFlowFragment && paintInfo.paintContainer->isRenderFlowThread()) { 2305 2305 // If this box goes beyond the current region, then make sure not to overflow the region. 2306 2306 // This (overflowing region X altough also fragmented to region X+1) could happen when one of this box's children … … 2311 2311 didClipToRegion = true; 2312 2312 2313 paintInfo.context->clip(toRenderFlowThread(paintInfo.paintContainer)->decorationsClipRectForBoxInRegion(*this, *paintInfo.render Region));2313 paintInfo.context->clip(toRenderFlowThread(paintInfo.paintContainer)->decorationsClipRectForBoxInRegion(*this, *paintInfo.renderNamedFlowFragment)); 2314 2314 } 2315 2315 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r164471 r164482 51 51 #include "RenderLayer.h" 52 52 #include "RenderLayerCompositor.h" 53 #include "Render Region.h"53 #include "RenderNamedFlowFragment.h" 54 54 #include "RenderTableCell.h" 55 55 #include "RenderTheme.h" … … 1187 1187 return; 1188 1188 1189 LayoutRect paintRect = borderBoxRectInRegion(paintInfo.render Region);1189 LayoutRect paintRect = borderBoxRectInRegion(paintInfo.renderNamedFlowFragment); 1190 1190 paintRect.moveBy(paintOffset); 1191 1191 … … 1646 1646 paintInfo.phase = PaintPhaseChildBlockBackgrounds; 1647 1647 } 1648 IntRect clipRect = pixelSnappedIntRect(isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, paintInfo.render Region, IgnoreOverlayScrollbarSize, paintInfo.phase));1648 IntRect clipRect = pixelSnappedIntRect(isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, paintInfo.renderNamedFlowFragment, IgnoreOverlayScrollbarSize, paintInfo.phase)); 1649 1649 paintInfo.context->save(); 1650 1650 if (style().hasBorderRadius()) … … 4522 4522 } 4523 4523 4524 LayoutRect RenderBox::overflowRectForPaintRejection(Render Region* region) const4524 LayoutRect RenderBox::overflowRectForPaintRejection(RenderNamedFlowFragment* namedFlowFragment) const 4525 4525 { 4526 4526 LayoutRect overflowRect = visualOverflowRect(); … … 4530 4530 // e.g. an absolutely positioned box with bottom:0px and right:0px would have it's frameRect.x relative 4531 4531 // to the flow thread, not the last region (in which it will end up because of bottom:0px) 4532 if ( region) {4533 if (RenderFlowThread* flowThread = region->flowThread()) {4532 if (namedFlowFragment) { 4533 if (RenderFlowThread* flowThread = namedFlowFragment->flowThread()) { 4534 4534 RenderRegion* startRegion = 0; 4535 4535 RenderRegion* endRegion = 0; … … 4537 4537 4538 4538 if (startRegion && endRegion) 4539 overflowRect.unite( region->visualOverflowRectForBox(this));4539 overflowRect.unite(namedFlowFragment->visualOverflowRectForBox(this)); 4540 4540 } 4541 4541 } -
trunk/Source/WebCore/rendering/RenderBox.h
r163793 r164482 192 192 LayoutUnit logicalRightVisualOverflow() const { return style().isHorizontalWritingMode() ? visualOverflowRect().maxX() : visualOverflowRect().maxY(); } 193 193 194 LayoutRect overflowRectForPaintRejection(Render Region*) const;194 LayoutRect overflowRectForPaintRejection(RenderNamedFlowFragment*) const; 195 195 196 196 void addLayoutOverflow(const LayoutRect&); -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r164474 r164482 571 571 } 572 572 573 void RenderBoxModelObject::paintMaskForTextFillBox(ImageBuffer* maskImage, const IntRect& maskRect, InlineFlowBox* box, const LayoutRect& scrolledPaintRect, Render Region* region)573 void RenderBoxModelObject::paintMaskForTextFillBox(ImageBuffer* maskImage, const IntRect& maskRect, InlineFlowBox* box, const LayoutRect& scrolledPaintRect, RenderNamedFlowFragment* namedFlowFragment) 574 574 { 575 575 GraphicsContext* maskImageContext = maskImage->context(); … … 578 578 // Now add the text to the clip. We do this by painting using a special paint phase that signals to 579 579 // InlineTextBoxes that they should just add their contents to the clip. 580 PaintInfo info(maskImageContext, maskRect, PaintPhaseTextClip, PaintBehaviorForceBlackText, 0, region);580 PaintInfo info(maskImageContext, maskRect, PaintPhaseTextClip, PaintBehaviorForceBlackText, 0, namedFlowFragment); 581 581 if (box) { 582 582 const RootInlineBox& rootBox = box->root(); … … 690 690 // Clip to the overflow area. 691 691 RenderBox* thisBox = toRenderBox(this); 692 context->clip(thisBox->overflowClipRect(rect.location(), paintInfo.render Region));692 context->clip(thisBox->overflowClipRect(rect.location(), paintInfo.renderNamedFlowFragment)); 693 693 694 694 // Adjust the paint rect to reflect a scrolled content box with borders at the ends. … … 725 725 if (!maskImage) 726 726 return; 727 paintMaskForTextFillBox(maskImage.get(), maskRect, box, scrolledPaintRect, paintInfo.render Region);727 paintMaskForTextFillBox(maskImage.get(), maskRect, box, scrolledPaintRect, paintInfo.renderNamedFlowFragment); 728 728 729 729 // The mask has been created. Now we just need to clip to it. -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r164441 r164482 55 55 class InlineFlowBox; 56 56 class KeyframeList; 57 class RenderNamedFlowFragment; 57 58 class RenderTextFragment; 58 59 class StickyPositionViewportConstraints; … … 341 342 float thickness, float drawThickness, BoxSide, const RenderStyle*, 342 343 Color, EBorderStyle, BackgroundBleedAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge); 343 void paintMaskForTextFillBox(ImageBuffer*, const IntRect&, InlineFlowBox*, const LayoutRect&, Render Region*);344 void paintMaskForTextFillBox(ImageBuffer*, const IntRect&, InlineFlowBox*, const LayoutRect&, RenderNamedFlowFragment*); 344 345 }; 345 346 -
trunk/Source/WebCore/rendering/RenderInline.h
r162795 r164482 31 31 32 32 class Position; 33 class RenderRegion; 33 34 34 35 class RenderInline : public RenderBoxModelObject { -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r164481 r164482 3529 3529 } 3530 3530 3531 void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* subtreePaintRoot, Render Region* region, PaintLayerFlags paintFlags)3531 void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* subtreePaintRoot, RenderNamedFlowFragment* namedFlowFragment, PaintLayerFlags paintFlags) 3532 3532 { 3533 3533 OverlapTestRequestMap overlapTestRequests; 3534 3534 3535 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, LayoutSize(), subtreePaintRoot, region, &overlapTestRequests);3535 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, LayoutSize(), subtreePaintRoot, namedFlowFragment, &overlapTestRequests); 3536 3536 paintLayer(context, paintingInfo, paintFlags); 3537 3537 … … 3678 3678 // FIXME: Hack to disable region information for in flow threads. Implement this logic in a different way. 3679 3679 LayerPaintingInfo& info = const_cast<LayerPaintingInfo&>(paintingInfo); 3680 Render Region* region = info.region;3681 if ( region) {3680 RenderNamedFlowFragment* namedFlowFragment = info.renderNamedFlowFragment; 3681 if (namedFlowFragment) { 3682 3682 if (enclosingPaginationLayer()) 3683 info.re gion = 0;3683 info.renderNamedFlowFragment = nullptr; 3684 3684 else { 3685 RenderFlowThread* flowThread = region->flowThread();3685 RenderFlowThread* flowThread = namedFlowFragment->flowThread(); 3686 3686 ASSERT(flowThread); 3687 3687 3688 if (!flowThread->objectShouldPaintInFlowRegion(&renderer(), region))3688 if (!flowThread->objectShouldPaintInFlowRegion(&renderer(), namedFlowFragment)) 3689 3689 return; 3690 3690 } … … 3699 3699 // If the transform can't be inverted, then don't paint anything. 3700 3700 if (!layerTransform.isInvertible()) { 3701 info.re gion = region;3701 info.renderNamedFlowFragment = namedFlowFragment; 3702 3702 return; 3703 3703 } … … 3714 3714 if (enclosingPaginationLayer()) { 3715 3715 paintTransformedLayerIntoFragments(context, paintingInfo, paintFlags); 3716 info.re gion = region;3716 info.renderNamedFlowFragment = namedFlowFragment; 3717 3717 return; 3718 3718 } … … 3721 3721 ClipRect clipRect = paintingInfo.paintDirtyRect; 3722 3722 if (parent()) { 3723 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, paintingInfo.re gion, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects,3723 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, paintingInfo.renderNamedFlowFragment, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, 3724 3724 IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip); 3725 3725 clipRect = backgroundClipRect(clipRectsContext); … … 3736 3736 parent()->restoreClip(context, paintingInfo.paintDirtyRect, clipRect); 3737 3737 3738 info.re gion = region;3738 info.renderNamedFlowFragment = namedFlowFragment; 3739 3739 return; 3740 3740 } 3741 3741 3742 3742 paintLayerContentsAndReflection(context, paintingInfo, paintFlags); 3743 info.re gion = region;3743 info.renderNamedFlowFragment = namedFlowFragment; 3744 3744 } 3745 3745 … … 4057 4057 paintDirtyRect = selfClipRect(); 4058 4058 } 4059 collectFragments(layerFragments, localPaintingInfo.rootLayer, localPaintingInfo.re gion, paintDirtyRect,4059 collectFragments(layerFragments, localPaintingInfo.rootLayer, localPaintingInfo.renderNamedFlowFragment, paintDirtyRect, 4060 4060 (localPaintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize, 4061 4061 (isPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, &offsetFromRoot); … … 4149 4149 // Now do a paint with the root layer shifted to be us. 4150 4150 LayerPaintingInfo transformedPaintingInfo(this, enclosingIntRect(transform.inverse().mapRect(paintingInfo.paintDirtyRect)), paintingInfo.paintBehavior, 4151 adjustedSubPixelAccumulation, paintingInfo.subtreePaintRoot, paintingInfo.re gion, paintingInfo.overlapTestRequests);4151 adjustedSubPixelAccumulation, paintingInfo.subtreePaintRoot, paintingInfo.renderNamedFlowFragment, paintingInfo.overlapTestRequests); 4152 4152 paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags); 4153 4153 } … … 4258 4258 if (this != localPaintingInfo.rootLayer || !(localPaintFlags & PaintLayerPaintingOverflowContents)) { 4259 4259 LayoutPoint newOffsetFromRoot = *offsetFromRoot + fragment.paginationOffset; 4260 fragment.shouldPaintContent &= intersectsDamageRect(fragment.layerBounds, fragment.backgroundRect.rect(), localPaintingInfo.rootLayer, &newOffsetFromRoot, localPaintingInfo.re gion);4260 fragment.shouldPaintContent &= intersectsDamageRect(fragment.layerBounds, fragment.backgroundRect.rect(), localPaintingInfo.rootLayer, &newOffsetFromRoot, localPaintingInfo.renderNamedFlowFragment); 4261 4261 } 4262 4262 } … … 4268 4268 LayoutPoint offsetOfPaginationLayerFromRoot; 4269 4269 LayoutRect transformedExtent = transparencyClipBox(this, enclosingPaginationLayer(), PaintingTransparencyClipBox, RootOfTransparencyClipBox, paintingInfo.paintBehavior); 4270 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, paintingInfo.rootLayer, paintingInfo.re gion, paintingInfo.paintDirtyRect,4270 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, paintingInfo.rootLayer, paintingInfo.renderNamedFlowFragment, paintingInfo.paintDirtyRect, 4271 4271 (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize, 4272 4272 (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, &offsetOfPaginationLayerFromRoot, &transformedExtent); … … 4283 4283 enclosingPaginationLayer()->convertToLayerCoords(paintingInfo.rootLayer, offsetOfPaginationLayerFromRoot); 4284 4284 4285 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), paintingInfo.re gion, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects,4285 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), paintingInfo.renderNamedFlowFragment, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, 4286 4286 IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip); 4287 4287 LayoutRect parentClipRect = backgroundClipRect(clipRectsContext).rect(); … … 4317 4317 // Paint the background. 4318 4318 // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info. 4319 PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhaseBlockBackground, paintBehavior, subtreePaintRootForRenderer, localPaintingInfo.re gion, 0, 0, &localPaintingInfo.rootLayer->renderer());4319 PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhaseBlockBackground, paintBehavior, subtreePaintRootForRenderer, localPaintingInfo.renderNamedFlowFragment, 0, 0, &localPaintingInfo.rootLayer->renderer()); 4320 4320 renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation)); 4321 4321 … … 4390 4390 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, fragment.foregroundRect); 4391 4391 4392 PaintInfo paintInfo(context, fragment.foregroundRect.rect(), phase, paintBehavior, subtreePaintRootForRenderer, localPaintingInfo.re gion, 0, 0, &localPaintingInfo.rootLayer->renderer());4392 PaintInfo paintInfo(context, fragment.foregroundRect.rect(), phase, paintBehavior, subtreePaintRootForRenderer, localPaintingInfo.renderNamedFlowFragment, 0, 0, &localPaintingInfo.rootLayer->renderer()); 4393 4393 if (phase == PaintPhaseForeground) 4394 4394 paintInfo.overlapTestRequests = localPaintingInfo.overlapTestRequests; … … 4409 4409 4410 4410 // Paint our own outline 4411 PaintInfo paintInfo(context, fragment.outlineRect.rect(), PaintPhaseSelfOutline, paintBehavior, subtreePaintRootForRenderer, localPaintingInfo.re gion, 0, 0, &localPaintingInfo.rootLayer->renderer());4411 PaintInfo paintInfo(context, fragment.outlineRect.rect(), PaintPhaseSelfOutline, paintBehavior, subtreePaintRootForRenderer, localPaintingInfo.renderNamedFlowFragment, 0, 0, &localPaintingInfo.rootLayer->renderer()); 4412 4412 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, fragment.outlineRect, DoNotIncludeSelfForBorderRadius); 4413 4413 renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation)); … … 4429 4429 // Paint the mask. 4430 4430 // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info. 4431 PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhaseMask, PaintBehaviorNormal, subtreePaintRootForRenderer, localPaintingInfo.re gion, 0, 0, &localPaintingInfo.rootLayer->renderer());4431 PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhaseMask, PaintBehaviorNormal, subtreePaintRootForRenderer, localPaintingInfo.renderNamedFlowFragment, 0, 0, &localPaintingInfo.rootLayer->renderer()); 4432 4432 renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation)); 4433 4433 … … 5246 5246 } 5247 5247 5248 void RenderLayer::mapLayerClipRectsToFragmentationLayer(RenderRegion* region, ClipRects& clipRects) const 5249 { 5250 ASSERT(region && region->isRenderNamedFlowFragment() && region->parent() && region->parent()->isRenderNamedFlowFragmentContainer()); 5251 5252 RenderNamedFlowFragment* flowFragment = toRenderNamedFlowFragment(region); 5253 5254 ClipRectsContext targetClipRectsContext(&flowFragment->fragmentContainerLayer(), 0, TemporaryClipRects); 5255 flowFragment->fragmentContainerLayer().calculateClipRects(targetClipRectsContext, clipRects); 5256 5257 LayoutRect flowThreadPortionRect = region->flowThreadPortionRect(); 5248 void RenderLayer::mapLayerClipRectsToFragmentationLayer(RenderNamedFlowFragment* namedFlowFragment, ClipRects& clipRects) const 5249 { 5250 ASSERT(namedFlowFragment && namedFlowFragment->parent() && namedFlowFragment->parent()->isRenderNamedFlowFragmentContainer()); 5251 5252 ClipRectsContext targetClipRectsContext(&namedFlowFragment->fragmentContainerLayer(), 0, TemporaryClipRects); 5253 namedFlowFragment->fragmentContainerLayer().calculateClipRects(targetClipRectsContext, clipRects); 5254 5255 LayoutRect flowThreadPortionRect = namedFlowFragment->flowThreadPortionRect(); 5258 5256 5259 5257 LayoutPoint portionLocation = flowThreadPortionRect.location(); 5260 LayoutRect regionContentBox = flowFragment->fragmentContainer().contentBoxRect();5258 LayoutRect regionContentBox = namedFlowFragment->fragmentContainer().contentBoxRect(); 5261 5259 LayoutSize moveOffset = portionLocation - regionContentBox.location(); 5262 5260 … … 5285 5283 bool useCached = clipRectsType != TemporaryClipRects; 5286 5284 5287 if (renderer().isRender FlowThread() && clipRectsContext.region) {5288 mapLayerClipRectsToFragmentationLayer( clipRectsContext.region, clipRects);5285 if (renderer().isRenderNamedFlowThread() && clipRectsContext.region) { 5286 mapLayerClipRectsToFragmentationLayer(toRenderNamedFlowFragment(clipRectsContext.region), clipRects); 5289 5287 return; 5290 5288 } … … 5353 5351 { 5354 5352 ASSERT(parent()); 5355 if (renderer().isRender FlowThread() && clipRectsContext.region) {5356 mapLayerClipRectsToFragmentationLayer( clipRectsContext.region, clipRects);5353 if (renderer().isRenderNamedFlowThread() && clipRectsContext.region) { 5354 mapLayerClipRectsToFragmentationLayer(toRenderNamedFlowFragment(clipRectsContext.region), clipRects); 5357 5355 return; 5358 5356 } -
trunk/Source/WebCore/rendering/RenderLayer.h
r164481 r164482 651 651 // layers that intersect the point from front to back. 652 652 void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = PaintBehaviorNormal, RenderObject* subtreePaintRoot = 0, 653 Render Region* = 0, PaintLayerFlags = 0);653 RenderNamedFlowFragment* = 0, PaintLayerFlags = 0); 654 654 bool hitTest(const HitTestRequest&, HitTestResult&); 655 655 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); … … 926 926 927 927 struct LayerPaintingInfo { 928 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, RenderObject* inSubtreePaintRoot = 0, Render Region*inRegion= 0, OverlapTestRequestMap* inOverlapTestRequests = 0)928 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, RenderObject* inSubtreePaintRoot = 0, RenderNamedFlowFragment* namedFlowFragment = 0, OverlapTestRequestMap* inOverlapTestRequests = 0) 929 929 : rootLayer(inRootLayer) 930 930 , subtreePaintRoot(inSubtreePaintRoot) 931 931 , paintDirtyRect(inDirtyRect) 932 932 , subPixelAccumulation(inSubPixelAccumulation) 933 , re gion(inRegion)933 , renderNamedFlowFragment(namedFlowFragment) 934 934 , overlapTestRequests(inOverlapTestRequests) 935 935 , paintBehavior(inPaintBehavior) … … 940 940 LayoutRect paintDirtyRect; // relative to rootLayer; 941 941 LayoutSize subPixelAccumulation; 942 Render Region* region; // May be null.942 RenderNamedFlowFragment* renderNamedFlowFragment; // May be null. 943 943 OverlapTestRequestMap* overlapTestRequests; // May be null. 944 944 PaintBehavior paintBehavior; … … 1156 1156 const HitTestingTransformState*, double*); 1157 1157 void paintFlowThreadIfRegionForFragments(const LayerFragments&, GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags); 1158 void mapLayerClipRectsToFragmentationLayer(Render Region*, ClipRects&) const;1158 void mapLayerClipRectsToFragmentationLayer(RenderNamedFlowFragment*, ClipRects&) const; 1159 1159 1160 1160 private: -
trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp
r164275 r164482 92 92 } 93 93 94 void RenderNamedFlowFragment::getRanges(Vector<RefPtr<Range>>& rangeObjects) const 95 { 96 const RenderNamedFlowThread& namedFlow = view().flowThreadController().ensureRenderFlowThreadWithName(style().regionThread()); 97 namedFlow.getRanges(rangeObjects, this); 98 } 99 94 100 bool RenderNamedFlowFragment::shouldHaveAutoLogicalHeight() const 95 101 { -
trunk/Source/WebCore/rendering/RenderNamedFlowFragment.h
r164275 r164482 57 57 virtual bool isRenderNamedFlowFragment() const override final { return true; } 58 58 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override; 59 60 void getRanges(Vector<RefPtr<Range>>&) const; 59 61 60 62 virtual LayoutUnit pageLogicalHeight() const; -
trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp
r163969 r164482 37 37 #include "RenderInline.h" 38 38 #include "RenderNamedFlowFragment.h" 39 #include "RenderRegion.h"40 39 #include "RenderText.h" 41 40 #include "RenderView.h" … … 86 85 void RenderNamedFlowThread::updateWritingMode() 87 86 { 88 Render Region* firstRegion = m_regionList.first();89 if (!first Region)87 RenderNamedFlowFragment* firstFragment = toRenderNamedFlowFragment(m_regionList.first()); 88 if (!firstFragment) 90 89 return; 91 if (style().writingMode() == first Region->style().writingMode())90 if (style().writingMode() == firstFragment->style().writingMode()) 92 91 return; 93 92 94 93 // The first region defines the principal writing mode for the entire flow. 95 94 auto newStyle = RenderStyle::clone(&style()); 96 newStyle.get().setWritingMode(first Region->style().writingMode());95 newStyle.get().setWritingMode(firstFragment->style().writingMode()); 97 96 setStyle(std::move(newStyle)); 98 97 } … … 150 149 // the first region is "less" than the second region. 151 150 // If the first region is "less" than the second region, the first region receives content before second region. 152 static bool compareRender Regions(const RenderRegion* firstRegion, const RenderRegion* secondRegion)153 { 154 ASSERT(first Region);155 ASSERT(second Region);156 157 ASSERT(first Region->generatingElement());158 ASSERT(second Region->generatingElement());151 static bool compareRenderNamedFlowFragments(const RenderNamedFlowFragment* firstFragment, const RenderNamedFlowFragment* secondFragment) 152 { 153 ASSERT(firstFragment); 154 ASSERT(secondFragment); 155 156 ASSERT(firstFragment->generatingElement()); 157 ASSERT(secondFragment->generatingElement()); 159 158 160 159 // If the regions belong to different nodes, compare their position in the DOM. 161 if (first Region->generatingElement() != secondRegion->generatingElement()) {162 unsigned short position = first Region->generatingElement()->compareDocumentPosition(secondRegion->generatingElement());160 if (firstFragment->generatingElement() != secondFragment->generatingElement()) { 161 unsigned short position = firstFragment->generatingElement()->compareDocumentPosition(secondFragment->generatingElement()); 163 162 164 163 // If the second region is contained in the first one, the first region is "less" if it's :before. 165 164 if (position & Node::DOCUMENT_POSITION_CONTAINED_BY) { 166 ASSERT(second Region->style().styleType() == NOPSEUDO);167 return first Region->style().styleType() == BEFORE;165 ASSERT(secondFragment->style().styleType() == NOPSEUDO); 166 return firstFragment->style().styleType() == BEFORE; 168 167 } 169 168 170 169 // If the second region contains the first region, the first region is "less" if the second is :after. 171 170 if (position & Node::DOCUMENT_POSITION_CONTAINS) { 172 ASSERT(first Region->style().styleType() == NOPSEUDO);173 return second Region->style().styleType() == AFTER;171 ASSERT(firstFragment->style().styleType() == NOPSEUDO); 172 return secondFragment->style().styleType() == AFTER; 174 173 } 175 174 … … 178 177 179 178 // FIXME: Currently it's not possible for an element to be both a region and have pseudo-children. The case is covered anyway. 180 switch (first Region->style().styleType()) {179 switch (firstFragment->style().styleType()) { 181 180 case BEFORE: 182 181 // The second region can be the node or the after pseudo-element (before is smaller than any of those). … … 187 186 case NOPSEUDO: 188 187 // The second region can either be the before or the after pseudo-element (the node is only smaller than the after pseudo-element). 189 return first Region->style().styleType() == AFTER;188 return firstFragment->style().styleType() == AFTER; 190 189 default: 191 190 break; … … 197 196 198 197 // This helper function adds a region to a list preserving the order property of the list. 199 static void add RegionToList(RenderRegionList& regionList, RenderRegion* renderRegion)198 static void addFragmentToList(RenderRegionList& regionList, RenderNamedFlowFragment* renderNamedFlowFragment) 200 199 { 201 200 if (regionList.isEmpty()) 202 regionList.add(render Region);201 regionList.add(renderNamedFlowFragment); 203 202 else { 204 // Find the first region "greater" than render Region.203 // Find the first region "greater" than renderNamedFlowFragment. 205 204 auto it = regionList.begin(); 206 while (it != regionList.end() && !compareRender Regions(renderRegion, *it))205 while (it != regionList.end() && !compareRenderNamedFlowFragments(renderNamedFlowFragment, toRenderNamedFlowFragment(*it))) 207 206 ++it; 208 regionList.insertBefore(it, renderRegion); 209 } 210 } 211 212 void RenderNamedFlowThread::addRegionToNamedFlowThread(RenderRegion* renderRegion) 207 regionList.insertBefore(it, renderNamedFlowFragment); 208 } 209 } 210 211 void RenderNamedFlowThread::addFragmentToNamedFlowThread(RenderNamedFlowFragment* renderNamedFlowFragment) 212 { 213 ASSERT(renderNamedFlowFragment); 214 ASSERT(!renderNamedFlowFragment->isValid()); 215 216 if (renderNamedFlowFragment->parentNamedFlowThread()) 217 addDependencyOnFlowThread(renderNamedFlowFragment->parentNamedFlowThread()); 218 219 renderNamedFlowFragment->setIsValid(true); 220 addFragmentToList(m_regionList, renderNamedFlowFragment); 221 222 if (m_regionList.first() == renderNamedFlowFragment) 223 updateWritingMode(); 224 } 225 226 void RenderNamedFlowThread::addRegionToThread(RenderRegion* renderRegion) 213 227 { 214 228 ASSERT(renderRegion); 215 229 ASSERT(!renderRegion->isValid()); 216 230 217 if (renderRegion->parentNamedFlowThread()) 218 addDependencyOnFlowThread(renderRegion->parentNamedFlowThread()); 219 220 renderRegion->setIsValid(true); 221 addRegionToList(m_regionList, renderRegion); 222 223 if (m_regionList.first() == renderRegion) 224 updateWritingMode(); 225 } 226 227 void RenderNamedFlowThread::addRegionToThread(RenderRegion* renderRegion) 231 RenderNamedFlowFragment* renderNamedFlowFragment = toRenderNamedFlowFragment(renderRegion); 232 resetMarkForDestruction(); 233 234 if (renderNamedFlowFragment->parentNamedFlowThread() && renderNamedFlowFragment->parentNamedFlowThread()->dependsOn(this)) { 235 // The order of invalid regions is irrelevant. 236 m_invalidRegionList.add(renderNamedFlowFragment); 237 // Register ourself to get a notification when the state changes. 238 renderNamedFlowFragment->parentNamedFlowThread()->m_observerThreadsSet.add(this); 239 return; 240 } 241 242 addFragmentToNamedFlowThread(renderNamedFlowFragment); 243 244 invalidateRegions(); 245 } 246 247 void RenderNamedFlowThread::removeRegionFromThread(RenderRegion* renderRegion) 228 248 { 229 249 ASSERT(renderRegion); 230 ASSERT(!renderRegion->isValid()); 231 232 resetMarkForDestruction(); 233 234 if (renderRegion->parentNamedFlowThread() && renderRegion->parentNamedFlowThread()->dependsOn(this)) { 235 // The order of invalid regions is irrelevant. 236 m_invalidRegionList.add(renderRegion); 237 // Register ourself to get a notification when the state changes. 238 renderRegion->parentNamedFlowThread()->m_observerThreadsSet.add(this); 239 return; 240 } 241 242 addRegionToNamedFlowThread(renderRegion); 243 244 invalidateRegions(); 245 } 246 247 void RenderNamedFlowThread::removeRegionFromThread(RenderRegion* renderRegion) 248 { 249 ASSERT(renderRegion); 250 251 if (renderRegion->parentNamedFlowThread()) { 252 if (!renderRegion->isValid()) { 253 ASSERT(m_invalidRegionList.contains(renderRegion)); 254 m_invalidRegionList.remove(renderRegion); 255 renderRegion->parentNamedFlowThread()->m_observerThreadsSet.remove(this); 250 251 RenderNamedFlowFragment* renderNamedFlowFragment = toRenderNamedFlowFragment(renderRegion); 252 if (renderNamedFlowFragment->parentNamedFlowThread()) { 253 if (!renderNamedFlowFragment->isValid()) { 254 ASSERT(m_invalidRegionList.contains(renderNamedFlowFragment)); 255 m_invalidRegionList.remove(renderNamedFlowFragment); 256 renderNamedFlowFragment->parentNamedFlowThread()->m_observerThreadsSet.remove(this); 256 257 // No need to invalidate the regions rectangles. The removed region 257 258 // was not taken into account. Just return here. 258 259 return; 259 260 } 260 removeDependencyOnFlowThread(render Region->parentNamedFlowThread());261 } 262 263 ASSERT(m_regionList.contains(render Region));264 bool wasFirst = m_regionList.first() == render Region;265 m_regionList.remove(render Region);261 removeDependencyOnFlowThread(renderNamedFlowFragment->parentNamedFlowThread()); 262 } 263 264 ASSERT(m_regionList.contains(renderNamedFlowFragment)); 265 bool wasFirst = m_regionList.first() == renderNamedFlowFragment; 266 m_regionList.remove(renderNamedFlowFragment); 266 267 267 268 if (canBeDestroyed()) … … 296 297 height = isHorizontalWritingMode() ? visualOverflowRect().maxY() : visualOverflowRect().maxX(); 297 298 298 Render Region* lastReg = lastRegion();299 for (auto& region: m_regionList) {300 LayoutUnit flowMin = height - (isHorizontalWritingMode() ? region->flowThreadPortionRect().y() : region->flowThreadPortionRect().x());301 LayoutUnit flowMax = height - (isHorizontalWritingMode() ? region->flowThreadPortionRect().maxY() : region->flowThreadPortionRect().maxX());302 RegionOversetState previousState = region->regionOversetState();299 RenderNamedFlowFragment* lastFragment = toRenderNamedFlowFragment(lastRegion()); 300 for (auto& namedFlowFragment : m_regionList) { 301 LayoutUnit flowMin = height - (isHorizontalWritingMode() ? namedFlowFragment->flowThreadPortionRect().y() : namedFlowFragment->flowThreadPortionRect().x()); 302 LayoutUnit flowMax = height - (isHorizontalWritingMode() ? namedFlowFragment->flowThreadPortionRect().maxY() : namedFlowFragment->flowThreadPortionRect().maxX()); 303 RegionOversetState previousState = namedFlowFragment->regionOversetState(); 303 304 RegionOversetState state = RegionFit; 304 305 if (flowMin <= 0) 305 306 state = RegionEmpty; 306 if (flowMax > 0 && region == lastReg)307 if (flowMax > 0 && namedFlowFragment == lastFragment) 307 308 state = RegionOverset; 308 region->setRegionOversetState(state);309 namedFlowFragment->setRegionOversetState(state); 309 310 // determine whether the NamedFlow object should dispatch a regionLayoutUpdate event 310 311 // FIXME: currently it cannot determine whether a region whose regionOverset state remained either "fit" or "overset" has actually … … 327 328 // With the regions overflow state computed we can also set the overset flag for the named flow. 328 329 // If there are no valid regions in the chain, overset is true. 329 m_overset = last Reg ? lastReg->regionOversetState() == RegionOverset : true;330 m_overset = lastFragment ? lastFragment->regionOversetState() == RegionOverset : true; 330 331 } 331 332 332 333 void RenderNamedFlowThread::checkInvalidRegions() 333 334 { 334 Vector<Render Region*> newValidRegions;335 Vector<RenderNamedFlowFragment*> newValidFragments; 335 336 for (auto& region : m_invalidRegionList) { 337 RenderNamedFlowFragment* namedFlowFragment = toRenderNamedFlowFragment(region); 336 338 // The only reason a region would be invalid is because it has a parent flow thread. 337 ASSERT(! region->isValid() && region->parentNamedFlowThread());338 if ( region->parentNamedFlowThread()->dependsOn(this))339 ASSERT(!namedFlowFragment->isValid() && namedFlowFragment->parentNamedFlowThread()); 340 if (namedFlowFragment->parentNamedFlowThread()->dependsOn(this)) 339 341 continue; 340 342 341 newValid Regions.append(region);342 } 343 344 for (auto& region : newValidRegions) {345 m_invalidRegionList.remove( region);346 region->parentNamedFlowThread()->m_observerThreadsSet.remove(this);347 add RegionToNamedFlowThread(region);348 } 349 350 if (!newValid Regions.isEmpty())343 newValidFragments.append(namedFlowFragment); 344 } 345 346 for (auto& namedFlowFragment : newValidFragments) { 347 m_invalidRegionList.remove(namedFlowFragment); 348 namedFlowFragment->parentNamedFlowThread()->m_observerThreadsSet.remove(this); 349 addFragmentToNamedFlowThread(namedFlowFragment); 350 } 351 352 if (!newValidFragments.isEmpty()) 351 353 invalidateRegions(); 352 354 … … 539 541 } 540 542 541 void RenderNamedFlowThread::getRanges(Vector<RefPtr<Range>>& rangeObjects, const Render Region* region) const543 void RenderNamedFlowThread::getRanges(Vector<RefPtr<Range>>& rangeObjects, const RenderNamedFlowFragment* namedFlowFragment) const 542 544 { 543 545 LayoutUnit logicalTopForRegion; … … 545 547 546 548 // extend the first region top to contain everything up to its logical height 547 if ( region->isFirstRegion())549 if (namedFlowFragment->isFirstRegion()) 548 550 logicalTopForRegion = LayoutUnit::min(); 549 551 else 550 logicalTopForRegion = region->logicalTopForFlowThreadContent();552 logicalTopForRegion = namedFlowFragment->logicalTopForFlowThreadContent(); 551 553 552 554 // extend the last region to contain everything above its y() 553 if ( region->isLastRegion())555 if (namedFlowFragment->isLastRegion()) 554 556 logicalBottomForRegion = LayoutUnit::max(); 555 557 else 556 logicalBottomForRegion = region->logicalBottomForFlowThreadContent();558 logicalBottomForRegion = namedFlowFragment->logicalBottomForFlowThreadContent(); 557 559 558 560 Vector<Element*> elements; … … 596 598 boundingBox.moveBy(logicalOffsetFromTop); 597 599 598 LayoutUnit logicalTopForRenderer = region->logicalTopOfFlowThreadContentRect(boundingBox);599 LayoutUnit logicalBottomForRenderer = region->logicalBottomOfFlowThreadContentRect(boundingBox);600 LayoutUnit logicalTopForRenderer = namedFlowFragment->logicalTopOfFlowThreadContentRect(boundingBox); 601 LayoutUnit logicalBottomForRenderer = namedFlowFragment->logicalBottomOfFlowThreadContentRect(boundingBox); 600 602 601 603 // if the bounding box of the current element doesn't intersect the region box … … 700 702 bool hasRegionsWithStyling = false; 701 703 for (const auto& region : m_regionList) { 702 const RenderNamedFlowFragment* namedFlowFragment = toRenderNamedFlowFragment(region); 703 if (namedFlowFragment->hasCustomRegionStyle()) { 704 if (toRenderNamedFlowFragment(region)->hasCustomRegionStyle()) { 704 705 hasRegionsWithStyling = true; 705 706 break; … … 714 715 // FIXME: Region styling is not computed only for the region range of the object so this is why we need to walk the whole chain. 715 716 for (auto& region : m_regionList) { 716 RenderNamedFlowFragment* namedFlowFragment = toRenderNamedFlowFragment(region); 717 namedFlowFragment->clearObjectStyleInRegion(object); 717 toRenderNamedFlowFragment(region)->clearObjectStyleInRegion(object); 718 718 } 719 719 } -
trunk/Source/WebCore/rendering/RenderNamedFlowThread.h
r163969 r164482 78 78 79 79 bool isMarkedForDestruction() const; 80 void getRanges(Vector<RefPtr<Range>>&, const Render Region*) const;80 void getRanges(Vector<RefPtr<Range>>&, const RenderNamedFlowFragment*) const; 81 81 82 82 virtual bool collectsGraphicsLayersUnderRegions() const override; … … 106 106 void removeDependencyOnFlowThread(RenderNamedFlowThread*); 107 107 108 void add RegionToNamedFlowThread(RenderRegion*);108 void addFragmentToNamedFlowThread(RenderNamedFlowFragment*); 109 109 110 110 void checkInvalidRegions(); -
trunk/Source/WebCore/rendering/RenderRegion.cpp
r164419 r164482 447 447 } 448 448 449 void RenderRegion::getRanges(Vector<RefPtr<Range>>& rangeObjects) const450 {451 const RenderNamedFlowThread& namedFlow = view().flowThreadController().ensureRenderFlowThreadWithName(style().regionThread());452 namedFlow.getRanges(rangeObjects, this);453 }454 455 449 void RenderRegion::adjustRegionBoundsFromFlowThreadPortionRect(const LayoutPoint& layerOffset, LayoutRect& regionBounds) 456 450 { -
trunk/Source/WebCore/rendering/RenderRegion.h
r164419 r164482 94 94 LayoutUnit logicalBottomForFlowThreadContent() const { return logicalBottomOfFlowThreadContentRect(flowThreadPortionRect()); }; 95 95 96 void getRanges(Vector<RefPtr<Range>>&) const;97 98 96 // This method represents the logical height of the entire flow thread portion used by the region or set. 99 97 // For RenderRegions it matches logicalPaginationHeight(), but for sets it is the height of all the pages -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r164265 r164482 34 34 #include "RenderImage.h" 35 35 #include "RenderLayer.h" 36 #include "Render Region.h"36 #include "RenderNamedFlowFragment.h" 37 37 #include "RenderTheme.h" 38 38 #include "RenderView.h" … … 206 206 207 207 // Check our region range to make sure we need to be painting in this region. 208 if (paintInfo.render Region && !paintInfo.renderRegion->flowThread()->objectShouldPaintInFlowRegion(this, paintInfo.renderRegion))208 if (paintInfo.renderNamedFlowFragment && !paintInfo.renderNamedFlowFragment->flowThread()->objectShouldPaintInFlowRegion(this, paintInfo.renderNamedFlowFragment)) 209 209 return false; 210 210 -
trunk/Source/WebCore/rendering/RenderReplica.cpp
r158097 r164482 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.render Region);77 RenderLayer::LayerPaintingInfo paintingInfo(rootPaintingLayer, paintInfo.rect, PaintBehaviorNormal, LayoutSize(), 0, paintInfo.renderNamedFlowFragment); 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/RootInlineBox.cpp
r163717 r164482 172 172 { 173 173 // Check if we are in the correct region. 174 if (paintInfo.render Region && m_hasContainingRegion && containingRegion() != paintInfo.renderRegion)174 if (paintInfo.renderNamedFlowFragment && m_hasContainingRegion && containingRegion() != reinterpret_cast<RenderRegion*>(paintInfo.renderNamedFlowFragment)) 175 175 return; 176 176 -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r164441 r164482 33 33 #include "Page.h" 34 34 #include "RenderIterator.h" 35 #include "RenderNamedFlowFragment.h" 35 36 #include "RenderView.h" 36 37 #include "SVGImage.h" … … 268 269 269 270 // Apply initial viewport clip - not affected by overflow handling 270 childPaintInfo.context->clip(pixelSnappedIntRect(overflowClipRect(paintOffset, paintInfo.render Region)));271 childPaintInfo.context->clip(pixelSnappedIntRect(overflowClipRect(paintOffset, paintInfo.renderNamedFlowFragment))); 271 272 272 273 // Convert from container offsets (html renderers) to a relative transform (svg renderers).
Note: See TracChangeset
for help on using the changeset viewer.