Modified: trunk/Source/WebCore/ChangeLog (201979 => 201980)
--- trunk/Source/WebCore/ChangeLog 2016-06-11 22:55:40 UTC (rev 201979)
+++ trunk/Source/WebCore/ChangeLog 2016-06-11 23:35:23 UTC (rev 201980)
@@ -1,3 +1,15 @@
+2016-06-11 Darin Adler <[email protected]>
+
+ Tighten code to build set of tag names
+ https://bugs.webkit.org/show_bug.cgi?id=158662
+
+ Reviewed by Alexey Proskuryakov.
+
+ * dom/Element.cpp:
+ (WebCore::canAttachAuthorShadowRoot): Use an array of pointers that the loader
+ can initialize as part of loading the library, rather than an array that needs
+ to be initialized with code at runtime.
+
2016-06-11 Myles C. Maxfield <[email protected]>
[Win] [EFL] Build fix after r201978.
Modified: trunk/Source/WebCore/dom/Element.cpp (201979 => 201980)
--- trunk/Source/WebCore/dom/Element.cpp 2016-06-11 22:55:40 UTC (rev 201979)
+++ trunk/Source/WebCore/dom/Element.cpp 2016-06-11 23:35:23 UTC (rev 201980)
@@ -1686,32 +1686,32 @@
}
#if ENABLE(SHADOW_DOM)
+
static bool canAttachAuthorShadowRoot(const Element& element)
{
static NeverDestroyed<HashSet<AtomicString>> tagNames = [] {
- const AtomicString tagList[] = {
- articleTag.localName(),
- asideTag.localName(),
- blockquoteTag.localName(),
- bodyTag.localName(),
- divTag.localName(),
- footerTag.localName(),
- h1Tag.localName(),
- h2Tag.localName(),
- h3Tag.localName(),
- h4Tag.localName(),
- h5Tag.localName(),
- h6Tag.localName(),
- headerTag.localName(),
- navTag.localName(),
- pTag.localName(),
- sectionTag.localName(),
- spanTag.localName()
+ static const HTMLQualifiedName* const tagList[] = {
+ &articleTag,
+ &asideTag,
+ &blockquoteTag,
+ &bodyTag,
+ &divTag,
+ &footerTag,
+ &h1Tag,
+ &h2Tag,
+ &h3Tag,
+ &h4Tag,
+ &h5Tag,
+ &h6Tag,
+ &headerTag,
+ &navTag,
+ &pTag,
+ §ionTag,
+ &spanTag
};
-
HashSet<AtomicString> set;
for (auto& name : tagList)
- set.add(name);
+ set.add(name->localName());
return set;
}();
@@ -1751,8 +1751,9 @@
}
return root;
}
-#endif
+#endif // ENABLE(SHADOW_DOM)
+
ShadowRoot* Element::userAgentShadowRoot() const
{
if (ShadowRoot* shadowRoot = this->shadowRoot()) {