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

Unified Diff: Source/core/rendering/RenderInline.cpp

Issue 767283005: Take continuation into consideration when calculating absoluteClippedOverflowRect. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address reviewers' comments Created 6 years 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
Index: Source/core/rendering/RenderInline.cpp
diff --git a/Source/core/rendering/RenderInline.cpp b/Source/core/rendering/RenderInline.cpp
index c58194d2ad32ddc5d13a81f8f7bb621b227e9832..cf914767ca8da3f9409bf69533a0319f45f59e01 100644
--- a/Source/core/rendering/RenderInline.cpp
+++ b/Source/core/rendering/RenderInline.cpp
@@ -1020,6 +1020,33 @@ LayoutRect RenderInline::linesVisualOverflowBoundingBox() const
return rect;
}
+LayoutRect RenderInline::absoluteClippedOverflowRect() const
+{
+ if (!continuation())
+ return clippedOverflowRectForPaintInvalidation(view());
+
+ FloatRect floatResult;
+ LinesBoundingBoxGeneratorContext context(floatResult);
+
+ RenderInline* endContinuation = inlineElementContinuation();
+ while (endContinuation->inlineElementContinuation())
+ endContinuation = endContinuation->inlineElementContinuation();
+
+ // Note the following algorithm is N^2 (if the continuation is N renderers and the averagae
+ // depth of those renderers is M, we'll visit N*M nodes). We can possibly do some optimizations,
+ // such as mapping all these rects into a common ancestor's address space then mapping the
+ // result into the view.
+ for (RenderBlock* currBlock = containingBlock(); currBlock && currBlock->isAnonymousBlock(); currBlock = toRenderBlock(currBlock->nextSibling())) {
+ for (RenderObject* curr = currBlock->firstChild(); curr; curr = curr->nextSibling()) {
+ LayoutRect rect = curr->clippedOverflowRectForPaintInvalidation(view());
+ context(FloatRect(enclosingIntRect(rect)));
leviw_travelin_and_unemployed 2015/01/20 20:19:24 If you're eventually taking the enclosingIntRect o
c.shu 2015/01/20 23:10:22 Done.
+ if (curr == endContinuation)
+ return enclosingIntRect(floatResult);
+ }
+ }
+ return LayoutRect();
+}
+
LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) const
{
if ((!firstLineBoxIncludingCulling() && !continuation()) || style()->visibility() != VISIBLE)

Powered by Google App Engine
This is Rietveld 408576698