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

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

Issue 2165913005: Clean up in-flow position offset for LayoutInline mapping to visual rect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head. Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 bool LayoutInline::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* an cestor, LayoutRect& rect, VisualRectFlags visualRectFlags) const 1071 bool LayoutInline::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* an cestor, LayoutRect& rect, VisualRectFlags visualRectFlags) const
1072 { 1072 {
1073 if (ancestor == this) 1073 if (ancestor == this)
1074 return true; 1074 return true;
1075 1075
1076 LayoutObject* container = this->container(); 1076 LayoutObject* container = this->container();
1077 ASSERT(container == parent()); 1077 ASSERT(container == parent());
1078 if (!container) 1078 if (!container)
1079 return true; 1079 return true;
1080 1080
1081 LayoutPoint topLeft = rect.location();
1082
1083 if (style()->hasInFlowPosition() && layer()) { 1081 if (style()->hasInFlowPosition() && layer()) {
1084 // Apply the in-flow position offset when invalidating a rectangle. The layer 1082 // Apply the in-flow position offset when invalidating a rectangle. The layer
1085 // is translated, but the layout box isn't, so we need to do this to get the 1083 // is translated, but the layout box isn't, so we need to do this to get the
1086 // right dirty rect. Since this is called from LayoutObject::setStyle, t he relative position 1084 // right dirty rect. Since this is called from LayoutObject::setStyle, t he relative position
1087 // flag on the LayoutObject has been cleared, so use the one on the styl e(). 1085 // flag on the LayoutObject has been cleared, so use the one on the styl e().
1088 topLeft += layer()->offsetForInFlowPosition(); 1086 rect.move(layer()->offsetForInFlowPosition());
1089 } 1087 }
1090 1088
1091 // FIXME: We ignore the lightweight clipping rect that controls use, since i f |o| is in mid-layout,
1092 // its controlClipRect will be wrong. For overflow clip we use the values ca ched by the layer.
1093 rect.setLocation(topLeft);
1094
1095 LayoutBox* containerBox = container->isBox() ? toLayoutBox(container) : null ptr; 1089 LayoutBox* containerBox = container->isBox() ? toLayoutBox(container) : null ptr;
1096 if (containerBox && !containerBox->mapScrollingContentsRectToBoxSpace(rect, container == ancestor ? ApplyNonScrollOverflowClip : ApplyOverflowClip, visualRe ctFlags)) 1090 if (containerBox && !containerBox->mapScrollingContentsRectToBoxSpace(rect, container == ancestor ? ApplyNonScrollOverflowClip : ApplyOverflowClip, visualRe ctFlags))
1097 return false; 1091 return false;
1098 1092
1099 if (containerBox) 1093 if (containerBox)
1100 containerBox->flipForWritingMode(rect); 1094 containerBox->flipForWritingMode(rect);
1101 return container->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectF lags); 1095 return container->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectF lags);
1102 } 1096 }
1103 1097
1104 LayoutSize LayoutInline::offsetFromContainer(const LayoutObject* container) cons t 1098 LayoutSize LayoutInline::offsetFromContainer(const LayoutObject* container) cons t
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 1346
1353 void LayoutInline::invalidateDisplayItemClients(PaintInvalidationReason invalida tionReason) const 1347 void LayoutInline::invalidateDisplayItemClients(PaintInvalidationReason invalida tionReason) const
1354 { 1348 {
1355 LayoutBoxModelObject::invalidateDisplayItemClients(invalidationReason); 1349 LayoutBoxModelObject::invalidateDisplayItemClients(invalidationReason);
1356 1350
1357 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) 1351 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
1358 invalidateDisplayItemClient(*box, invalidationReason); 1352 invalidateDisplayItemClient(*box, invalidationReason);
1359 } 1353 }
1360 1354
1361 } // namespace blink 1355 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698