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

Side by Side Diff: Source/core/rendering/RenderBoxModelObject.cpp

Issue 259993006: Cleanup: Replace adjustForColumns() / offsetForColumns() with columnOffset(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderInline.cpp » ('j') | 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 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } 239 }
240 240
241 LayoutPoint RenderBoxModelObject::adjustedPositionRelativeToOffsetParent(const L ayoutPoint& startPoint) const 241 LayoutPoint RenderBoxModelObject::adjustedPositionRelativeToOffsetParent(const L ayoutPoint& startPoint) const
242 { 242 {
243 // If the element is the HTML body element or doesn't have a parent 243 // If the element is the HTML body element or doesn't have a parent
244 // return 0 and stop this algorithm. 244 // return 0 and stop this algorithm.
245 if (isBody() || !parent()) 245 if (isBody() || !parent())
246 return LayoutPoint(); 246 return LayoutPoint();
247 247
248 LayoutPoint referencePoint = startPoint; 248 LayoutPoint referencePoint = startPoint;
249 referencePoint.move(parent()->offsetForColumns(referencePoint)); 249 referencePoint.move(parent()->columnOffset(referencePoint));
250 250
251 // If the offsetParent of the element is null, or is the HTML body element, 251 // If the offsetParent of the element is null, or is the HTML body element,
252 // return the distance between the canvas origin and the left border edge 252 // return the distance between the canvas origin and the left border edge
253 // of the element and stop this algorithm. 253 // of the element and stop this algorithm.
254 Element* element = offsetParent(); 254 Element* element = offsetParent();
255 if (!element) 255 if (!element)
256 return referencePoint; 256 return referencePoint;
257 257
258 if (const RenderBoxModelObject* offsetParent = element->renderBoxModelObject ()) { 258 if (const RenderBoxModelObject* offsetParent = element->renderBoxModelObject ()) {
259 if (offsetParent->isBox() && !offsetParent->isBody()) 259 if (offsetParent->isBox() && !offsetParent->isBody())
260 referencePoint.move(-toRenderBox(offsetParent)->borderLeft(), -toRen derBox(offsetParent)->borderTop()); 260 referencePoint.move(-toRenderBox(offsetParent)->borderLeft(), -toRen derBox(offsetParent)->borderTop());
261 if (!isOutOfFlowPositioned() || flowThreadContainingBlock()) { 261 if (!isOutOfFlowPositioned() || flowThreadContainingBlock()) {
262 if (isRelPositioned()) 262 if (isRelPositioned())
263 referencePoint.move(relativePositionOffset()); 263 referencePoint.move(relativePositionOffset());
264 else if (isStickyPositioned()) 264 else if (isStickyPositioned())
265 referencePoint.move(stickyPositionOffset()); 265 referencePoint.move(stickyPositionOffset());
266 266
267 RenderObject* current; 267 RenderObject* current;
268 for (current = parent(); current != offsetParent && current->parent( ); current = current->parent()) { 268 for (current = parent(); current != offsetParent && current->parent( ); current = current->parent()) {
269 // FIXME: What are we supposed to do inside SVG content? 269 // FIXME: What are we supposed to do inside SVG content?
270 if (!isOutOfFlowPositioned()) { 270 if (!isOutOfFlowPositioned()) {
271 if (current->isBox() && !current->isTableRow()) 271 if (current->isBox() && !current->isTableRow())
272 referencePoint.moveBy(toRenderBox(current)->topLeftLocat ion()); 272 referencePoint.moveBy(toRenderBox(current)->topLeftLocat ion());
273 referencePoint.move(current->parent()->offsetForColumns(refe rencePoint)); 273 referencePoint.move(current->parent()->columnOffset(referenc ePoint));
274 } 274 }
275 } 275 }
276 276
277 if (offsetParent->isBox() && offsetParent->isBody() && !offsetParent ->isPositioned()) 277 if (offsetParent->isBox() && offsetParent->isBody() && !offsetParent ->isPositioned())
278 referencePoint.moveBy(toRenderBox(offsetParent)->topLeftLocation ()); 278 referencePoint.moveBy(toRenderBox(offsetParent)->topLeftLocation ());
279 } 279 }
280 } 280 }
281 281
282 return referencePoint; 282 return referencePoint;
283 } 283 }
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after
2824 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); 2824 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent());
2825 for (RenderObject* child = startChild; child && child != endChild; ) { 2825 for (RenderObject* child = startChild; child && child != endChild; ) {
2826 // Save our next sibling as moveChildTo will clear it. 2826 // Save our next sibling as moveChildTo will clear it.
2827 RenderObject* nextSibling = child->nextSibling(); 2827 RenderObject* nextSibling = child->nextSibling();
2828 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); 2828 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert);
2829 child = nextSibling; 2829 child = nextSibling;
2830 } 2830 }
2831 } 2831 }
2832 2832
2833 } // namespace WebCore 2833 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698