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

Unified Diff: Source/core/dom/Element.cpp

Issue 994903003: Merge Element::offsetParentForBindings() into offsetParent() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index e2ecccf61c2d5dbc2daaec54dc3e5c07ba06eee8..5c42b241f41d10083753d42dbc81e61d04bdeb01 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -544,20 +544,22 @@ int Element::offsetHeight()
return 0;
}
-Element* Element::offsetParentForBindings()
-{
- Element* element = offsetParent();
- if (!element || !element->isInShadowTree())
- return element;
- return element->containingShadowRoot()->shouldExposeToBindings() ? element : nullptr;
-}
-
Element* Element::offsetParent()
{
document().updateLayoutIgnorePendingStylesheets();
- if (LayoutObject* renderer = this->layoutObject())
- return renderer->offsetParent();
- return nullptr;
+
+ LayoutObject* renderer = layoutObject();
+ if (!renderer)
+ return nullptr;
+
+ Element* element = renderer->offsetParent();
+ if (!element)
+ return nullptr;
+
+ if (element->isInShadowTree() && !element->containingShadowRoot()->shouldExposeToBindings())
+ return nullptr;
+
+ return element;
}
int Element::clientLeft()
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698