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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 LayoutUnit logicalTop = firstLineBox()->logicalTopVisualOverflow(firstRootBo x.lineTop()); 1010 LayoutUnit logicalTop = firstLineBox()->logicalTopVisualOverflow(firstRootBo x.lineTop());
1011 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; 1011 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide;
1012 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo otBox.lineBottom()) - logicalTop; 1012 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo otBox.lineBottom()) - logicalTop;
1013 1013
1014 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); 1014 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight);
1015 if (!style()->isHorizontalWritingMode()) 1015 if (!style()->isHorizontalWritingMode())
1016 rect = rect.transposedRect(); 1016 rect = rect.transposedRect();
1017 return rect; 1017 return rect;
1018 } 1018 }
1019 1019
1020 LayoutRect RenderInline::absoluteClippedOverflowRect() const
1021 {
1022 if (!continuation())
1023 return clippedOverflowRectForPaintInvalidation(view());
pdr. 2014/12/02 21:56:21 It looks like clippedOverflowRectForPaintInvalidat
c.shu 2014/12/02 22:16:31 The continuation code in clippedOverflowRectForPai
pdr. 2014/12/03 22:11:17 Can you help me understand why we wouldn't want to
c.shu 2014/12/03 22:27:27 It's not that we wouldn't want to include outlines
1024
1025 FloatRect floatResult;
1026 LinesBoundingBoxGeneratorContext context(floatResult);
1027
1028 RenderInline* endContinuation = inlineElementContinuation();
1029 while (endContinuation->inlineElementContinuation()) {
leviw_travelin_and_unemployed 2014/12/09 20:39:56 Nit: no braces needed.
c.shu 2014/12/10 02:40:51 Acknowledged.
1030 endContinuation = endContinuation->inlineElementContinuation();
1031 }
1032 for (RenderBlock* currBlock = containingBlock(); currBlock && currBlock->isA nonymousBlock(); currBlock = toRenderBlock(currBlock->nextSibling())) {
1033 for (RenderObject* curr = currBlock->firstChild(); curr; curr = curr->ne xtSibling()) {
1034 LayoutRect rect = curr->clippedOverflowRectForPaintInvalidation(view ());
leviw_travelin_and_unemployed 2014/12/09 20:39:56 This is N^2 since we'll walk up to the view for ev
c.shu 2014/12/10 02:40:51 thanks for pointing out this performance issue. I
1035 context(FloatRect(enclosingIntRect(rect)));
1036 if (curr == endContinuation)
1037 return enclosingIntRect(floatResult);
1038 }
1039 }
1040 return LayoutRect();
1041 }
1042
1020 LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay erModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn validationState) const 1043 LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay erModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn validationState) const
1021 { 1044 {
1022 if ((!firstLineBoxIncludingCulling() && !continuation()) || style()->visibil ity() != VISIBLE) 1045 if ((!firstLineBoxIncludingCulling() && !continuation()) || style()->visibil ity() != VISIBLE)
1023 return LayoutRect(); 1046 return LayoutRect();
1024 1047
1025 LayoutRect paintInvalidationRect(linesVisualOverflowBoundingBox()); 1048 LayoutRect paintInvalidationRect(linesVisualOverflowBoundingBox());
1026 1049
1027 LayoutUnit outlineSize = style()->outlineSize(); 1050 LayoutUnit outlineSize = style()->outlineSize();
1028 paintInvalidationRect.inflate(outlineSize); 1051 paintInvalidationRect.inflate(outlineSize);
1029 1052
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 container = this; 1428 container = this;
1406 1429
1407 FloatPoint absPos = container->localToAbsolute(); 1430 FloatPoint absPos = container->localToAbsolute();
1408 region.bounds.setX(absPos.x() + region.bounds.x()); 1431 region.bounds.setX(absPos.x() + region.bounds.x());
1409 region.bounds.setY(absPos.y() + region.bounds.y()); 1432 region.bounds.setY(absPos.y() + region.bounds.y());
1410 1433
1411 regions.append(region); 1434 regions.append(region);
1412 } 1435 }
1413 1436
1414 } // namespace blink 1437 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698