<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[201739] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/201739">201739</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2016-06-06 21:02:11 -0700 (Mon, 06 Jun 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Update the list of elements attachShadow is allowed
https://bugs.webkit.org/show_bug.cgi?id=157706
Reviewed by Darin Adler.
Source/WebCore:
Update the list of elements on which attachShadow is allowed per the latest shadow DOM spec:
http://www.w3.org/TR/shadow-dom/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict
which now only allows attachShadow on the following elements and custom elements:
button, details, input, marquee, meter, progress, select, textarea, keygen
In order to check that a given HTML element's local name is a valid custom element name,
this patch moves CustomElementDefinitions::checkName to Document::validateCustomElementName so that
it could be used when either SHADOW_DOM or CUSTOM_ELEMENTS build flag is turned on.
Also removed Element::canHaveUserAgentShadowRoot since it was only used in Element::attachShadow.
Test: fast/shadow-dom/Element-interface-attachShadow.html
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::defineElement):
* dom/CustomElementDefinitions.cpp:
(WebCore::CustomElementDefinitions::checkName): Moved to Document::validateCustomElementName.
* dom/CustomElementDefinitions.h:
* dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
(WebCore::createFallbackHTMLElement):
(WebCore::Document::validateCustomElementName): Moved from CustomElementDefinitions::checkName.
* dom/Document.h:
* dom/Element.cpp:
(WebCore::canAttachAuthorShadowRoot): Added.
(WebCore::Element::attachShadow):
* dom/Element.h:
* html/HTMLButtonElement.h:
* html/HTMLDetailsElement.h:
* html/HTMLInputElement.h:
* html/HTMLKeygenElement.h:
* html/HTMLMarqueeElement.h:
* html/HTMLMediaElement.h:
* html/HTMLMeterElement.h:
* html/HTMLPlugInElement.h:
* html/HTMLProgressElement.h:
* html/HTMLQuoteElement.h:
* html/HTMLSelectElement.h:
* html/HTMLSummaryElement.h:
* html/HTMLTagNames.in:
* html/HTMLTextAreaElement.h:
* html/HTMLUnknownElement.h:
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
LayoutTests:
Added more test cases for validating elements on which attachShadow is allowed and disallowed.
* fast/shadow-dom/Element-interface-attachShadow-expected.txt:
* fast/shadow-dom/Element-interface-attachShadow.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastshadowdomElementinterfaceattachShadowexpectedtxt">trunk/LayoutTests/fast/shadow-dom/Element-interface-attachShadow-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastshadowdomElementinterfaceattachShadowhtml">trunk/LayoutTests/fast/shadow-dom/Element-interface-attachShadow.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentCustomcpp">trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp</a></li>
<li><a href="#trunkSourceWebCoredomCustomElementDefinitionscpp">trunk/Source/WebCore/dom/CustomElementDefinitions.cpp</a></li>
<li><a href="#trunkSourceWebCoredomCustomElementDefinitionsh">trunk/Source/WebCore/dom/CustomElementDefinitions.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLButtonElementh">trunk/Source/WebCore/html/HTMLButtonElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLDetailsElementh">trunk/Source/WebCore/html/HTMLDetailsElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementh">trunk/Source/WebCore/html/HTMLInputElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLKeygenElementh">trunk/Source/WebCore/html/HTMLKeygenElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMarqueeElementh">trunk/Source/WebCore/html/HTMLMarqueeElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMeterElementh">trunk/Source/WebCore/html/HTMLMeterElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInElementh">trunk/Source/WebCore/html/HTMLPlugInElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLProgressElementh">trunk/Source/WebCore/html/HTMLProgressElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLQuoteElementh">trunk/Source/WebCore/html/HTMLQuoteElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLSelectElementh">trunk/Source/WebCore/html/HTMLSelectElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLSummaryElementh">trunk/Source/WebCore/html/HTMLSummaryElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTagNamesin">trunk/Source/WebCore/html/HTMLTagNames.in</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementh">trunk/Source/WebCore/html/HTMLTextAreaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLUnknownElementh">trunk/Source/WebCore/html/HTMLUnknownElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLConstructionSitecpp">trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/LayoutTests/ChangeLog        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-06-02 Ryosuke Niwa <rniwa@webkit.org>
+
+ Update the list of elements attachShadow is allowed
+ https://bugs.webkit.org/show_bug.cgi?id=157706
+
+ Reviewed by Darin Adler.
+
+ Added more test cases for validating elements on which attachShadow is allowed and disallowed.
+
+ * fast/shadow-dom/Element-interface-attachShadow-expected.txt:
+ * fast/shadow-dom/Element-interface-attachShadow.html:
+
</ins><span class="cx"> 2016-06-03 Ryosuke Niwa <rniwa@webkit.org>
</span><span class="cx">
</span><span class="cx"> Crash inside moveOutOfAllShadowRoots
</span></span></pre></div>
<a id="trunkLayoutTestsfastshadowdomElementinterfaceattachShadowexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shadow-dom/Element-interface-attachShadow-expected.txt (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shadow-dom/Element-interface-attachShadow-expected.txt        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/LayoutTests/fast/shadow-dom/Element-interface-attachShadow-expected.txt        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -4,5 +4,8 @@
</span><span class="cx"> PASS Element.attachShadow must throw a TypeError if mode is not "open" or "closed"
</span><span class="cx"> PASS Element.attachShadow must create an instance of ShadowRoot
</span><span class="cx"> PASS Element.attachShadow must throw a InvalidStateError if the context object already hosts a shadow tree
</span><del>-PASS Element.attachShadow must throw a NotSupportedError for button, details, input, marquee, meter, progress, select, textarea, and keygen elements
</del><ins>+PASS Element.attachShadow must throw a NotSupportedError on HTML elements whose local name is not one of article, aside, blockquote, body, div, footer, h1, h2, h3, h4, h5, h6, header, nav, p, section, span
+PASS Element.attachShadow must not throw a NotSupportedError on article, aside, blockquote, body, div, footer, h1, h2, h3, h4, h5, h6, header, nav, p, section, span
+PASS Element.attachShadow must throw a NotSupportedError on a HTMLKnownElement which does not have a valid custom element
+PASS Element.attachShadow must throw a NotSupportedError on a HTMLKnownElement which has a valid custom element
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsfastshadowdomElementinterfaceattachShadowhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shadow-dom/Element-interface-attachShadow.html (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shadow-dom/Element-interface-attachShadow.html        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/LayoutTests/fast/shadow-dom/Element-interface-attachShadow.html        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -78,8 +78,22 @@
</span><span class="cx"> }, 'Calling attachShadow({mode: "open"}) after attachShadow({mode: "closed"}) on the same element must throw');
</span><span class="cx"> }, 'Element.attachShadow must throw a InvalidStateError if the context object already hosts a shadow tree');
</span><span class="cx">
</span><ins>+var htmlElementNames = ['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi',
+ 'bdo', 'bgsound', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup',
+ 'command', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption',
+ 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr',
+ 'html', 'i', 'iframe', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'layer', 'legend', 'li', 'link', 'listing',
+ 'main', 'map', 'mark', 'marquee', 'menu', 'meta', 'meter', 'nav', 'nobr', 'noembed', 'noframes', 'nolayer', 'object', 'ol', 'optgroup',
+ 'option', 'output', 'p', 'param', 'picture', 'plaintext', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script',
+ 'section', 'select', 'slot', 'small', 'source', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td',
+ 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp', 'noscript'];
+var allowingAttachShadow = ["article", "aside", "blockquote", "body", "div", "footer", "h1", "h2", "h3", "h4", "h5", "h6", "header", "nav", "p", "section", "span"];
+
</ins><span class="cx"> test(function () {
</span><del>- for (var elementName of ['button', 'details', 'input', 'marquee', 'meter', 'progress', 'select', 'textarea', 'keygen']) {
</del><ins>+ for (var elementName of htmlElementNames) {
+ if (allowingAttachShadow.indexOf(elementName) >= 0)
+ continue;
+
</ins><span class="cx"> assert_throws({'name': 'NotSupportedError'}, function () {
</span><span class="cx"> document.createElement(elementName).attachShadow({mode: "open"});
</span><span class="cx"> }, 'Calling attachShadow({mode: "open"}) on ' + elementName + ' element must throw');
</span><span class="lines">@@ -88,8 +102,38 @@
</span><span class="cx"> document.createElement(elementName).attachShadow({mode: "closed"});
</span><span class="cx"> }, 'Calling attachShadow({mode: "closed"}) on ' + elementName + ' element must throw');
</span><span class="cx"> }
</span><del>-}, 'Element.attachShadow must throw a NotSupportedError for button, details, input, marquee, meter, progress, select, textarea, and keygen elements');
</del><ins>+}, 'Element.attachShadow must throw a NotSupportedError on HTML elements whose local name is not one of ' + allowingAttachShadow.join(', '));
</ins><span class="cx">
</span><ins>+test(function () {
+ for (var elementName of allowingAttachShadow) {
+ assert_true(document.createElement(elementName).attachShadow({mode: "open"}) instanceof ShadowRoot,
+ 'Calling attachShadow({mode: "open"}) on ' + elementName + ' element must not throw');
+
+ assert_true(document.createElement(elementName).attachShadow({mode: "closed"}) instanceof ShadowRoot,
+ 'Calling attachShadow({mode: "closed"}) on ' + elementName + ' element must not throw');
+ }
+}, 'Element.attachShadow must not throw a NotSupportedError on ' + allowingAttachShadow.join(', '));
+
+test(function () {
+ assert_throws({'name': 'NotSupportedError'}, function () {
+ document.createElement('w3cfutureelement').attachShadow({mode: "open"});
+ }, 'Calling attachShadow({mode: "open"}) on a HTML element whose local name is "w3cfutureelement" must throw');
+
+ assert_throws({'name': 'NotSupportedError'}, function () {
+ document.createElement('w3cfutureelement').attachShadow({mode: "closed"});
+ }, 'Calling attachShadow({mode: "closed"}) on a HTML element whose local name is "w3cfutureelement" must throw');
+
+}, 'Element.attachShadow must throw a NotSupportedError on a HTMLKnownElement which does not have a valid custom element');
+
+test(function () {
+ assert_true(document.createElement('custom-element').attachShadow({mode: "open"}) instanceof ShadowRoot,
+ 'Calling attachShadow({mode: "open"}) on a HTML element whose local name is "custom-element" element must not throw');
+
+ assert_true(document.createElement('custom-element').attachShadow({mode: "closed"}) instanceof ShadowRoot,
+ 'Calling attachShadow({mode: "closed"}) on a HTML element whose local name is "custom-element" must not throw');
+
+}, 'Element.attachShadow must throw a NotSupportedError on a HTMLKnownElement which has a valid custom element');
+
</ins><span class="cx"> </script>
</span><span class="cx"> </body>
</span><span class="cx"> </html>
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/ChangeLog        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2016-06-02 Ryosuke Niwa <rniwa@webkit.org>
+
+ Update the list of elements attachShadow is allowed
+ https://bugs.webkit.org/show_bug.cgi?id=157706
+
+ Reviewed by Darin Adler.
+
+ Update the list of elements on which attachShadow is allowed per the latest shadow DOM spec:
+ http://www.w3.org/TR/shadow-dom/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict
+ which now only allows attachShadow on the following elements and custom elements:
+ button, details, input, marquee, meter, progress, select, textarea, keygen
+
+ In order to check that a given HTML element's local name is a valid custom element name,
+ this patch moves CustomElementDefinitions::checkName to Document::validateCustomElementName so that
+ it could be used when either SHADOW_DOM or CUSTOM_ELEMENTS build flag is turned on.
+
+ Also removed Element::canHaveUserAgentShadowRoot since it was only used in Element::attachShadow.
+
+ Test: fast/shadow-dom/Element-interface-attachShadow.html
+
+ * bindings/js/JSDocumentCustom.cpp:
+ (WebCore::JSDocument::defineElement):
+ * dom/CustomElementDefinitions.cpp:
+ (WebCore::CustomElementDefinitions::checkName): Moved to Document::validateCustomElementName.
+ * dom/CustomElementDefinitions.h:
+ * dom/Document.cpp:
+ (WebCore::createHTMLElementWithNameValidation):
+ (WebCore::createFallbackHTMLElement):
+ (WebCore::Document::validateCustomElementName): Moved from CustomElementDefinitions::checkName.
+ * dom/Document.h:
+ * dom/Element.cpp:
+ (WebCore::canAttachAuthorShadowRoot): Added.
+ (WebCore::Element::attachShadow):
+ * dom/Element.h:
+ * html/HTMLButtonElement.h:
+ * html/HTMLDetailsElement.h:
+ * html/HTMLInputElement.h:
+ * html/HTMLKeygenElement.h:
+ * html/HTMLMarqueeElement.h:
+ * html/HTMLMediaElement.h:
+ * html/HTMLMeterElement.h:
+ * html/HTMLPlugInElement.h:
+ * html/HTMLProgressElement.h:
+ * html/HTMLQuoteElement.h:
+ * html/HTMLSelectElement.h:
+ * html/HTMLSummaryElement.h:
+ * html/HTMLTagNames.in:
+ * html/HTMLTextAreaElement.h:
+ * html/HTMLUnknownElement.h:
+ * html/parser/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
+
</ins><span class="cx"> 2016-06-03 Ryosuke Niwa <rniwa@webkit.org>
</span><span class="cx">
</span><span class="cx"> Crash inside moveOutOfAllShadowRoots
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -158,14 +158,14 @@
</span><span class="cx"> return jsUndefined();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- switch (CustomElementDefinitions::checkName(tagName)) {
- case CustomElementDefinitions::NameStatus::Valid:
</del><ins>+ switch (Document::validateCustomElementName(tagName)) {
+ case CustomElementNameValidationStatus::Valid:
</ins><span class="cx"> break;
</span><del>- case CustomElementDefinitions::NameStatus::ConflictsWithBuiltinNames:
</del><ins>+ case CustomElementNameValidationStatus::ConflictsWithBuiltinNames:
</ins><span class="cx"> return throwSyntaxError(&state, "Custom element name cannot be same as one of the builtin elements");
</span><del>- case CustomElementDefinitions::NameStatus::NoHyphen:
</del><ins>+ case CustomElementNameValidationStatus::NoHyphen:
</ins><span class="cx"> return throwSyntaxError(&state, "Custom element name must contain a hyphen");
</span><del>- case CustomElementDefinitions::NameStatus::ContainsUpperCase:
</del><ins>+ case CustomElementNameValidationStatus::ContainsUpperCase:
</ins><span class="cx"> return throwSyntaxError(&state, "Custom element name cannot contain an upper case letter");
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomCustomElementDefinitionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CustomElementDefinitions.cpp (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CustomElementDefinitions.cpp        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/dom/CustomElementDefinitions.cpp        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -39,36 +39,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-CustomElementDefinitions::NameStatus CustomElementDefinitions::checkName(const AtomicString& tagName)
-{
- bool containsHyphen = false;
- for (unsigned i = 0; i < tagName.length(); i++) {
- if (isASCIIUpper(tagName[i]))
- return NameStatus::ContainsUpperCase;
- if (tagName[i] == '-')
- containsHyphen = true;
- }
-
- if (!containsHyphen)
- return NameStatus::NoHyphen;
-
- // FIXME: We should be taking the advantage of QualifiedNames in SVG and MathML.
- if (tagName == SVGNames::color_profileTag.localName()
- || tagName == SVGNames::font_faceTag.localName()
- || tagName == SVGNames::font_face_formatTag.localName()
- || tagName == SVGNames::font_face_nameTag.localName()
- || tagName == SVGNames::font_face_srcTag.localName()
- || tagName == SVGNames::font_face_uriTag.localName()
- || tagName == SVGNames::missing_glyphTag.localName()
-#if ENABLE(MATHML)
- || tagName == MathMLNames::annotation_xmlTag.localName()
-#endif
- )
- return NameStatus::ConflictsWithBuiltinNames;
-
- return NameStatus::Valid;
-}
-
</del><span class="cx"> void CustomElementDefinitions::addElementDefinition(Ref<JSCustomElementInterface>&& interface)
</span><span class="cx"> {
</span><span class="cx"> AtomicString localName = interface->name().localName();
</span></span></pre></div>
<a id="trunkSourceWebCoredomCustomElementDefinitionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CustomElementDefinitions.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CustomElementDefinitions.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/dom/CustomElementDefinitions.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -56,9 +56,6 @@
</span><span class="cx"> JSCustomElementInterface* findInterface(const JSC::JSObject*) const;
</span><span class="cx"> bool containsConstructor(const JSC::JSObject*) const;
</span><span class="cx">
</span><del>- enum class NameStatus { Valid, ConflictsWithBuiltinNames, NoHyphen, ContainsUpperCase };
- static NameStatus checkName(const AtomicString& tagName);
-
</del><span class="cx"> private:
</span><span class="cx"> HashMap<AtomicString, Vector<RefPtr<Element>>> m_upgradeCandidatesMap;
</span><span class="cx"> HashMap<AtomicString, RefPtr<JSCustomElementInterface>> m_nameMap;
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -889,7 +889,7 @@
</span><span class="cx"> QualifiedName qualifiedName(nullAtom, localName, xhtmlNamespaceURI);
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CUSTOM_ELEMENTS)
</span><del>- if (CustomElementDefinitions::checkName(localName) == CustomElementDefinitions::NameStatus::Valid) {
</del><ins>+ if (Document::validateCustomElementName(localName) == CustomElementNameValidationStatus::Valid) {
</ins><span class="cx"> Ref<HTMLElement> element = HTMLElement::create(qualifiedName, document);
</span><span class="cx"> element->setIsUnresolvedCustomElement();
</span><span class="cx"> document.ensureCustomElementDefinitions().addUpgradeCandidate(element.get());
</span><span class="lines">@@ -1074,7 +1074,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> // FIXME: Should we also check the equality of prefix between the custom element and name?
</span><del>- if (CustomElementDefinitions::checkName(name.localName()) == CustomElementDefinitions::NameStatus::Valid) {
</del><ins>+ if (Document::validateCustomElementName(name.localName()) == CustomElementNameValidationStatus::Valid) {
</ins><span class="cx"> Ref<HTMLElement> element = HTMLElement::create(name, document);
</span><span class="cx"> element->setIsUnresolvedCustomElement();
</span><span class="cx"> document.ensureCustomElementDefinitions().addUpgradeCandidate(element.get());
</span><span class="lines">@@ -1112,6 +1112,40 @@
</span><span class="cx"> return element.releaseNonNull();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(CUSTOM_ELEMENTS) || ENABLE(SHADOW_DOM)
+CustomElementNameValidationStatus Document::validateCustomElementName(const AtomicString& localName)
+{
+ bool containsHyphen = false;
+ for (auto character : StringView(localName).codeUnits()) {
+ if (isASCIIUpper(character))
+ return CustomElementNameValidationStatus::ContainsUpperCase;
+ if (character == '-')
+ containsHyphen = true;
+ }
+
+ if (!containsHyphen)
+ return CustomElementNameValidationStatus::NoHyphen;
+
+#if ENABLE(MATHML)
+ const auto& annotationXmlLocalName = MathMLNames::annotation_xmlTag.localName();
+#else
+ static NeverDestroyed<const AtomicString> annotationXmlLocalName(ASCIILiteral("annotation-xml"));
+#endif
+
+ if (localName == SVGNames::color_profileTag.localName()
+ || localName == SVGNames::font_faceTag.localName()
+ || localName == SVGNames::font_face_formatTag.localName()
+ || localName == SVGNames::font_face_nameTag.localName()
+ || localName == SVGNames::font_face_srcTag.localName()
+ || localName == SVGNames::font_face_uriTag.localName()
+ || localName == SVGNames::missing_glyphTag.localName()
+ || localName == annotationXmlLocalName)
+ return CustomElementNameValidationStatus::ConflictsWithBuiltinNames;
+
+ return CustomElementNameValidationStatus::Valid;
+}
+#endif
+
</ins><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx"> bool Document::isCSSGridLayoutEnabled() const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/dom/Document.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -281,6 +281,8 @@
</span><span class="cx"> DisabledByContentDispositionAttachmentSandbox
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+enum class CustomElementNameValidationStatus { Valid, ConflictsWithBuiltinNames, NoHyphen, ContainsUpperCase };
+
</ins><span class="cx"> class Document
</span><span class="cx"> : public ContainerNode
</span><span class="cx"> , public TreeScope
</span><span class="lines">@@ -387,6 +389,10 @@
</span><span class="cx"> WEBCORE_EXPORT RefPtr<Element> createElementNS(const String& namespaceURI, const String& qualifiedName, ExceptionCode&);
</span><span class="cx"> WEBCORE_EXPORT Ref<Element> createElement(const QualifiedName&, bool createdByParser);
</span><span class="cx">
</span><ins>+#if ENABLE(CUSTOM_ELEMENTS) || ENABLE(SHADOW_DOM)
+ static CustomElementNameValidationStatus validateCustomElementName(const AtomicString&);
+#endif
+
</ins><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx"> bool isCSSGridLayoutEnabled() const;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/dom/Element.cpp        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -1685,14 +1685,46 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool Element::canHaveUserAgentShadowRoot() const
</del><ins>+#if ENABLE(SHADOW_DOM)
+static bool canAttachAuthorShadowRoot(const Element& element)
</ins><span class="cx"> {
</span><del>- return false;
</del><ins>+ 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()
+ };
+
+ HashSet<AtomicString> set;
+ for (auto& name : tagList)
+ set.add(name);
+ return set;
+ }();
+
+ if (!is<HTMLElement>(element))
+ return false;
+
+ const auto& localName = element.localName();
+ return tagNames.get().contains(localName) || Document::validateCustomElementName(localName) == CustomElementNameValidationStatus::Valid;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<ShadowRoot> Element::attachShadow(const ShadowRootInit& init, ExceptionCode& ec)
</span><span class="cx"> {
</span><del>- if (canHaveUserAgentShadowRoot()) {
</del><ins>+ if (!canAttachAuthorShadowRoot(*this)) {
</ins><span class="cx"> ec = NOT_SUPPORTED_ERR;
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -1719,6 +1751,7 @@
</span><span class="cx"> }
</span><span class="cx"> return root;
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx">
</span><span class="cx"> ShadowRoot* Element::userAgentShadowRoot() const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/dom/Element.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -254,8 +254,10 @@
</span><span class="cx"> ShadowRootMode mode;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+#if ENABLE(SHADOW_DOM)
</ins><span class="cx"> ShadowRoot* shadowRootForBindings(JSC::ExecState&) const;
</span><span class="cx"> RefPtr<ShadowRoot> attachShadow(const ShadowRootInit&, ExceptionCode&);
</span><ins>+#endif
</ins><span class="cx">
</span><span class="cx"> ShadowRoot* userAgentShadowRoot() const;
</span><span class="cx"> WEBCORE_EXPORT ShadowRoot& ensureUserAgentShadowRoot();
</span><span class="lines">@@ -594,7 +596,6 @@
</span><span class="cx"> Ref<Node> cloneNodeInternal(Document&, CloningOperation) override;
</span><span class="cx"> virtual Ref<Element> cloneElementWithoutAttributesAndChildren(Document&);
</span><span class="cx">
</span><del>- virtual bool canHaveUserAgentShadowRoot() const;
</del><span class="cx"> void removeShadowRoot();
</span><span class="cx">
</span><span class="cx"> const RenderStyle* existingComputedStyle();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLButtonElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLButtonElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLButtonElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLButtonElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -52,7 +52,6 @@
</span><span class="cx">
</span><span class="cx"> // HTMLFormControlElement always creates one, but buttons don't need it.
</span><span class="cx"> bool alwaysCreateUserAgentShadowRoot() const override { return false; }
</span><del>- bool canHaveUserAgentShadowRoot() const final { return true; }
</del><span class="cx">
</span><span class="cx"> void parseAttribute(const QualifiedName&, const AtomicString&) override;
</span><span class="cx"> bool isPresentationAttribute(const QualifiedName&) const override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLDetailsElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLDetailsElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLDetailsElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLDetailsElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> void parseAttribute(const QualifiedName&, const AtomicString&) override;
</span><span class="cx">
</span><span class="cx"> void didAddUserAgentShadowRoot(ShadowRoot*) override;
</span><del>- bool canHaveUserAgentShadowRoot() const final { return true; }
</del><span class="cx"> bool hasCustomFocusLogic() const final { return true; }
</span><span class="cx">
</span><span class="cx"> bool m_isOpen { false };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLInputElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -333,7 +333,6 @@
</span><span class="cx"> enum AutoCompleteSetting { Uninitialized, On, Off };
</span><span class="cx">
</span><span class="cx"> void didAddUserAgentShadowRoot(ShadowRoot*) final;
</span><del>- bool canHaveUserAgentShadowRoot() const final { return true; }
</del><span class="cx">
</span><span class="cx"> void willChangeForm() final;
</span><span class="cx"> void didChangeForm() final;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLKeygenElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLKeygenElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLKeygenElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLKeygenElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -55,8 +55,6 @@
</span><span class="cx"> void reset() override;
</span><span class="cx"> bool shouldSaveAndRestoreFormControlState() const override;
</span><span class="cx">
</span><del>- bool canHaveUserAgentShadowRoot() const final { return true; }
-
</del><span class="cx"> bool isKeytypeRSA() const;
</span><span class="cx">
</span><span class="cx"> HTMLSelectElement* shadowSelect() const;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMarqueeElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMarqueeElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMarqueeElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLMarqueeElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -62,8 +62,6 @@
</span><span class="cx"> void resume() override;
</span><span class="cx"> const char* activeDOMObjectName() const override { return "HTMLMarqueeElement"; }
</span><span class="cx">
</span><del>- bool canHaveUserAgentShadowRoot() const final { return true; }
-
</del><span class="cx"> RenderMarquee* renderMarquee() const;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -504,9 +504,6 @@
</span><span class="cx">
</span><span class="cx"> bool alwaysCreateUserAgentShadowRoot() const override { return true; }
</span><span class="cx">
</span><del>- // FIXME: Shadow DOM spec says we should be able to create shadow root on audio and video elements
- bool canHaveUserAgentShadowRoot() const final { return true; }
-
</del><span class="cx"> bool supportsFocus() const override;
</span><span class="cx"> bool isMouseFocusable() const override;
</span><span class="cx"> bool rendererIsNeeded(const RenderStyle&) override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMeterElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMeterElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMeterElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLMeterElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -76,7 +76,6 @@
</span><span class="cx">
</span><span class="cx"> void didElementStateChange();
</span><span class="cx"> void didAddUserAgentShadowRoot(ShadowRoot*) override;
</span><del>- bool canHaveUserAgentShadowRoot() const final { return true; }
</del><span class="cx">
</span><span class="cx"> RefPtr<MeterValueElement> m_value;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLPlugInElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -117,9 +117,6 @@
</span><span class="cx">
</span><span class="cx"> bool dispatchBeforeLoadEvent(const String& sourceURL); // Not implemented, generates a compile error if subclasses call this by mistake.
</span><span class="cx">
</span><del>- // FIXME: Shadow DOM spec says we should be able to create shadow root on applet, embed, and object.
- bool canHaveUserAgentShadowRoot() const final { return true; }
-
</del><span class="cx"> // This will load the plugin if necessary.
</span><span class="cx"> virtual RenderWidget* renderWidgetLoadingPlugin() const = 0;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLProgressElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLProgressElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLProgressElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLProgressElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -62,7 +62,6 @@
</span><span class="cx">
</span><span class="cx"> void didElementStateChange();
</span><span class="cx"> void didAddUserAgentShadowRoot(ShadowRoot*) override;
</span><del>- bool canHaveUserAgentShadowRoot() const final { return true; }
</del><span class="cx"> bool isDeterminate() const;
</span><span class="cx">
</span><span class="cx"> ProgressValueElement* m_value;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLQuoteElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLQuoteElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLQuoteElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLQuoteElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> HTMLQuoteElement(const QualifiedName&, Document&);
</span><del>-
</del><ins>+
</ins><span class="cx"> bool isURLAttribute(const Attribute&) const override;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLSelectElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLSelectElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLSelectElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLSelectElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -119,8 +119,6 @@
</span><span class="cx">
</span><span class="cx"> bool canStartSelection() const final { return false; }
</span><span class="cx">
</span><del>- bool canHaveUserAgentShadowRoot() const final { return true; }
-
</del><span class="cx"> bool isEnumeratable() const final { return true; }
</span><span class="cx"> bool supportLabels() const final { return true; }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLSummaryElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLSummaryElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLSummaryElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLSummaryElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -42,8 +42,6 @@
</span><span class="cx">
</span><span class="cx"> void didAddUserAgentShadowRoot(ShadowRoot*) override;
</span><span class="cx">
</span><del>- // FIXME: Shadow DOM spec says we should be able to create shadow root on this element
- bool canHaveUserAgentShadowRoot() const final { return true; }
</del><span class="cx"> bool hasCustomFocusLogic() const final { return true; }
</span><span class="cx">
</span><span class="cx"> HTMLDetailsElement* detailsElement() const;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTagNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTagNames.in (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTagNames.in        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLTagNames.in        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> col interfaceName=HTMLTableColElement
</span><span class="cx"> colgroup interfaceName=HTMLTableColElement
</span><span class="cx"> command interfaceName=HTMLElement
</span><del>-webkitShadowContent interfaceName=HTMLElement, noConstructor
</del><span class="cx"> data
</span><span class="cx"> datalist interfaceName=HTMLDataListElement, conditional=DATALIST_ELEMENT
</span><span class="cx"> dd interfaceName=HTMLElement
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -71,7 +71,6 @@
</span><span class="cx"> enum WrapMethod { NoWrap, SoftWrap, HardWrap };
</span><span class="cx">
</span><span class="cx"> void didAddUserAgentShadowRoot(ShadowRoot*) override;
</span><del>- bool canHaveUserAgentShadowRoot() const final { return true; }
</del><span class="cx">
</span><span class="cx"> void maxLengthAttributeChanged(const AtomicString& newValue);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLUnknownElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLUnknownElement.h (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLUnknownElement.h        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/HTMLUnknownElement.h        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -47,12 +47,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if ENABLE(METER_ELEMENT)
- bool canHaveUserAgentShadowRoot() const final { return false; }
-#else
- bool canHaveUserAgentShadowRoot() const final { return localName() == "meter"; }
-#endif
-
</del><span class="cx"> bool isHTMLUnknownElement() const override { return true; }
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLConstructionSitecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp (201738 => 201739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp        2016-06-07 03:24:54 UTC (rev 201738)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp        2016-06-07 04:02:11 UTC (rev 201739)
</span><span class="lines">@@ -673,7 +673,7 @@
</span><span class="cx">
</span><span class="cx"> QualifiedName qualifiedName(nullAtom, localName, xhtmlNamespaceURI);
</span><span class="cx"> #if ENABLE(CUSTOM_ELEMENTS)
</span><del>- if (CustomElementDefinitions::checkName(localName) == CustomElementDefinitions::NameStatus::Valid) {
</del><ins>+ if (Document::validateCustomElementName(localName) == CustomElementNameValidationStatus::Valid) {
</ins><span class="cx"> element = HTMLElement::create(qualifiedName, ownerDocument);
</span><span class="cx"> element->setIsUnresolvedCustomElement();
</span><span class="cx"> ownerDocument.ensureCustomElementDefinitions().addUpgradeCandidate(*element);
</span></span></pre>
</div>
</div>
</body>
</html>