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

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: 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 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 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 LayoutUnit logicalTop = firstLineBox()->logicalTopVisualOverflow(firstRootBo x.lineTop()); 1013 LayoutUnit logicalTop = firstLineBox()->logicalTopVisualOverflow(firstRootBo x.lineTop());
1014 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; 1014 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide;
1015 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo otBox.lineBottom()) - logicalTop; 1015 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo otBox.lineBottom()) - logicalTop;
1016 1016
1017 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); 1017 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight);
1018 if (!style()->isHorizontalWritingMode()) 1018 if (!style()->isHorizontalWritingMode())
1019 rect = rect.transposedRect(); 1019 rect = rect.transposedRect();
1020 return rect; 1020 return rect;
1021 } 1021 }
1022 1022
1023 LayoutRect RenderInline::absoluteClippedOverflowRect() const
1024 {
1025 if (!continuation())
1026 return clippedOverflowRectForPaintInvalidation(view());
1027
1028 FloatRect floatResult;
1029 LinesBoundingBoxGeneratorContext context(floatResult);
1030
1031 RenderInline* endContinuation = inlineElementContinuation();
1032 while (endContinuation->inlineElementContinuation())
1033 endContinuation = endContinuation->inlineElementContinuation();
1034
1035 // Note the following algorithm is N^2 (if the continuation is N renderers a nd the averagae
1036 // depth of those renderers is M, we'll visit N*M nodes). We can possibly do some optimizations,
1037 // such as mapping all these rects into a common ancestor's address space th en mapping the
1038 // result into the view.
1039 for (RenderBlock* currBlock = containingBlock(); currBlock && currBlock->isA nonymousBlock(); currBlock = toRenderBlock(currBlock->nextSibling())) {
1040 for (RenderObject* curr = currBlock->firstChild(); curr; curr = curr->ne xtSibling()) {
1041 LayoutRect rect = curr->clippedOverflowRectForPaintInvalidation(view ());
1042 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.
1043 if (curr == endContinuation)
1044 return enclosingIntRect(floatResult);
1045 }
1046 }
1047 return LayoutRect();
1048 }
1049
1023 LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay erModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn validationState) const 1050 LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay erModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn validationState) const
1024 { 1051 {
1025 if ((!firstLineBoxIncludingCulling() && !continuation()) || style()->visibil ity() != VISIBLE) 1052 if ((!firstLineBoxIncludingCulling() && !continuation()) || style()->visibil ity() != VISIBLE)
1026 return LayoutRect(); 1053 return LayoutRect();
1027 1054
1028 LayoutRect paintInvalidationRect(linesVisualOverflowBoundingBox()); 1055 LayoutRect paintInvalidationRect(linesVisualOverflowBoundingBox());
1029 1056
1030 LayoutUnit outlineSize = style()->outlineSize(); 1057 LayoutUnit outlineSize = style()->outlineSize();
1031 paintInvalidationRect.inflate(outlineSize); 1058 paintInvalidationRect.inflate(outlineSize);
1032 1059
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 container = this; 1435 container = this;
1409 1436
1410 FloatPoint absPos = container->localToAbsolute(); 1437 FloatPoint absPos = container->localToAbsolute();
1411 region.bounds.setX(absPos.x() + region.bounds.x()); 1438 region.bounds.setX(absPos.x() + region.bounds.x());
1412 region.bounds.setY(absPos.y() + region.bounds.y()); 1439 region.bounds.setY(absPos.y() + region.bounds.y());
1413 1440
1414 regions.append(region); 1441 regions.append(region);
1415 } 1442 }
1416 1443
1417 } // namespace blink 1444 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698