Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Unified Diff: sky/engine/core/rendering/RenderBlock.cpp

Issue 928393003: Remove the concept of document.documentElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/rendering/RenderBlock.h ('k') | sky/engine/core/rendering/RenderBlockFlow.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderBlock.cpp
diff --git a/sky/engine/core/rendering/RenderBlock.cpp b/sky/engine/core/rendering/RenderBlock.cpp
index 6510e9a3b411a37aa0272f261f4155693175b77a..d2a203a5ae72021cc5255fa6fc174cf744292d8e 100644
--- a/sky/engine/core/rendering/RenderBlock.cpp
+++ b/sky/engine/core/rendering/RenderBlock.cpp
@@ -320,11 +320,6 @@ void RenderBlock::addOverflowFromPositionedObjects()
}
}
-bool RenderBlock::createsBlockFormattingContext() const
-{
- return isInlineBlock() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItem() || isDocumentElement();
-}
-
void RenderBlock::updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox* child)
{
// FIXME: Technically percentage height objects only need a relayout if their percentage isn't going to be turned into
@@ -446,16 +441,10 @@ void RenderBlock::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, Ve
{
LayoutPoint adjustedPaintOffset = paintOffset + location();
- LayoutRect overflowBox;
- // Check if we need to do anything at all.
- // FIXME: Could eliminate the isDocumentElement() check if we fix background painting so that the RenderView
- // paints the root's background.
- if (!isDocumentElement()) {
- overflowBox = visualOverflowRect();
- overflowBox.moveBy(adjustedPaintOffset);
- if (!overflowBox.intersects(paintInfo.rect))
- return;
- }
+ LayoutRect overflowBox = visualOverflowRect();
+ overflowBox.moveBy(adjustedPaintOffset);
+ if (!overflowBox.intersects(paintInfo.rect))
+ return;
// There are some cases where not all clipped visual overflow is accounted for.
// FIXME: reduce the number of such cases.
@@ -531,7 +520,10 @@ bool RenderBlock::isSelectionRoot() const
{
ASSERT(node() || isAnonymous());
- if (isDocumentElement() || hasOverflowClip()
+ if (node() && node()->parentNode() == document())
+ return true;
+
+ if (hasOverflowClip()
|| isPositioned()
|| isInlineBlock()
|| hasTransform()
@@ -603,9 +595,6 @@ GapRects RenderBlock::selectionGaps(RenderBlock* rootBlock, const LayoutPoint& r
LayoutRect blockRect(offsetFromRootBlock.width(), offsetFromRootBlock.height(), width(), height());
blockRect.moveBy(rootBlockPhysicalPosition);
clipOutPositionedObjects(paintInfo, blockRect.location(), positionedObjects());
- if (isDocumentElement()) // The <body> must make sure to examine its containingBlock's positioned objects.
- for (RenderBlock* cb = containingBlock(); cb && !cb->isRenderView(); cb = cb->containingBlock())
- clipOutPositionedObjects(paintInfo, LayoutPoint(cb->x(), cb->y()), cb->positionedObjects());
}
// FIXME: overflow: auto/scroll regions need more math here, since painting in the border box is different from painting in the padding box (one is scrolled, the other is
« no previous file with comments | « sky/engine/core/rendering/RenderBlock.h ('k') | sky/engine/core/rendering/RenderBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698