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

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

Issue 2454693003: adjustedPositionRelativeTo() couldn't find offsetParent. (Closed)
Patch Set: Update comment, since the problem described has been fixed. Created 4 years, 1 month 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 | « third_party/WebKit/LayoutTests/fast/inline/inline-offsetLeft-continuation-expected.txt ('k') | 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 * (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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 return referencePoint; 993 return referencePoint;
994 994
995 if (const LayoutBoxModelObject* offsetParent = 995 if (const LayoutBoxModelObject* offsetParent =
996 element->layoutBoxModelObject()) { 996 element->layoutBoxModelObject()) {
997 if (!isOutOfFlowPositioned()) { 997 if (!isOutOfFlowPositioned()) {
998 if (isInFlowPositioned()) 998 if (isInFlowPositioned())
999 referencePoint.move(offsetForInFlowPosition()); 999 referencePoint.move(offsetForInFlowPosition());
1000 1000
1001 // Note that we may fail to find |offsetParent| while walking the 1001 // Note that we may fail to find |offsetParent| while walking the
1002 // container chain, if |offsetParent| is an inline split into 1002 // container chain, if |offsetParent| is an inline split into
1003 // continuations: <body style="display:inline;" id="offsetParent"><div> 1003 // continuations: <body style="display:inline;" id="offsetParent">
1004 // </div><span id="this"> 1004 // <div id="this">
1005 // This is why we have to do a nullptr check here. 1005 // This is why we have to do a nullptr check here.
1006 // offset(Left|Top) is generally broken when offsetParent is inline. 1006 // offset(Left|Top) is generally broken when offsetParent is inline.
1007 for (const LayoutObject* current = container(); 1007 for (const LayoutObject* current = container();
1008 current && current != offsetParent; current = current->container()) { 1008 current && current->node() != element;
1009 current = current->container()) {
1009 // FIXME: What are we supposed to do inside SVG content? 1010 // FIXME: What are we supposed to do inside SVG content?
1010 referencePoint.move(current->columnOffset(referencePoint)); 1011 referencePoint.move(current->columnOffset(referencePoint));
1011 if (current->isBox() && !current->isTableRow()) 1012 if (current->isBox() && !current->isTableRow())
1012 referencePoint.moveBy(toLayoutBox(current)->topLeftLocation()); 1013 referencePoint.moveBy(toLayoutBox(current)->topLeftLocation());
1013 } 1014 }
1014 1015
1015 if (offsetParent->isBox() && offsetParent->isBody() && 1016 if (offsetParent->isBox() && offsetParent->isBody() &&
1016 !offsetParent->isPositioned()) 1017 !offsetParent->isPositioned())
1017 referencePoint.moveBy(toLayoutBox(offsetParent)->topLeftLocation()); 1018 referencePoint.moveBy(toLayoutBox(offsetParent)->topLeftLocation());
1018 } 1019 }
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 if (rootElementStyle->hasBackground()) 1376 if (rootElementStyle->hasBackground())
1376 return false; 1377 return false;
1377 1378
1378 if (node() != document().firstBodyElement()) 1379 if (node() != document().firstBodyElement())
1379 return false; 1380 return false;
1380 1381
1381 return true; 1382 return true;
1382 } 1383 }
1383 1384
1384 } // namespace blink 1385 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/inline/inline-offsetLeft-continuation-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698