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

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

Issue 1995203002: Rewrite Shadow DOM distribution engine to support partial synchronous distribution for v1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: No longer FAIL: imported/wpt/shadow-dom/HTMLSlotElement-interface.html Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp
diff --git a/third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp b/third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp
index 5c7822bdec370e816a0b651ba83bc0b9553c927e..a7c01b5f2068fbf7ea498320fd37924269d3aa6e 100644
--- a/third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp
+++ b/third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp
@@ -35,6 +35,7 @@
#include "core/dom/ElementTraversal.h"
#include "core/dom/TreeScope.h"
#include "core/html/HTMLMapElement.h"
+#include "core/html/HTMLSlotElement.h"
namespace blink {
@@ -75,6 +76,11 @@ inline bool keyMatchesMapName(const AtomicString& key, const Element& element)
return isHTMLMapElement(element) && toHTMLMapElement(element).getName() == key;
}
+inline bool keyMatchesSlotName(const AtomicString& key, const Element& element)
+{
+ return isHTMLSlotElement(element) && toHTMLSlotElement(element).name() == key;
+}
+
inline bool keyMatchesLowercasedMapName(const AtomicString& key, const Element& element)
{
return isHTMLMapElement(element) && toHTMLMapElement(element).getName().lower() == key;
@@ -195,6 +201,16 @@ Element* DocumentOrderedMap::getElementByMapName(const AtomicString& key, const
return get<keyMatchesMapName>(key, scope);
}
+// TODO(hayato): Template get<> by return type.
+HTMLSlotElement* DocumentOrderedMap::getSlotByName(const AtomicString& key, const TreeScope* scope) const
+{
+ if (Element* slot = get<keyMatchesSlotName>(key, scope)) {
+ DCHECK(isHTMLSlotElement(slot));
+ return toHTMLSlotElement(slot);
+ }
+ return nullptr;
+}
+
Element* DocumentOrderedMap::getElementByLowercasedMapName(const AtomicString& key, const TreeScope* scope) const
{
return get<keyMatchesLowercasedMapName>(key, scope);
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentOrderedMap.h ('k') | third_party/WebKit/Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698