<!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>[206616] trunk/Source/WebCore</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/206616">206616</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-09-29 14:28:45 -0700 (Thu, 29 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix post-landing nits after <a href="http://trac.webkit.org/projects/webkit/changeset/206561">r206561</a>.
https://bugs.webkit.org/show_bug.cgi?id=162659

Reviewed by Alex Christensen.

Uses more StringViews and constness.

* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy):
* dom/SecurityContext.h:
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::DOMTokenList):
(WebCore::DOMTokenList::supports):
* html/DOMTokenList.h:
(WebCore::DOMTokenList::DOMTokenList):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::relList):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::sandbox):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::relList):
* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::isSupported):
* html/LinkRelAttribute.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomSecurityContextcpp">trunk/Source/WebCore/dom/SecurityContext.cpp</a></li>
<li><a href="#trunkSourceWebCoredomSecurityContexth">trunk/Source/WebCore/dom/SecurityContext.h</a></li>
<li><a href="#trunkSourceWebCorehtmlDOMTokenListcpp">trunk/Source/WebCore/html/DOMTokenList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlDOMTokenListh">trunk/Source/WebCore/html/DOMTokenList.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAnchorElementcpp">trunk/Source/WebCore/html/HTMLAnchorElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLIFrameElementcpp">trunk/Source/WebCore/html/HTMLIFrameElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementcpp">trunk/Source/WebCore/html/HTMLLinkElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlLinkRelAttributecpp">trunk/Source/WebCore/html/LinkRelAttribute.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlLinkRelAttributeh">trunk/Source/WebCore/html/LinkRelAttribute.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206615 => 206616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-29 21:25:14 UTC (rev 206615)
+++ trunk/Source/WebCore/ChangeLog        2016-09-29 21:28:45 UTC (rev 206616)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2016-09-29  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Fix post-landing nits after r206561.
+        https://bugs.webkit.org/show_bug.cgi?id=162659
+
+        Reviewed by Alex Christensen.
+
+        Uses more StringViews and constness.
+
+        * dom/SecurityContext.cpp:
+        (WebCore::SecurityContext::isSupportedSandboxPolicy):
+        * dom/SecurityContext.h:
+        * html/DOMTokenList.cpp:
+        (WebCore::DOMTokenList::DOMTokenList):
+        (WebCore::DOMTokenList::supports):
+        * html/DOMTokenList.h:
+        (WebCore::DOMTokenList::DOMTokenList):
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::relList):
+        * html/HTMLIFrameElement.cpp:
+        (WebCore::HTMLIFrameElement::sandbox):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::relList):
+        * html/LinkRelAttribute.cpp:
+        (WebCore::LinkRelAttribute::isSupported):
+        * html/LinkRelAttribute.h:
+
</ins><span class="cx"> 2016-09-29  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         URLParser should correctly parse ports with leading 0's
</span></span></pre></div>
<a id="trunkSourceWebCoredomSecurityContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/SecurityContext.cpp (206615 => 206616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/SecurityContext.cpp        2016-09-29 21:25:14 UTC (rev 206615)
+++ trunk/Source/WebCore/dom/SecurityContext.cpp        2016-09-29 21:28:45 UTC (rev 206616)
</span><span class="lines">@@ -85,9 +85,9 @@
</span><span class="cx">         setSecurityOriginPolicy(SecurityOriginPolicy::create(SecurityOrigin::createUnique()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SecurityContext::isSupportedSandboxPolicy(const String&amp; policy)
</del><ins>+bool SecurityContext::isSupportedSandboxPolicy(StringView policy)
</ins><span class="cx"> {
</span><del>-    static const char* supportedPolicies[] = {
</del><ins>+    static const char* const supportedPolicies[] = {
</ins><span class="cx">         &quot;allow-forms&quot;, &quot;allow-same-origin&quot;, &quot;allow-scripts&quot;, &quot;allow-top-navigation&quot;, &quot;allow-pointer-lock&quot;, &quot;allow-popups&quot;
</span><span class="cx">     };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomSecurityContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/SecurityContext.h (206615 => 206616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/SecurityContext.h        2016-09-29 21:25:14 UTC (rev 206615)
+++ trunk/Source/WebCore/dom/SecurityContext.h        2016-09-29 21:28:45 UTC (rev 206616)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     WEBCORE_EXPORT SecurityOrigin* securityOrigin() const;
</span><span class="cx"> 
</span><span class="cx">     static SandboxFlags parseSandboxPolicy(const String&amp; policy, String&amp; invalidTokensErrorMessage);
</span><del>-    static bool isSupportedSandboxPolicy(const String&amp;);
</del><ins>+    static bool isSupportedSandboxPolicy(StringView);
</ins><span class="cx"> 
</span><span class="cx">     bool foundMixedContent() const { return m_foundMixedContent; }
</span><span class="cx">     void setFoundMixedContent() { m_foundMixedContent = true; }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlDOMTokenListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/DOMTokenList.cpp (206615 => 206616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/DOMTokenList.cpp        2016-09-29 21:25:14 UTC (rev 206615)
+++ trunk/Source/WebCore/html/DOMTokenList.cpp        2016-09-29 21:28:45 UTC (rev 206616)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-DOMTokenList::DOMTokenList(Element&amp; element, const QualifiedName&amp; attributeName, WTF::Function&lt;bool(const String&amp;)&gt;&amp;&amp; isSupportedToken)
</del><ins>+DOMTokenList::DOMTokenList(Element&amp; element, const QualifiedName&amp; attributeName, WTF::Function&lt;bool(StringView)&gt;&amp;&amp; isSupportedToken)
</ins><span class="cx">     : m_element(element)
</span><span class="cx">     , m_attributeName(attributeName)
</span><span class="cx">     , m_isSupportedToken(WTFMove(isSupportedToken))
</span><span class="lines">@@ -179,7 +179,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // https://dom.spec.whatwg.org/#concept-domtokenlist-validation
</span><del>-bool DOMTokenList::supports(const String&amp; token, ExceptionCode&amp; ec)
</del><ins>+bool DOMTokenList::supports(StringView token, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_isSupportedToken) {
</span><span class="cx">         ec = TypeError;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlDOMTokenListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/DOMTokenList.h (206615 => 206616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/DOMTokenList.h        2016-09-29 21:25:14 UTC (rev 206615)
+++ trunk/Source/WebCore/html/DOMTokenList.h        2016-09-29 21:28:45 UTC (rev 206616)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> class DOMTokenList {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(DOMTokenList); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    DOMTokenList(Element&amp;, const QualifiedName&amp; attributeName, WTF::Function&lt;bool(const String&amp;)&gt;&amp;&amp; isSupportedToken = { });
</del><ins>+    DOMTokenList(Element&amp;, const QualifiedName&amp; attributeName, WTF::Function&lt;bool(StringView)&gt;&amp;&amp; isSupportedToken = { });
</ins><span class="cx"> 
</span><span class="cx">     void associatedAttributeValueChanged(const AtomicString&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">     void remove(const AtomicString&amp;, ExceptionCode&amp;);
</span><span class="cx">     WEBCORE_EXPORT bool toggle(const AtomicString&amp;, Optional&lt;bool&gt; force, ExceptionCode&amp;);
</span><span class="cx">     void replace(const AtomicString&amp; token, const AtomicString&amp; newToken, ExceptionCode&amp;);
</span><del>-    bool supports(const String&amp; token, ExceptionCode&amp;);
</del><ins>+    bool supports(StringView token, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><span class="cx">     Element&amp; element() const { return m_element; }
</span><span class="cx"> 
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">     bool m_inUpdateAssociatedAttributeFromTokens { false };
</span><span class="cx">     bool m_tokensNeedUpdating { true };
</span><span class="cx">     Vector&lt;AtomicString&gt; m_tokens;
</span><del>-    WTF::Function&lt;bool(const String&amp;)&gt; m_isSupportedToken;
</del><ins>+    WTF::Function&lt;bool(StringView)&gt; m_isSupportedToken;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline unsigned DOMTokenList::length() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (206615 => 206616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp        2016-09-29 21:25:14 UTC (rev 206615)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp        2016-09-29 21:28:45 UTC (rev 206616)
</span><span class="lines">@@ -303,7 +303,7 @@
</span><span class="cx"> DOMTokenList&amp; HTMLAnchorElement::relList()
</span><span class="cx"> {
</span><span class="cx">     if (!m_relList) 
</span><del>-        m_relList = std::make_unique&lt;DOMTokenList&gt;(*this, HTMLNames::relAttr, [](const String&amp; token) {
</del><ins>+        m_relList = std::make_unique&lt;DOMTokenList&gt;(*this, HTMLNames::relAttr, [](StringView token) {
</ins><span class="cx">             return equalIgnoringASCIICase(token, &quot;noreferrer&quot;);
</span><span class="cx">         });
</span><span class="cx">     return *m_relList;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLIFrameElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLIFrameElement.cpp (206615 => 206616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLIFrameElement.cpp        2016-09-29 21:25:14 UTC (rev 206615)
+++ trunk/Source/WebCore/html/HTMLIFrameElement.cpp        2016-09-29 21:28:45 UTC (rev 206616)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> DOMTokenList&amp; HTMLIFrameElement::sandbox()
</span><span class="cx"> {
</span><span class="cx">     if (!m_sandbox)
</span><del>-        m_sandbox = std::make_unique&lt;DOMTokenList&gt;(*this, sandboxAttr, [](const String&amp; token) {
</del><ins>+        m_sandbox = std::make_unique&lt;DOMTokenList&gt;(*this, sandboxAttr, [](StringView token) {
</ins><span class="cx">             return SecurityContext::isSupportedSandboxPolicy(token);
</span><span class="cx">         });
</span><span class="cx">     return *m_sandbox;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (206615 => 206616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp        2016-09-29 21:25:14 UTC (rev 206615)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp        2016-09-29 21:28:45 UTC (rev 206616)
</span><span class="lines">@@ -444,7 +444,7 @@
</span><span class="cx"> DOMTokenList&amp; HTMLLinkElement::relList()
</span><span class="cx"> {
</span><span class="cx">     if (!m_relList) 
</span><del>-        m_relList = std::make_unique&lt;DOMTokenList&gt;(*this, HTMLNames::relAttr, [](const String&amp; token) {
</del><ins>+        m_relList = std::make_unique&lt;DOMTokenList&gt;(*this, HTMLNames::relAttr, [](StringView token) {
</ins><span class="cx">             return LinkRelAttribute::isSupported(token);
</span><span class="cx">         });
</span><span class="cx">     return *m_relList;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlLinkRelAttributecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/LinkRelAttribute.cpp (206615 => 206616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/LinkRelAttribute.cpp        2016-09-29 21:25:14 UTC (rev 206615)
+++ trunk/Source/WebCore/html/LinkRelAttribute.cpp        2016-09-29 21:28:45 UTC (rev 206616)
</span><span class="lines">@@ -88,9 +88,9 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // https://html.spec.whatwg.org/#linkTypes
</span><del>-bool LinkRelAttribute::isSupported(const String&amp; attribute)
</del><ins>+bool LinkRelAttribute::isSupported(StringView attribute)
</ins><span class="cx"> {
</span><del>-    static const char* supportedAttributes[] = {
</del><ins>+    static const char* const supportedAttributes[] = {
</ins><span class="cx">         &quot;alternate&quot;, &quot;dns-prefetch&quot;, &quot;icon&quot;, &quot;stylesheet&quot;, &quot;apple-touch-icon&quot;, &quot;apple-touch-icon-precomposed&quot;,
</span><span class="cx"> #if ENABLE(LINK_PREFETCH)
</span><span class="cx">         &quot;prefetch&quot;, &quot;subresource&quot;,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlLinkRelAttributeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/LinkRelAttribute.h (206615 => 206616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/LinkRelAttribute.h        2016-09-29 21:25:14 UTC (rev 206615)
+++ trunk/Source/WebCore/html/LinkRelAttribute.h        2016-09-29 21:28:45 UTC (rev 206616)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">     LinkRelAttribute();
</span><span class="cx">     explicit LinkRelAttribute(const String&amp;);
</span><span class="cx"> 
</span><del>-    static bool isSupported(const String&amp;);
</del><ins>+    static bool isSupported(StringView);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>