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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutInline.cpp

Issue 1837533002: LayoutObject::localOverflowRectForPaintInvalidation() and localSelectionRect() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pi0
Patch Set: Rebase Created 4 years, 8 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 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 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo otBox.lineBottom()) - logicalTop; 1014 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo otBox.lineBottom()) - logicalTop;
1015 1015
1016 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); 1016 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight);
1017 if (!style()->isHorizontalWritingMode()) 1017 if (!style()->isHorizontalWritingMode())
1018 rect = rect.transposedRect(); 1018 rect = rect.transposedRect();
1019 return rect; 1019 return rect;
1020 } 1020 }
1021 1021
1022 LayoutRect LayoutInline::absoluteClippedOverflowRect() const 1022 LayoutRect LayoutInline::absoluteClippedOverflowRect() const
1023 { 1023 {
1024 if (!continuation()) 1024 if (!continuation()) {
1025 return clippedOverflowRect(view()); 1025 LayoutRect rect = visualOverflowRect();
1026 mapToVisibleRectInAncestorSpace(view(), rect, nullptr);
1027 return rect;
1028 }
1026 1029
1027 FloatRect floatResult; 1030 FloatRect floatResult;
1028 LinesBoundingBoxGeneratorContext context(floatResult); 1031 LinesBoundingBoxGeneratorContext context(floatResult);
1029 1032
1030 LayoutInline* endContinuation = inlineElementContinuation(); 1033 LayoutInline* endContinuation = inlineElementContinuation();
1031 while (LayoutInline* nextContinuation = endContinuation->inlineElementContin uation()) 1034 while (LayoutInline* nextContinuation = endContinuation->inlineElementContin uation())
1032 endContinuation = nextContinuation; 1035 endContinuation = nextContinuation;
1033 1036
1034 for (LayoutBlock* currBlock = containingBlock(); currBlock && currBlock->isA nonymousBlock(); currBlock = toLayoutBlock(currBlock->nextSibling())) { 1037 for (LayoutBlock* currBlock = containingBlock(); currBlock && currBlock->isA nonymousBlock(); currBlock = toLayoutBlock(currBlock->nextSibling())) {
1035 for (LayoutObject* curr = currBlock->firstChild(); curr; curr = curr->ne xtSibling()) { 1038 for (LayoutObject* curr = currBlock->firstChild(); curr; curr = curr->ne xtSibling()) {
1036 LayoutRect rect(curr->clippedOverflowRectForPaintInvalidation(view() )); 1039 LayoutRect rect(curr->localOverflowRectForPaintInvalidation());
1037 context(FloatRect(rect)); 1040 context(FloatRect(rect));
1038 if (curr == endContinuation) 1041 if (curr == endContinuation) {
1039 return LayoutRect(enclosingIntRect(floatResult)); 1042 LayoutRect rect(enclosingIntRect(floatResult));
1043 mapToVisibleRectInAncestorSpace(view(), rect, nullptr);
1044 return rect;
1045 }
1040 } 1046 }
1041 } 1047 }
1042 return LayoutRect(); 1048 return LayoutRect();
1043 } 1049 }
1044 1050
1045 LayoutRect LayoutInline::clippedOverflowRectForPaintInvalidation(const LayoutBox ModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInva lidationState) const 1051 LayoutRect LayoutInline::localOverflowRectForPaintInvalidation() const
1046 { 1052 {
1047 // If we don't create line boxes, we don't have any invalidations to do. 1053 // If we don't create line boxes, we don't have any invalidations to do.
1048 if (!alwaysCreateLineBoxes()) 1054 if (!alwaysCreateLineBoxes())
1049 return LayoutRect(); 1055 return LayoutRect();
1050 return clippedOverflowRect(paintInvalidationContainer);
1051 }
1052 1056
1053 LayoutRect LayoutInline::clippedOverflowRect(const LayoutBoxModelObject* paintIn validationContainer, const PaintInvalidationState* paintInvalidationState) const
1054 {
1055 if (style()->visibility() != VISIBLE) 1057 if (style()->visibility() != VISIBLE)
1056 return LayoutRect(); 1058 return LayoutRect();
1057 1059
1058 LayoutRect overflowRect(visualOverflowRect()); 1060 return visualOverflowRect();
1059 if (overflowRect.isEmpty())
1060 return overflowRect;
1061
1062 mapToVisibleRectInAncestorSpace(paintInvalidationContainer, overflowRect, pa intInvalidationState);
1063 return overflowRect;
1064 } 1061 }
1065 1062
1066 LayoutRect LayoutInline::visualOverflowRect() const 1063 LayoutRect LayoutInline::visualOverflowRect() const
1067 { 1064 {
1068 LayoutRect overflowRect = linesVisualOverflowBoundingBox(); 1065 LayoutRect overflowRect = linesVisualOverflowBoundingBox();
1069 LayoutUnit outlineOutset(style()->outlineOutsetExtent()); 1066 LayoutUnit outlineOutset(style()->outlineOutsetExtent());
1070 if (outlineOutset) { 1067 if (outlineOutset) {
1071 Vector<LayoutRect> rects; 1068 Vector<LayoutRect> rects;
1072 // We have already included outline extents of line boxes in linesVisual OverflowBoundingBox(), 1069 // We have already included outline extents of line boxes in linesVisual OverflowBoundingBox(),
1073 // so the following just add outline rects for children and continuation s. 1070 // so the following just add outline rects for children and continuation s.
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 1372
1376 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer, PaintInvalidationReason invalidationReason) const 1373 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer, PaintInvalidationReason invalidationReason) const
1377 { 1374 {
1378 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r, invalidationReason); 1375 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r, invalidationReason);
1379 1376
1380 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) 1377 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
1381 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason); 1378 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason);
1382 } 1379 }
1383 1380
1384 } // namespace blink 1381 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698