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

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

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve comments Created 4 years, 6 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 * (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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 // If the element is the HTML body element or doesn't have a parent 763 // If the element is the HTML body element or doesn't have a parent
764 // return 0 and stop this algorithm. 764 // return 0 and stop this algorithm.
765 if (isBody() || !parent()) 765 if (isBody() || !parent())
766 return LayoutPoint(); 766 return LayoutPoint();
767 767
768 LayoutPoint referencePoint = startPoint; 768 LayoutPoint referencePoint = startPoint;
769 referencePoint.move(parent()->columnOffset(referencePoint)); 769 referencePoint.move(parent()->columnOffset(referencePoint));
770 770
771 // If the offsetParent of the element is null, or is the HTML body element, 771 // If the offsetParent of the element is null, or is the HTML body element,
772 // return the distance between the canvas origin and the left border edge 772 // return the distance between the canvas origin and the left border edge
773 // of the element and stop this algorithm. 773 // of the element and stop this algorithm.
eae 2016/06/09 13:19:42 Please update this comment to explain what an offs
kochi 2016/06/09 16:04:27 I'm not sure "or is the HTML body element" part, a
774 Element* element = offsetParent(); 774 Element* element = offsetParentForBinding();
775 if (!element) 775 if (!element)
776 return referencePoint; 776 return referencePoint;
777 777
778 if (const LayoutBoxModelObject* offsetParent = element->layoutBoxModelObject ()) { 778 if (const LayoutBoxModelObject* offsetParent = element->layoutBoxModelObject ()) {
779 if (offsetParent->isBox() && !offsetParent->isBody()) 779 if (offsetParent->isBox() && !offsetParent->isBody())
780 referencePoint.move(-toLayoutBox(offsetParent)->borderLeft(), -toLay outBox(offsetParent)->borderTop()); 780 referencePoint.move(-toLayoutBox(offsetParent)->borderLeft(), -toLay outBox(offsetParent)->borderTop());
781 if (!isOutOfFlowPositioned() || flowThreadContainingBlock()) { 781 if (!isOutOfFlowPositioned() || flowThreadContainingBlock()) {
782 if (isInFlowPositioned()) 782 if (isInFlowPositioned())
783 referencePoint.move(offsetForInFlowPosition()); 783 referencePoint.move(offsetForInFlowPosition());
784 784
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 if (rootElementStyle->hasBackground()) 1126 if (rootElementStyle->hasBackground())
1127 return false; 1127 return false;
1128 1128
1129 if (node() != document().firstBodyElement()) 1129 if (node() != document().firstBodyElement())
1130 return false; 1130 return false;
1131 1131
1132 return true; 1132 return true;
1133 } 1133 }
1134 1134
1135 } // namespace blink 1135 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698