Source/WebCore/ChangeLog

 12014-02-17 Radu Stavila <stavila@adobe.com>
 2
 3 [CSS Regions] Move specific named flow methods from RenderRegion to RenderNamedFlowFragment
 4 https://bugs.webkit.org/show_bug.cgi?id=128914
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Moved named flow specific methods regionContainer() and regionContainerLayer() from
 9 RenderRegion to RenderNamedFlowFragment and renamed them to fragmentContainer and
 10 fragmentContainerLayer.
 11
 12 No new tests required.
 13
 14 * rendering/RenderLayer.cpp:
 15 (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
 16 (WebCore::RenderLayer::calculateClipRects):
 17 * rendering/RenderNamedFlowFragment.cpp:
 18 (WebCore::RenderNamedFlowFragment::fragmentContainer):
 19 (WebCore::RenderNamedFlowFragment::fragmentContainerLayer):
 20 * rendering/RenderNamedFlowFragment.h:
 21 * rendering/RenderRegion.cpp:
 22 * rendering/RenderRegion.h:
 23
1242014-02-17 Manuel Rego Casasnovas <rego@igalia.com>
225
326 [CSS Grid Layout] Fix missing layout in flexible and content sized columns

Source/WebCore/rendering/RenderLayer.cpp

@@void RenderLayer::updateClipRects(const ClipRectsContext& clipRectsContext)
52525252
52535253void RenderLayer::mapLayerClipRectsToFragmentationLayer(RenderRegion* region, ClipRects& clipRects) const
52545254{
5255  ASSERT(region && region->parent() && region->parent()->isRenderNamedFlowFragmentContainer());
 5255 ASSERT(region && region->isRenderNamedFlowFragment() && region->parent() && region->parent()->isRenderNamedFlowFragmentContainer());
 5256
 5257 RenderNamedFlowFragment* flowFragment = toRenderNamedFlowFragment(region);
52565258
5257  ClipRectsContext targetClipRectsContext(region->regionContainerLayer(), 0, TemporaryClipRects);
5258  region->regionContainerLayer()->calculateClipRects(targetClipRectsContext, clipRects);
 5259 ClipRectsContext targetClipRectsContext(flowFragment->fragmentContainerLayer(), 0, TemporaryClipRects);
 5260 flowFragment->fragmentContainerLayer()->calculateClipRects(targetClipRectsContext, clipRects);
52595261
52605262 LayoutRect flowThreadPortionRect = region->flowThreadPortionRect();
52615263
52625264 LayoutPoint portionLocation = flowThreadPortionRect.location();
5263  LayoutRect regionContentBox = region->regionContainer()->contentBoxRect();
 5265 LayoutRect regionContentBox = flowFragment->fragmentContainer()->contentBoxRect();
52645266 LayoutSize moveOffset = portionLocation - regionContentBox.location();
52655267
52665268 ClipRect newOverflowClipRect = clipRects.overflowClipRect();

@@void RenderLayer::calculateRects(const ClipRectsContext& clipRectsContext, const
54565458 outlineRect = backgroundRect;
54575459
54585460 // If the region does not clip its overflow, inflate the outline rect.
5459  if (!(clipRectsContext.region->parent()->hasOverflowClip() && (clipRectsContext.region->regionContainerLayer() != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip)))
5460  outlineRect.inflate(renderer().maximalOutlineSize(PaintPhaseOutline));
 5461 if (clipRectsContext.region->isRenderNamedFlowFragment()) {
 5462 if (!(clipRectsContext.region->parent()->hasOverflowClip() && (toRenderNamedFlowFragment(clipRectsContext.region)->fragmentContainerLayer() != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip)))
 5463 outlineRect.inflate(renderer().maximalOutlineSize(PaintPhaseOutline));
 5464 }
54615465 }
54625466
54635467 // Update the clip rects that will be passed to child layers.

Source/WebCore/rendering/RenderNamedFlowFragment.cpp

@@LayoutUnit RenderNamedFlowFragment::maxPageLogicalHeight() const
188188 return styleToUse.logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : toRenderBlock(parent())->computeReplacedLogicalHeightUsing(styleToUse.logicalMaxHeight());
189189}
190190
 191RenderBlockFlow* RenderNamedFlowFragment::fragmentContainer() const
 192{
 193 ASSERT(parent() && parent()->isRenderNamedFlowFragmentContainer());
 194 return toRenderBlockFlow(parent());
 195}
 196
 197RenderLayer* RenderNamedFlowFragment::fragmentContainerLayer() const
 198{
 199 return fragmentContainer()->layer();
 200}
 201
191202void RenderNamedFlowFragment::layoutBlock(bool relayoutChildren, LayoutUnit)
192203{
193204 StackStats::LayoutCheckPoint layoutCheckPoint;

Source/WebCore/rendering/RenderNamedFlowFragment.h

@@public:
6060 virtual LayoutUnit pageLogicalHeight() const;
6161 LayoutUnit maxPageLogicalHeight() const;
6262
 63 RenderBlockFlow* fragmentContainer() const;
 64 RenderLayer* fragmentContainerLayer() const;
 65
6366 bool isPseudoElementRegion() const { return parent() && parent()->isPseudoElement(); }
6467
6568 // When the content inside the region requires the region to have a layer, the layer will be created on the region's

Source/WebCore/rendering/RenderRegion.cpp

@@LayoutPoint RenderRegion::flowThreadPortionLocation() const
150150 return portionLocation;
151151}
152152
153 RenderBlockFlow* RenderRegion::regionContainer() const
154 {
155  ASSERT(parent() && parent()->isRenderNamedFlowFragmentContainer());
156  return toRenderBlockFlow(parent());
157 }
158 
159 RenderLayer* RenderRegion::regionContainerLayer() const
160 {
161  return regionContainer()->layer();
162 }
163 
164153LayoutRect RenderRegion::overflowRectForFlowThreadPortion(const LayoutRect& flowThreadPortionRect, bool isFirstPortion, bool isLastPortion, OverflowType overflowType)
165154{
166155 ASSERT(isValid());

Source/WebCore/rendering/RenderRegion.h

@@public:
5656 LayoutRect flowThreadPortionOverflowRect();
5757
5858 LayoutPoint flowThreadPortionLocation() const;
59 
60  RenderBlockFlow* regionContainer() const;
61  RenderLayer* regionContainerLayer() const;
6259
6360 virtual void attachRegion();
6461 virtual void detachRegion();