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

Unified Diff: third_party/WebKit/Source/core/dom/TreeScope.cpp

Issue 2146013003: Rename adjustPointerLockElement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename function and update comments. 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/TreeScope.cpp
diff --git a/third_party/WebKit/Source/core/dom/TreeScope.cpp b/third_party/WebKit/Source/core/dom/TreeScope.cpp
index ff7396764d943d7314394e226cec2ecc21e08a39..6f791307b23225ed76a8a8d5d15f23f609817cbf 100644
--- a/third_party/WebKit/Source/core/dom/TreeScope.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScope.cpp
@@ -388,16 +388,14 @@ Element* TreeScope::adjustedFocusedElement() const
return nullptr;
}
-Element* TreeScope::adjustedPointerLockElement(const Element& target) const
+Element* TreeScope::adjustedElement(const Element& target) const
{
const Element* adjustedTarget = ⌖
- // Unless the target is in the same TreeScope as |scope|, traverse up shadow trees to
- // find a shadow host that is in the same TreeScope as |scope|.
for (const Element* ancestor = ⌖ ancestor; ancestor = ancestor->shadowHost()) {
- // Exception is that if the host has V0 or UA shadow, skip the adjustment because
- // .pointerLockElement is not available for non-V1 shadows.
- // TODO(kochi): Once V0 code is removed, use the same logic as .activeElement for
- // Shadow DOM V1.
+ // This adjustment is done only for V1 shadows, and is skipped for V0 or UA shadows,
+ // because .pointerLockElement and .(webkit)fullscreenElement is not available for
+ // non-V1 shadow roots.
+ // TODO(kochi): Once V0 code is removed, use the same logic as .activeElement for V1.
if (ancestor->shadowRootIfV1())
adjustedTarget = ancestor;
if (this == ancestor->treeScope())
@@ -405,6 +403,7 @@ Element* TreeScope::adjustedPointerLockElement(const Element& target) const
}
return nullptr;
}
+
unsigned short TreeScope::comparePosition(const TreeScope& otherScope) const
{
if (otherScope == this)

Powered by Google App Engine
This is Rietveld 408576698