<!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>[182351] 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/182351">182351</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2015-04-04 18:01:49 -0700 (Sat, 04 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Streamline icon-related code, mostly unused
https://bugs.webkit.org/show_bug.cgi?id=143306

Reviewed by Antti Koivisto.

Source/WebCore:

I started on this path because Document::iconURLs had a poor implementation,
storing results in a data member with no benefit, using HTMLCollection for
iteration of the children of the head element instead of using the simpler
faster technique we use inside the engine. Then, I discovered this function was
mostly-unused code left over from before the Blink fork. I removed most of it.
We can add this back later if someone finds a use for it, but if we do we
should do a higher quality implementation without the quirks of the old one.

Refactoring also made it clear that logic isn't exactly sensible. There's a
set of rules about what order to return the list in that is not followed by
the code that tries to find the &quot;default touch icon&quot;. Later we could add some
more test coverage and tighten up the logic. But the reality is that at this
time, with some small exceptions, icon logic is in the web browsers, not in WebKit.

* CMakeLists.txt: Removed IconURL.cpp.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* dom/DOMAllInOne.cpp: Ditto.

* dom/Document.cpp:
(WebCore::Document::evaluate): Tweaked formatting.
(WebCore::Document::shortcutIconURLs): Removed. Unused function.
(WebCore::Document::iconURLs): Removed. Moved code to IconController.
(WebCore::Document::addIconURL): Removed. Moved code to LinkLoader.

* dom/Document.h: Removed shortcutIconURLs, iconURLs, addIconURL,
and m_iconURLs.

* dom/IconURL.cpp: Removed.
* dom/IconURL.h: Removed everything from this header except for the
IconType enum. Added a FIXME about possibly renaming the header.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::HTMLLinkElement): Pass a reference when creating
the link loading.
(WebCore::HTMLLinkElement::setDisabledState): Access members of the struct
LinkRelElement without &quot;m_&quot; prefix.
(WebCore::HTMLLinkElement::parseAttribute): Changed to use early return style,
and made the part of this for parsing title use a more normal idiom.
(WebCore::HTMLLinkElement::process): Removed many unneeded arguments, made the
logic of the code a little easier to follow.
(WebCore::HTMLLinkElement::removedFrom): Removed a call to a function that had
an empty body.
(WebCore::HTMLLinkElement::iconType): Updated for change to LinkRelElement.
(WebCore::HTMLLinkElement::addSubresourceAttributeURLs): Ditto.
* html/HTMLLinkElement.h: More of the same.

* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::LinkRelAttribute): Initialize data members in the
struct itself. Got rid of &quot;m_&quot; prefix since this is a struct, not a class.
Changed code to use modern for loop; even better would be to eliminate the
splitting into a vector entirely and use StringView (do that next time).
* html/LinkRelAttribute.h: See above.

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet):
Updated for chnages to LinkRelAttribute and give the local variable a clearer name.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didChangeIcons): Removed.
* loader/FrameLoader.h: Removed didChangeIcons.

* loader/FrameLoaderClient.h: Added include for String since it's no longer
taken care of by IconURLs.h.

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::LinkLoader): Take a reference instead of a pointer.
(WebCore::LinkLoader::linkLoadTimerFired): Use m_client reference instead of pointer.
(WebCore::LinkLoader::linkLoadingErrorTimerFired): Ditto.
(WebCore::LinkLoader::notifyFinished): Use nullptr.
(WebCore::LinkLoader::loadLink): Tweak formatting. Move the dispatchDidChangeIcons
call in here instead of going through Document to FrameLoader and then FrameLoader to
FrameLoaderClient, and passing extra unused arguments, the way the old code did.
Use a reference instead of a pointer for the document.
(WebCore::LinkLoader::released): Removed. Empty function.

* loader/LinkLoader.h: Changed constructor argument to be a reference. Made more
things private. Removed empty released function.

* loader/icon/IconController.cpp:
(WebCore::IconController::IconController): Moved initialization of data members to
the class definition in the header.
(WebCore::iconsFromLinkElements): Added. This function replaces the existing
Document::iconURLs function, but has a simpler implementation and interface.
It focuses on exactly what the code in this file needs. If we want to add some
more features to the icon controller we might make this more complex again.
Even now, building a vector is not necessarily helpful; the only client of this
function ends up extracting only one of the URLs this function returns.
(WebCore::IconController::url): Rewrote this. It's the only function actually
using the icon URLs. This contains a combination of the logic from the various
functions in this class before, including iconURL, urlsForTypes, appendToIconURLs,
and defaultURL. Among other improvements, replaced the unusual code to construct
the icon URL with a call to Document::completeURL.
(WebCore::IconController::startLoader): Refactored a bit to remove a local variable.
(WebCore::IconController::continueLoadWithDecision): Ditto.

* loader/icon/IconController.h: Removed unneeded includes, unneeded use of
WTF_MAKE_NONCOPYABLE (since classes with data members of reference type are
automatically noncopyable), unused fucntions. Also initialize m_waitingForLoadDecision.

* testing/Internals.cpp:
(WebCore::Internals::iconURLs): Removed.
(WebCore::Internals::shortcutIconURLs): Left this in place since it is used by
tests. Changed it to return the actual value from the IconController::url function,
since that's the interface to our icon machinery that is actually exposed on some
platforms. That means this returns only a single URL.
(WebCore::Internals::allIconURLs): Removed.
* testing/Internals.h: Removed allIconURLs and iconURLs.
* testing/Internals.idl: Removed allIconURLs.

LayoutTests:

* fast/dom/icon-url-list-apple-touch-expected.txt: Removed.
* fast/dom/icon-url-list-apple-touch.html: Removed. This tested code that was
not actually used in any WebKit port.

* fast/dom/icon-url-list.html: Updated to expect only a single icon URL;
the icon machinery in WebKit doesn't return arrays at this time. It's better to
test what we actually expose.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomiconurllisthtml">trunk/LayoutTests/fast/dom/icon-url-list.html</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomDOMAllInOnecpp">trunk/Source/WebCore/dom/DOMAllInOne.cpp</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="#trunkSourceWebCoredomIconURLh">trunk/Source/WebCore/dom/IconURL.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementcpp">trunk/Source/WebCore/html/HTMLLinkElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementh">trunk/Source/WebCore/html/HTMLLinkElement.h</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>
<li><a href="#trunkSourceWebCorehtmlparserHTMLPreloadScannercpp">trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderh">trunk/Source/WebCore/loader/FrameLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderClienth">trunk/Source/WebCore/loader/FrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebCoreloaderLinkLoadercpp">trunk/Source/WebCore/loader/LinkLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderLinkLoaderh">trunk/Source/WebCore/loader/LinkLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloadericonIconControllercpp">trunk/Source/WebCore/loader/icon/IconController.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadericonIconControllerh">trunk/Source/WebCore/loader/icon/IconController.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomiconurllistappletouchexpectedtxt">trunk/LayoutTests/fast/dom/icon-url-list-apple-touch-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomiconurllistappletouchhtml">trunk/LayoutTests/fast/dom/icon-url-list-apple-touch.html</a></li>
<li><a href="#trunkSourceWebCoredomIconURLcpp">trunk/Source/WebCore/dom/IconURL.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/LayoutTests/ChangeLog        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-04-02  Darin Adler  &lt;darin@apple.com&gt;
+
+        Streamline icon-related code, mostly unused
+        https://bugs.webkit.org/show_bug.cgi?id=143306
+
+        Reviewed by Antti Koivisto.
+
+        * fast/dom/icon-url-list-apple-touch-expected.txt: Removed.
+        * fast/dom/icon-url-list-apple-touch.html: Removed. This tested code that was
+        not actually used in any WebKit port.
+
+        * fast/dom/icon-url-list.html: Updated to expect only a single icon URL;
+        the icon machinery in WebKit doesn't return arrays at this time. It's better to
+        test what we actually expose.
+
</ins><span class="cx"> 2015-04-04  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Crash under Document::absoluteRegionForEventTargets on build.webkit.org/dashboard
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomiconurllistappletouchexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/icon-url-list-apple-touch-expected.txt (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/icon-url-list-apple-touch-expected.txt        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/LayoutTests/fast/dom/icon-url-list-apple-touch-expected.txt        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -1,3 +0,0 @@
</span><del>-Tests that all favicons and touch icons (if ENABLE(TOUCH_ICON_LOADING)) are in document.iconURLs()
-http://test.com/oldfavicon.ico
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastdomiconurllistappletouchhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/icon-url-list-apple-touch.html (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/icon-url-list-apple-touch.html        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/LayoutTests/fast/dom/icon-url-list-apple-touch.html        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-&lt;html&gt;
-&lt;head&gt;
-&lt;title&gt;Original Title&lt;/title&gt;
-&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/x-icon&quot; href=&quot;http://test.com/oldfavicon.ico&quot;/&gt;
-&lt;link rel=&quot;apple-touch-icon&quot; type=&quot;image/png&quot; href=&quot;http://test.com/i/touch.png&quot;/&gt;
-&lt;link rel=&quot;apple-touch-icon-precomposed&quot; type=&quot;image/png&quot; href=&quot;http://test.com/i/touch-precomposed.png&quot;/&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script&gt;
-function runTests() {
-    if (window.testRunner)
-        testRunner.dumpAsText();
-
-    debug('Tests that all favicons and touch icons (if ENABLE(TOUCH_ICON_LOADING)) are in document.iconURLs()');
-
-    // Fetch the actual list of icon URLs.
-    var actualURLs = window.internals.allIconURLs();
-
-    // Print out the URL list in the document to match it against the expected list.
-    // Note that the expected order is reverse to ensure that icons seen later
-    // take precedence as required by the spec.
-    for (var i = 0; i &lt; actualURLs.length; i++)
-        debug(actualURLs[i]);
-}
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body onload='runTests();'&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsfastdomiconurllisthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/icon-url-list.html (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/icon-url-list.html        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/LayoutTests/fast/dom/icon-url-list.html        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -49,10 +49,13 @@
</span><span class="cx">     var expectedURL1 = &quot;http://test.com/foofavicon.ico&quot;;
</span><span class="cx">     var expectedURL2 = &quot;http://test.com/newfavicon.ico&quot;;
</span><span class="cx">     var iconURLs = window.internals.shortcutIconURLs();
</span><del>-    if (expectedURL0 == iconURLs[0] &amp;&amp; expectedURL1 == iconURLs[1] &amp;&amp; expectedURL2 == iconURLs[2]) 
</del><ins>+    // Expect the array to contain only the last URL because that's what WebKit icon controller provides,
+    // despite the fact that the internals API returns it as an array. We can change this to check for
+    // all three if we add &quot;array of icon URLs&quot; support to WebKit.
+    if (iconURLs.length === 1 &amp;&amp; expectedURL2 === iconURLs[0])
</ins><span class="cx">         testPassed('URL list matches expected');
</span><span class="cx">     else
</span><del>-        testFailed('URL list does not match expected');
</del><ins>+        testFailed('URL list does not match expected: length = ' + iconURLs.length + ', URL=' + iconURLs[0]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -1385,7 +1385,6 @@
</span><span class="cx">     dom/ExceptionCodePlaceholder.cpp
</span><span class="cx">     dom/FocusEvent.cpp
</span><span class="cx">     dom/GenericEventQueue.cpp
</span><del>-    dom/IconURL.cpp
</del><span class="cx">     dom/IdTargetObserver.cpp
</span><span class="cx">     dom/IdTargetObserverRegistry.cpp
</span><span class="cx">     dom/InlineStyleSheetOwner.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/ChangeLog        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -1,3 +1,121 @@
</span><ins>+2015-04-02  Darin Adler  &lt;darin@apple.com&gt;
+
+        Streamline icon-related code, mostly unused
+        https://bugs.webkit.org/show_bug.cgi?id=143306
+
+        Reviewed by Antti Koivisto.
+
+        I started on this path because Document::iconURLs had a poor implementation,
+        storing results in a data member with no benefit, using HTMLCollection for
+        iteration of the children of the head element instead of using the simpler
+        faster technique we use inside the engine. Then, I discovered this function was
+        mostly-unused code left over from before the Blink fork. I removed most of it.
+        We can add this back later if someone finds a use for it, but if we do we
+        should do a higher quality implementation without the quirks of the old one.
+
+        Refactoring also made it clear that logic isn't exactly sensible. There's a
+        set of rules about what order to return the list in that is not followed by
+        the code that tries to find the &quot;default touch icon&quot;. Later we could add some
+        more test coverage and tighten up the logic. But the reality is that at this
+        time, with some small exceptions, icon logic is in the web browsers, not in WebKit.
+
+        * CMakeLists.txt: Removed IconURL.cpp.
+        * WebCore.vcxproj/WebCore.vcxproj: Ditto.
+        * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+        * dom/DOMAllInOne.cpp: Ditto.
+
+        * dom/Document.cpp:
+        (WebCore::Document::evaluate): Tweaked formatting.
+        (WebCore::Document::shortcutIconURLs): Removed. Unused function.
+        (WebCore::Document::iconURLs): Removed. Moved code to IconController.
+        (WebCore::Document::addIconURL): Removed. Moved code to LinkLoader.
+
+        * dom/Document.h: Removed shortcutIconURLs, iconURLs, addIconURL,
+        and m_iconURLs.
+
+        * dom/IconURL.cpp: Removed.
+        * dom/IconURL.h: Removed everything from this header except for the
+        IconType enum. Added a FIXME about possibly renaming the header.
+
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::HTMLLinkElement): Pass a reference when creating
+        the link loading.
+        (WebCore::HTMLLinkElement::setDisabledState): Access members of the struct
+        LinkRelElement without &quot;m_&quot; prefix.
+        (WebCore::HTMLLinkElement::parseAttribute): Changed to use early return style,
+        and made the part of this for parsing title use a more normal idiom.
+        (WebCore::HTMLLinkElement::process): Removed many unneeded arguments, made the
+        logic of the code a little easier to follow.
+        (WebCore::HTMLLinkElement::removedFrom): Removed a call to a function that had
+        an empty body.
+        (WebCore::HTMLLinkElement::iconType): Updated for change to LinkRelElement.
+        (WebCore::HTMLLinkElement::addSubresourceAttributeURLs): Ditto.
+        * html/HTMLLinkElement.h: More of the same.
+
+        * html/LinkRelAttribute.cpp:
+        (WebCore::LinkRelAttribute::LinkRelAttribute): Initialize data members in the
+        struct itself. Got rid of &quot;m_&quot; prefix since this is a struct, not a class.
+        Changed code to use modern for loop; even better would be to eliminate the
+        splitting into a vector entirely and use StringView (do that next time).
+        * html/LinkRelAttribute.h: See above.
+
+        * html/parser/HTMLPreloadScanner.cpp:
+        (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet):
+        Updated for chnages to LinkRelAttribute and give the local variable a clearer name.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::didChangeIcons): Removed.
+        * loader/FrameLoader.h: Removed didChangeIcons.
+
+        * loader/FrameLoaderClient.h: Added include for String since it's no longer
+        taken care of by IconURLs.h.
+
+        * loader/LinkLoader.cpp:
+        (WebCore::LinkLoader::LinkLoader): Take a reference instead of a pointer.
+        (WebCore::LinkLoader::linkLoadTimerFired): Use m_client reference instead of pointer.
+        (WebCore::LinkLoader::linkLoadingErrorTimerFired): Ditto.
+        (WebCore::LinkLoader::notifyFinished): Use nullptr.
+        (WebCore::LinkLoader::loadLink): Tweak formatting. Move the dispatchDidChangeIcons
+        call in here instead of going through Document to FrameLoader and then FrameLoader to
+        FrameLoaderClient, and passing extra unused arguments, the way the old code did.
+        Use a reference instead of a pointer for the document.
+        (WebCore::LinkLoader::released): Removed. Empty function.
+
+        * loader/LinkLoader.h: Changed constructor argument to be a reference. Made more
+        things private. Removed empty released function.
+
+        * loader/icon/IconController.cpp:
+        (WebCore::IconController::IconController): Moved initialization of data members to
+        the class definition in the header.
+        (WebCore::iconsFromLinkElements): Added. This function replaces the existing
+        Document::iconURLs function, but has a simpler implementation and interface.
+        It focuses on exactly what the code in this file needs. If we want to add some
+        more features to the icon controller we might make this more complex again.
+        Even now, building a vector is not necessarily helpful; the only client of this
+        function ends up extracting only one of the URLs this function returns.
+        (WebCore::IconController::url): Rewrote this. It's the only function actually
+        using the icon URLs. This contains a combination of the logic from the various
+        functions in this class before, including iconURL, urlsForTypes, appendToIconURLs,
+        and defaultURL. Among other improvements, replaced the unusual code to construct
+        the icon URL with a call to Document::completeURL.
+        (WebCore::IconController::startLoader): Refactored a bit to remove a local variable.
+        (WebCore::IconController::continueLoadWithDecision): Ditto.
+
+        * loader/icon/IconController.h: Removed unneeded includes, unneeded use of
+        WTF_MAKE_NONCOPYABLE (since classes with data members of reference type are
+        automatically noncopyable), unused fucntions. Also initialize m_waitingForLoadDecision.
+
+        * testing/Internals.cpp:
+        (WebCore::Internals::iconURLs): Removed.
+        (WebCore::Internals::shortcutIconURLs): Left this in place since it is used by
+        tests. Changed it to return the actual value from the IconController::url function,
+        since that's the interface to our icon machinery that is actually exposed on some
+        platforms. That means this returns only a single URL.
+        (WebCore::Internals::allIconURLs): Removed.
+        * testing/Internals.h: Removed allIconURLs and iconURLs.
+        * testing/Internals.idl: Removed allIconURLs.
+
</ins><span class="cx"> 2015-04-04  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix EFL and Gtk build.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -13408,20 +13408,6 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dom\GenericEventQueue.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\dom\IconURL.cpp&quot;&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\dom\IdTargetObserver.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -3180,9 +3180,6 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dom\GenericEventQueue.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;dom&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\dom\IconURL.cpp&quot;&gt;
-      &lt;Filter&gt;dom&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\dom\IdTargetObserver.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;dom&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -1633,7 +1633,6 @@
</span><span class="cx">                 44DEF6431A6FF92700D45EEC /* IOReturnSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 44DEF6421A6FF92700D45EEC /* IOReturnSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 44DFF6431A6FF92700D45EEC /* IOSurfaceSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 44DFF6421A6FF92700D45EEC /* IOSurfaceSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 44EFF6431A6FF92700D45EEC /* IOTypesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 44EFF6421A6FF92700D45EEC /* IOTypesSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                45099C411370A7800058D513 /* IconURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45099C401370A7800058D513 /* IconURL.cpp */; };
</del><span class="cx">                 450CEBF015073BBE002BB149 /* LabelableElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 450CEBEE15073BBE002BB149 /* LabelableElement.cpp */; };
</span><span class="cx">                 450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 450CEBEF15073BBE002BB149 /* LabelableElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 4512502215DCE37D002F84E2 /* SpinButtonElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4512502015DCE37D002F84E2 /* SpinButtonElement.cpp */; };
</span><span class="lines">@@ -8791,7 +8790,6 @@
</span><span class="cx">                 44DEF6421A6FF92700D45EEC /* IOReturnSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOReturnSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 44DFF6421A6FF92700D45EEC /* IOSurfaceSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSurfaceSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 44EFF6421A6FF92700D45EEC /* IOTypesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOTypesSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                45099C401370A7800058D513 /* IconURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IconURL.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 450CEBEE15073BBE002BB149 /* LabelableElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LabelableElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 450CEBEF15073BBE002BB149 /* LabelableElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelableElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4512502015DCE37D002F84E2 /* SpinButtonElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpinButtonElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -23030,7 +23028,6 @@
</span><span class="cx">                                 0720B09F14D3323500642955 /* GenericEventQueue.h */,
</span><span class="cx">                                 2442BBF81194C9D300D49469 /* HashChangeEvent.h */,
</span><span class="cx">                                 8482B7441198C32E00BFB005 /* HashChangeEvent.idl */,
</span><del>-                                45099C401370A7800058D513 /* IconURL.cpp */,
</del><span class="cx">                                 45BAC2AF1360BBAB005DA258 /* IconURL.h */,
</span><span class="cx">                                 C3CF17A015B0063F00276D39 /* IdTargetObserver.cpp */,
</span><span class="cx">                                 C3CF17A115B0063F00276D39 /* IdTargetObserver.h */,
</span><span class="lines">@@ -28381,7 +28378,6 @@
</span><span class="cx">                                 513F14530AB634C400094DDF /* IconLoader.cpp in Sources */,
</span><span class="cx">                                 B275358E0B053A66002CE64F /* IconMac.mm in Sources */,
</span><span class="cx">                                 51E1ECC00C91C90400DC255B /* IconRecord.cpp in Sources */,
</span><del>-                                45099C411370A7800058D513 /* IconURL.cpp in Sources */,
</del><span class="cx">                                 51D719B9181106E00016DC51 /* IDBAny.cpp in Sources */,
</span><span class="cx">                                 C585A66211D4FAC5004C3E4B /* IDBBindingUtilities.cpp in Sources */,
</span><span class="cx">                                 51D719BF181106E00016DC51 /* IDBCursor.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMAllInOne.cpp (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMAllInOne.cpp        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/dom/DOMAllInOne.cpp        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -81,7 +81,6 @@
</span><span class="cx"> #include &quot;ExceptionBase.cpp&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.cpp&quot;
</span><span class="cx"> #include &quot;FocusEvent.cpp&quot;
</span><del>-#include &quot;IconURL.cpp&quot;
</del><span class="cx"> #include &quot;IdTargetObserver.cpp&quot;
</span><span class="cx"> #include &quot;IdTargetObserverRegistry.cpp&quot;
</span><span class="cx"> #include &quot;InlineStyleSheetOwner.cpp&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/dom/Document.cpp        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -4810,64 +4810,13 @@
</span><span class="cx">     return m_xpathEvaluator-&gt;createNSResolver(nodeResolver);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;XPathResult&gt; Document::evaluate(const String&amp; expression,
-                                           Node* contextNode,
-                                           XPathNSResolver* resolver,
-                                           unsigned short type,
-                                           XPathResult* result,
-                                           ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;XPathResult&gt; Document::evaluate(const String&amp; expression, Node* contextNode, XPathNSResolver* resolver, unsigned short type, XPathResult* result, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_xpathEvaluator)
</span><span class="cx">         m_xpathEvaluator = XPathEvaluator::create();
</span><span class="cx">     return m_xpathEvaluator-&gt;evaluate(expression, contextNode, resolver, type, result, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const Vector&lt;IconURL&gt;&amp; Document::shortcutIconURLs()
-{
-    // Include any icons where type = link, rel = &quot;shortcut icon&quot;.
-    return iconURLs(Favicon);
-}
-
-const Vector&lt;IconURL&gt;&amp; Document::iconURLs(int iconTypesMask)
-{
-    m_iconURLs.clear();
-
-    if (!head())
-        return m_iconURLs;
-
-    Ref&lt;HTMLCollection&gt; children = head()-&gt;children();
-    unsigned int length = children-&gt;length();
-    for (unsigned int i = 0; i &lt; length; ++i) {
-        Node* child = children-&gt;item(i);
-        if (!is&lt;HTMLLinkElement&gt;(*child))
-            continue;
-        HTMLLinkElement&amp; linkElement = downcast&lt;HTMLLinkElement&gt;(*child);
-        if (!(linkElement.iconType() &amp; iconTypesMask))
-            continue;
-        if (linkElement.href().isEmpty())
-            continue;
-
-        // Put it at the front to ensure that icons seen later take precedence as required by the spec.
-        IconURL newURL(linkElement.href(), linkElement.iconSizes(), linkElement.type(), linkElement.iconType());
-        m_iconURLs.append(newURL);
-    }
-
-    m_iconURLs.reverse();
-    return m_iconURLs;
-}
-
-void Document::addIconURL(const String&amp; url, const String&amp;, const String&amp;, IconType iconType)
-{
-    if (url.isEmpty())
-        return;
-
-    Frame* f = frame();
-    if (!f)
-        return;
-
-    f-&gt;loader().didChangeIcons(iconType);
-}
-
</del><span class="cx"> void Document::initSecurityContext()
</span><span class="cx"> {
</span><span class="cx">     if (haveInitializedSecurityOrigin()) {
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/dom/Document.h        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx"> #include &quot;DocumentTiming.h&quot;
</span><span class="cx"> #include &quot;FocusDirection.h&quot;
</span><span class="cx"> #include &quot;FontSelector.h&quot;
</span><del>-#include &quot;IconURL.h&quot;
</del><span class="cx"> #include &quot;MutationObserver.h&quot;
</span><span class="cx"> #include &quot;PageVisibilityState.h&quot;
</span><span class="cx"> #include &quot;PlatformScreen.h&quot;
</span><span class="lines">@@ -931,10 +930,6 @@
</span><span class="cx">     bool hasNodesWithPlaceholderStyle() const { return m_hasNodesWithPlaceholderStyle; }
</span><span class="cx">     void setHasNodesWithPlaceholderStyle() { m_hasNodesWithPlaceholderStyle = true; }
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT const Vector&lt;IconURL&gt;&amp; shortcutIconURLs();
-    WEBCORE_EXPORT const Vector&lt;IconURL&gt;&amp; iconURLs(int iconTypesMask);
-    void addIconURL(const String&amp; url, const String&amp; mimeType, const String&amp; size, IconType);
-
</del><span class="cx">     void updateFocusAppearanceSoon(bool restorePreviousSelection);
</span><span class="cx">     void cancelFocusAppearanceUpdate();
</span><span class="cx"> 
</span><span class="lines">@@ -1503,7 +1498,6 @@
</span><span class="cx"> 
</span><span class="cx">     bool m_createRenderers;
</span><span class="cx">     bool m_inPageCache;
</span><del>-    Vector&lt;IconURL&gt; m_iconURLs;
</del><span class="cx"> 
</span><span class="cx">     HashSet&lt;Element*&gt; m_documentSuspensionCallbackElements;
</span><span class="cx">     HashSet&lt;Element*&gt; m_mediaVolumeCallbackElements;
</span></span></pre></div>
<a id="trunkSourceWebCoredomIconURLcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/dom/IconURL.cpp (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/IconURL.cpp        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/dom/IconURL.cpp        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -1,53 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;IconURL.h&quot;
-
-namespace WebCore {
-
-IconURL IconURL::defaultIconURL(const URL&amp; url, IconType type)
-{
-    IconURL result(url, emptyString(), emptyString(), type);
-    result.m_isDefaultIcon = true;
-    return result;
-}
-
-bool operator==(const IconURL&amp; lhs, const IconURL&amp; rhs)
-{
-    return lhs.m_iconType == rhs.m_iconType
-           &amp;&amp; lhs.m_isDefaultIcon == rhs.m_isDefaultIcon
-           &amp;&amp; lhs.m_iconURL == rhs.m_iconURL
-           &amp;&amp; lhs.m_sizes == rhs.m_sizes
-           &amp;&amp; lhs.m_mimeType == rhs.m_mimeType;
-}
-
-}
-
</del></span></pre></div>
<a id="trunkSourceWebCoredomIconURLh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/IconURL.h (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/IconURL.h        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/dom/IconURL.h        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -31,16 +32,10 @@
</span><span class="cx"> #ifndef IconURL_h
</span><span class="cx"> #define IconURL_h
</span><span class="cx"> 
</span><del>-#include &quot;URL.h&quot;
</del><ins>+// FIXME: Rename this header to IconType.h unless we bring back the concept of an &quot;icon URL&quot; structure.
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-#if ENABLE(TOUCH_ICON_LOADING)
-#define ICON_COUNT 3
-#else
-#define ICON_COUNT 1
-#endif
-
</del><span class="cx"> enum IconType {
</span><span class="cx">     InvalidIcon = 0,
</span><span class="cx">     Favicon = 1,
</span><span class="lines">@@ -48,35 +43,6 @@
</span><span class="cx">     TouchPrecomposedIcon = 1 &lt;&lt; 2,
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-struct IconURL {
-    IconType m_iconType;
-    String m_sizes;
-    String m_mimeType;
-    URL m_iconURL;
-    bool m_isDefaultIcon;
-
-    IconURL()
-        : m_iconType(InvalidIcon)
-        , m_isDefaultIcon(false)
-    {
-    }
-
-    IconURL(const URL&amp; url, const String&amp; sizes, const String&amp; mimeType, IconType type)
-        : m_iconType(type)
-        , m_sizes(sizes)
-        , m_mimeType(mimeType)
-        , m_iconURL(url)
-        , m_isDefaultIcon(false)
-    {
-    }
-    
-    static IconURL defaultIconURL(const URL&amp;, IconType);
-};
-
-bool operator==(const IconURL&amp;, const IconURL&amp;);
-
-typedef Vector&lt;IconURL, ICON_COUNT&gt; IconURLs;
-
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // IconURL_h
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> 
</span><span class="cx"> inline HTMLLinkElement::HTMLLinkElement(const QualifiedName&amp; tagName, Document&amp; document, bool createdByParser)
</span><span class="cx">     : HTMLElement(tagName, document)
</span><del>-    , m_linkLoader(this)
</del><ins>+    , m_linkLoader(*this)
</ins><span class="cx">     , m_sizes(DOMSettableTokenList::create())
</span><span class="cx">     , m_disabledState(Unset)
</span><span class="cx">     , m_loading(false)
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx">                 removePendingSheet();
</span><span class="cx"> 
</span><span class="cx">             // Check #2: An alternate sheet becomes enabled while it is still loading.
</span><del>-            if (m_relAttribute.m_isAlternate &amp;&amp; m_disabledState == EnabledViaScript)
</del><ins>+            if (m_relAttribute.isAlternate &amp;&amp; m_disabledState == EnabledViaScript)
</ins><span class="cx">                 addPendingSheet(ActiveSheet);
</span><span class="cx"> 
</span><span class="cx">             // Check #3: A main sheet becomes enabled while it was still loading and
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx">             // happen (a double toggle for no reason essentially). This happens on
</span><span class="cx">             // virtualplastic.net, which manages to do about 12 enable/disables on only 3
</span><span class="cx">             // sheets. :)
</span><del>-            if (!m_relAttribute.m_isAlternate &amp;&amp; m_disabledState == EnabledViaScript &amp;&amp; oldDisabledState == Disabled)
</del><ins>+            if (!m_relAttribute.isAlternate &amp;&amp; m_disabledState == EnabledViaScript &amp;&amp; oldDisabledState == Disabled)
</ins><span class="cx">                 addPendingSheet(ActiveSheet);
</span><span class="cx"> 
</span><span class="cx">             // If the sheet is already loading just bail.
</span><span class="lines">@@ -143,33 +143,46 @@
</span><span class="cx">         if (m_relList)
</span><span class="cx">             m_relList-&gt;updateRelAttribute(value);
</span><span class="cx">         process();
</span><del>-    } else if (name == hrefAttr) {
</del><ins>+        return;
+    }
+    if (name == hrefAttr) {
</ins><span class="cx">         bool wasLink = isLink();
</span><span class="cx">         setIsLink(!value.isNull() &amp;&amp; !shouldProhibitLinks(this));
</span><span class="cx">         if (wasLink != isLink())
</span><span class="cx">             setNeedsStyleRecalc();
</span><span class="cx">         process();
</span><del>-    } else if (name == typeAttr) {
</del><ins>+        return;
+    }
+    if (name == typeAttr) {
</ins><span class="cx">         m_type = value;
</span><span class="cx">         process();
</span><del>-    } else if (name == sizesAttr) {
</del><ins>+        return;
+    }
+    if (name == sizesAttr) {
</ins><span class="cx">         setSizes(value);
</span><span class="cx">         process();
</span><del>-    } else if (name == mediaAttr) {
</del><ins>+        return;
+    }
+    if (name == mediaAttr) {
</ins><span class="cx">         m_media = value.string().lower();
</span><span class="cx">         process();
</span><del>-    } else if (name == disabledAttr)
</del><ins>+        return;
+    }
+    if (name == disabledAttr) {
</ins><span class="cx">         setDisabledState(!value.isNull());
</span><del>-    else {
-        if (name == titleAttr &amp;&amp; m_sheet)
</del><ins>+        return;
+    }
+    if (name == titleAttr) {
+        if (m_sheet)
</ins><span class="cx">             m_sheet-&gt;setTitle(value);
</span><del>-        HTMLElement::parseAttribute(name, value);
</del><ins>+        return;
</ins><span class="cx">     }
</span><ins>+    HTMLElement::parseAttribute(name, value);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool HTMLLinkElement::shouldLoadLink()
</span><span class="cx"> {
</span><del>-    Ref&lt;Document&gt; originalDocument(document());
</del><ins>+    Ref&lt;Document&gt; originalDocument = document();
</ins><span class="cx">     if (!dispatchBeforeLoadEvent(getNonEmptyURLAttribute(hrefAttr)))
</span><span class="cx">         return false;
</span><span class="cx">     // A beforeload handler might have removed us from the document or changed the document.
</span><span class="lines">@@ -185,17 +198,15 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    String type = m_type.lower();
</del><span class="cx">     URL url = getNonEmptyURLAttribute(hrefAttr);
</span><span class="cx"> 
</span><del>-    if (!m_linkLoader.loadLink(m_relAttribute, type, m_sizes-&gt;toString(), url, &amp;document()))
</del><ins>+    if (!m_linkLoader.loadLink(m_relAttribute, url, document()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    bool acceptIfTypeContainsTextCSS = document().page() &amp;&amp; document().page()-&gt;settings().treatsAnyTextCSSLinkAsStylesheet();
</del><ins>+    bool treatAsStyleSheet = m_relAttribute.isStyleSheet
+        || (document().settings() &amp;&amp; document().settings()-&gt;treatsAnyTextCSSLinkAsStylesheet() &amp;&amp; m_type.containsIgnoringASCIICase(&quot;text/css&quot;));
</ins><span class="cx"> 
</span><del>-    if (m_disabledState != Disabled &amp;&amp; (m_relAttribute.m_isStyleSheet || (acceptIfTypeContainsTextCSS &amp;&amp; type.contains(&quot;text/css&quot;)))
-        &amp;&amp; document().frame() &amp;&amp; url.isValid()) {
-        
</del><ins>+    if (m_disabledState != Disabled &amp;&amp; treatAsStyleSheet &amp;&amp; document().frame() &amp;&amp; url.isValid()) {
</ins><span class="cx">         AtomicString charset = fastGetAttribute(charsetAttr);
</span><span class="cx">         if (charset.isEmpty() &amp;&amp; document().frame())
</span><span class="cx">             charset = document().charset();
</span><span class="lines">@@ -278,8 +289,6 @@
</span><span class="cx">     if (!insertionPoint.inDocument())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_linkLoader.released();
-
</del><span class="cx">     if (m_isInShadowTree) {
</span><span class="cx">         ASSERT(!m_sheet);
</span><span class="cx">         return;
</span><span class="lines">@@ -456,7 +465,7 @@
</span><span class="cx"> 
</span><span class="cx"> IconType HTMLLinkElement::iconType() const
</span><span class="cx"> {
</span><del>-    return m_relAttribute.m_iconType;
</del><ins>+    return m_relAttribute.iconType;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String HTMLLinkElement::iconSizes() const
</span><span class="lines">@@ -469,10 +478,10 @@
</span><span class="cx">     HTMLElement::addSubresourceAttributeURLs(urls);
</span><span class="cx"> 
</span><span class="cx">     // Favicons are handled by a special case in LegacyWebArchive::create()
</span><del>-    if (m_relAttribute.m_iconType != InvalidIcon)
</del><ins>+    if (m_relAttribute.iconType != InvalidIcon)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (!m_relAttribute.m_isStyleSheet)
</del><ins>+    if (!m_relAttribute.isStyleSheet)
</ins><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     // Append the URL of this link element.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.h (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.h        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/html/HTMLLinkElement.h        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include &quot;CachedResourceHandle.h&quot;
</span><span class="cx"> #include &quot;DOMSettableTokenList.h&quot;
</span><span class="cx"> #include &quot;HTMLElement.h&quot;
</span><del>-#include &quot;IconURL.h&quot;
</del><span class="cx"> #include &quot;LinkLoader.h&quot;
</span><span class="cx"> #include &quot;LinkLoaderClient.h&quot;
</span><span class="cx"> #include &quot;LinkRelAttribute.h&quot;
</span><span class="lines">@@ -94,7 +93,7 @@
</span><span class="cx">     virtual void linkLoaded() override;
</span><span class="cx">     virtual void linkLoadingErrored() override;
</span><span class="cx"> 
</span><del>-    bool isAlternate() const { return m_disabledState == Unset &amp;&amp; m_relAttribute.m_isAlternate; }
</del><ins>+    bool isAlternate() const { return m_disabledState == Unset &amp;&amp; m_relAttribute.isAlternate; }
</ins><span class="cx">     
</span><span class="cx">     void setDisabledState(bool);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlLinkRelAttributecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/LinkRelAttribute.cpp (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/LinkRelAttribute.cpp        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/html/LinkRelAttribute.cpp        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -32,70 +32,55 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;LinkRelAttribute.h&quot;
</span><span class="cx"> 
</span><ins>+#include &lt;wtf/text/WTFString.h&gt;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> LinkRelAttribute::LinkRelAttribute()
</span><del>-    : m_isStyleSheet(false)
-    , m_iconType(InvalidIcon)
-    , m_isAlternate(false)
-    , m_isDNSPrefetch(false)
-#if ENABLE(LINK_PREFETCH)
-    , m_isLinkPrefetch(false)
-    , m_isLinkSubresource(false)
-#endif
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LinkRelAttribute::LinkRelAttribute(const String&amp; rel)
</span><del>-    : m_isStyleSheet(false)
-    , m_iconType(InvalidIcon)
-    , m_isAlternate(false)
-    , m_isDNSPrefetch(false)
-#if ENABLE(LINK_PREFETCH)
-    , m_isLinkPrefetch(false)
-    , m_isLinkSubresource(false)
-#endif
</del><span class="cx"> {
</span><span class="cx">     if (equalIgnoringCase(rel, &quot;stylesheet&quot;))
</span><del>-        m_isStyleSheet = true;
</del><ins>+        isStyleSheet = true;
</ins><span class="cx">     else if (equalIgnoringCase(rel, &quot;icon&quot;) || equalIgnoringCase(rel, &quot;shortcut icon&quot;))
</span><del>-        m_iconType = Favicon;
</del><ins>+        iconType = Favicon;
</ins><span class="cx"> #if ENABLE(TOUCH_ICON_LOADING)
</span><span class="cx">     else if (equalIgnoringCase(rel, &quot;apple-touch-icon&quot;))
</span><del>-        m_iconType = TouchIcon;
</del><ins>+        iconType = TouchIcon;
</ins><span class="cx">     else if (equalIgnoringCase(rel, &quot;apple-touch-icon-precomposed&quot;))
</span><del>-        m_iconType = TouchPrecomposedIcon;
</del><ins>+        iconType = TouchPrecomposedIcon;
</ins><span class="cx"> #endif
</span><span class="cx">     else if (equalIgnoringCase(rel, &quot;dns-prefetch&quot;))
</span><del>-        m_isDNSPrefetch = true;
</del><ins>+        isDNSPrefetch = true;
</ins><span class="cx">     else if (equalIgnoringCase(rel, &quot;alternate stylesheet&quot;) || equalIgnoringCase(rel, &quot;stylesheet alternate&quot;)) {
</span><del>-        m_isStyleSheet = true;
-        m_isAlternate = true;
</del><ins>+        isStyleSheet = true;
+        isAlternate = true;
</ins><span class="cx">     } else {
</span><span class="cx">         // Tokenize the rel attribute and set bits based on specific keywords that we find.
</span><span class="cx">         String relCopy = rel;
</span><span class="cx">         relCopy.replace('\n', ' ');
</span><span class="cx">         Vector&lt;String&gt; list;
</span><span class="cx">         relCopy.split(' ', list);
</span><del>-        Vector&lt;String&gt;::const_iterator end = list.end();
-        for (Vector&lt;String&gt;::const_iterator it = list.begin(); it != end; ++it) {
-            if (equalIgnoringCase(*it, &quot;stylesheet&quot;))
-                m_isStyleSheet = true;
-            else if (equalIgnoringCase(*it, &quot;alternate&quot;))
-                m_isAlternate = true;
-            else if (equalIgnoringCase(*it, &quot;icon&quot;))
-                m_iconType = Favicon;
</del><ins>+        for (auto&amp; word : list) {
+            if (equalIgnoringCase(word, &quot;stylesheet&quot;))
+                isStyleSheet = true;
+            else if (equalIgnoringCase(word, &quot;alternate&quot;))
+                isAlternate = true;
+            else if (equalIgnoringCase(word, &quot;icon&quot;))
+                iconType = Favicon;
</ins><span class="cx"> #if ENABLE(TOUCH_ICON_LOADING)
</span><del>-            else if (equalIgnoringCase(*it, &quot;apple-touch-icon&quot;))
-                m_iconType = TouchIcon;
-            else if (equalIgnoringCase(*it, &quot;apple-touch-icon-precomposed&quot;))
-                m_iconType = TouchPrecomposedIcon;
</del><ins>+            else if (equalIgnoringCase(word, &quot;apple-touch-icon&quot;))
+                iconType = TouchIcon;
+            else if (equalIgnoringCase(word, &quot;apple-touch-icon-precomposed&quot;))
+                iconType = TouchPrecomposedIcon;
</ins><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(LINK_PREFETCH)
</span><del>-            else if (equalIgnoringCase(*it, &quot;prefetch&quot;))
-              m_isLinkPrefetch = true;
-            else if (equalIgnoringCase(*it, &quot;subresource&quot;))
-              m_isLinkSubresource = true;
</del><ins>+            else if (equalIgnoringCase(word, &quot;prefetch&quot;))
+                isLinkPrefetch = true;
+            else if (equalIgnoringCase(word, &quot;subresource&quot;))
+                isLinkSubresource = true;
</ins><span class="cx"> #endif
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlLinkRelAttributeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/LinkRelAttribute.h (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/LinkRelAttribute.h        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/html/LinkRelAttribute.h        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -33,25 +33,24 @@
</span><span class="cx"> #define LinkRelAttribute_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IconURL.h&quot;
</span><ins>+#include &lt;wtf/Forward.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> struct LinkRelAttribute {
</span><del>-public:
-    bool m_isStyleSheet;
-    IconType m_iconType;
-    bool m_isAlternate;
-    bool m_isDNSPrefetch;
</del><ins>+    bool isStyleSheet { false };
+    IconType iconType { InvalidIcon };
+    bool isAlternate { false };
+    bool isDNSPrefetch { false };
</ins><span class="cx"> #if ENABLE(LINK_PREFETCH)
</span><del>-    bool m_isLinkPrefetch;
-    bool m_isLinkSubresource;
</del><ins>+    bool isLinkPrefetch { false };
+    bool isLinkSubresource { false };
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     LinkRelAttribute();
</span><span class="cx">     explicit LinkRelAttribute(const String&amp;);
</span><span class="cx"> };
</span><del>-    
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLPreloadScannercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -171,8 +171,8 @@
</span><span class="cx"> 
</span><span class="cx">     static bool relAttributeIsStyleSheet(const String&amp; attributeValue)
</span><span class="cx">     {
</span><del>-        LinkRelAttribute rel(attributeValue);
-        return rel.m_isStyleSheet &amp;&amp; !rel.m_isAlternate &amp;&amp; rel.m_iconType == InvalidIcon &amp;&amp; !rel.m_isDNSPrefetch;
</del><ins>+        LinkRelAttribute parsedAttribute { attributeValue };
+        return parsedAttribute.isStyleSheet &amp;&amp; !parsedAttribute.isAlternate &amp;&amp; parsedAttribute.iconType == InvalidIcon &amp;&amp; !parsedAttribute.isDNSPrefetch;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void setUrlToLoad(const String&amp; value, bool allowReplacement = false)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -3347,11 +3347,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FrameLoader::didChangeIcons(IconType type)
-{
-    m_client.dispatchDidChangeIcons(type);
-}
-
</del><span class="cx"> void FrameLoader::dispatchDidCommitLoad()
</span><span class="cx"> {
</span><span class="cx">     if (m_stateMachine.creatingInitialEmptyDocument())
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.h (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.h        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/loader/FrameLoader.h        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -178,7 +178,6 @@
</span><span class="cx">     bool subframeIsLoading() const;
</span><span class="cx">     void willChangeTitle(DocumentLoader*);
</span><span class="cx">     void didChangeTitle(DocumentLoader*);
</span><del>-    void didChangeIcons(IconType);
</del><span class="cx"> 
</span><span class="cx">     bool shouldTreatURLAsSrcdocDocument(const URL&amp;) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoaderClient.h        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &lt;functional&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><ins>+#include &lt;wtf/text/WTFString.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span><span class="cx"> #include &quot;ContentFilterUnblockHandler.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderLinkLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/LinkLoader.cpp (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/LinkLoader.cpp        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/loader/LinkLoader.cpp        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include &quot;DNS.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><ins>+#include &quot;FrameLoaderClient.h&quot;
</ins><span class="cx"> #include &quot;FrameView.h&quot;
</span><span class="cx"> #include &quot;LinkRelAttribute.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="lines">@@ -47,7 +48,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-LinkLoader::LinkLoader(LinkLoaderClient* client)
</del><ins>+LinkLoader::LinkLoader(LinkLoaderClient&amp; client)
</ins><span class="cx">     : m_client(client)
</span><span class="cx">     , m_linkLoadTimer(*this, &amp;LinkLoader::linkLoadTimerFired)
</span><span class="cx">     , m_linkLoadingErrorTimer(*this, &amp;LinkLoader::linkLoadingErrorTimerFired)
</span><span class="lines">@@ -62,12 +63,12 @@
</span><span class="cx"> 
</span><span class="cx"> void LinkLoader::linkLoadTimerFired()
</span><span class="cx"> {
</span><del>-    m_client-&gt;linkLoaded();
</del><ins>+    m_client.linkLoaded();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void LinkLoader::linkLoadingErrorTimerFired()
</span><span class="cx"> {
</span><del>-    m_client-&gt;linkLoadingErrored();
</del><ins>+    m_client.linkLoadingErrored();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void LinkLoader::notifyFinished(CachedResource* resource)
</span><span class="lines">@@ -80,21 +81,21 @@
</span><span class="cx">         m_linkLoadTimer.startOneShot(0);
</span><span class="cx"> 
</span><span class="cx">     m_cachedLinkResource-&gt;removeClient(this);
</span><del>-    m_cachedLinkResource = 0;
</del><ins>+    m_cachedLinkResource = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool LinkLoader::loadLink(const LinkRelAttribute&amp; relAttribute, const String&amp; type,
-                          const String&amp; sizes, const URL&amp; href, Document* document)
</del><ins>+bool LinkLoader::loadLink(const LinkRelAttribute&amp; relAttribute, const URL&amp; href, Document&amp; document)
</ins><span class="cx"> {
</span><span class="cx">     // We'll record this URL per document, even if we later only use it in top level frames
</span><del>-    if (relAttribute.m_iconType != InvalidIcon &amp;&amp; href.isValid() &amp;&amp; !href.isEmpty()) {
-        if (!m_client-&gt;shouldLoadLink()) 
</del><ins>+    if (relAttribute.iconType != InvalidIcon &amp;&amp; href.isValid() &amp;&amp; !href.isEmpty()) {
+        if (!m_client.shouldLoadLink())
</ins><span class="cx">             return false;
</span><del>-        document-&gt;addIconURL(href.string(), type, sizes, relAttribute.m_iconType);
</del><ins>+        if (Frame* frame = document.frame())
+            frame-&gt;loader().client().dispatchDidChangeIcons(relAttribute.iconType);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (relAttribute.m_isDNSPrefetch) {
-        Settings* settings = document-&gt;settings();
</del><ins>+    if (relAttribute.isDNSPrefetch) {
+        Settings* settings = document.settings();
</ins><span class="cx">         // FIXME: The href attribute of the link element can be in &quot;//hostname&quot; form, and we shouldn't attempt
</span><span class="cx">         // to complete that as URL &lt;https://bugs.webkit.org/show_bug.cgi?id=48857&gt;.
</span><span class="cx">         if (settings &amp;&amp; settings-&gt;dnsPrefetchingEnabled() &amp;&amp; href.isValid() &amp;&amp; !href.isEmpty())
</span><span class="lines">@@ -102,24 +103,25 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LINK_PREFETCH)
</span><del>-    if ((relAttribute.m_isLinkPrefetch || relAttribute.m_isLinkSubresource) &amp;&amp; href.isValid() &amp;&amp; document-&gt;frame()) {
-        if (!m_client-&gt;shouldLoadLink())
</del><ins>+    if ((relAttribute.isLinkPrefetch || relAttribute.isLinkSubresource) &amp;&amp; href.isValid() &amp;&amp; document.frame()) {
+        if (!m_client.shouldLoadLink())
</ins><span class="cx">             return false;
</span><ins>+
</ins><span class="cx">         Optional&lt;ResourceLoadPriority&gt; priority;
</span><span class="cx">         CachedResource::Type type = CachedResource::LinkPrefetch;
</span><del>-        // We only make one request to the cachedresourcelodaer if multiple rel types are
-        // specified, 
-        if (relAttribute.m_isLinkSubresource) {
</del><ins>+        if (relAttribute.isLinkSubresource) {
+            // We only make one request to the cached resource loader if multiple rel types are specified;
+            // this is the higher priority, which should overwrite the lower priority.
</ins><span class="cx">             priority = ResourceLoadPriorityLow;
</span><span class="cx">             type = CachedResource::LinkSubresource;
</span><span class="cx">         }
</span><del>-        CachedResourceRequest linkRequest(ResourceRequest(document-&gt;completeURL(href)), priority);
-        
</del><ins>+        CachedResourceRequest linkRequest(ResourceRequest(document.completeURL(href)), priority);
+
</ins><span class="cx">         if (m_cachedLinkResource) {
</span><span class="cx">             m_cachedLinkResource-&gt;removeClient(this);
</span><span class="cx">             m_cachedLinkResource = nullptr;
</span><span class="cx">         }
</span><del>-        m_cachedLinkResource = document-&gt;cachedResourceLoader().requestLinkResource(type, linkRequest);
</del><ins>+        m_cachedLinkResource = document.cachedResourceLoader().requestLinkResource(type, linkRequest);
</ins><span class="cx">         if (m_cachedLinkResource)
</span><span class="cx">             m_cachedLinkResource-&gt;addClient(this);
</span><span class="cx">     }
</span><span class="lines">@@ -128,8 +130,4 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void LinkLoader::released()
-{
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreloaderLinkLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/LinkLoader.h (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/LinkLoader.h        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/loader/LinkLoader.h        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -37,33 +37,27 @@
</span><span class="cx"> #include &quot;LinkLoaderClient.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="cx"> 
</span><del>-#include &lt;wtf/RefPtr.h&gt;
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Document;
</span><span class="cx"> class URL;
</span><ins>+
</ins><span class="cx"> struct LinkRelAttribute;
</span><span class="cx"> 
</span><del>-// The LinkLoader can load link rel types icon, dns-prefetch, subresource and prefetch.
-class LinkLoader : public CachedResourceClient {
-
</del><ins>+class LinkLoader : private CachedResourceClient {
</ins><span class="cx"> public:
</span><del>-    explicit LinkLoader(LinkLoaderClient*);
</del><ins>+    explicit LinkLoader(LinkLoaderClient&amp;);
</ins><span class="cx">     virtual ~LinkLoader();
</span><span class="cx"> 
</span><del>-    // from CachedResourceClient
-    virtual void notifyFinished(CachedResource*) override;
</del><ins>+    bool loadLink(const LinkRelAttribute&amp;, const URL&amp;, Document&amp;);
</ins><span class="cx"> 
</span><del>-    void released();
-    bool loadLink(const LinkRelAttribute&amp;, const String&amp; type, const String&amp; sizes, const URL&amp;, Document*);
-
</del><span class="cx"> private:
</span><ins>+    virtual void notifyFinished(CachedResource*) override;
+
</ins><span class="cx">     void linkLoadTimerFired();
</span><span class="cx">     void linkLoadingErrorTimerFired();
</span><span class="cx"> 
</span><del>-    LinkLoaderClient* m_client;
-
</del><ins>+    LinkLoaderClient&amp; m_client;
</ins><span class="cx">     CachedResourceHandle&lt;CachedResource&gt; m_cachedLinkResource;
</span><span class="cx">     Timer m_linkLoadTimer;
</span><span class="cx">     Timer m_linkLoadingErrorTimer;
</span></span></pre></div>
<a id="trunkSourceWebCoreloadericonIconControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/icon/IconController.cpp (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/icon/IconController.cpp        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/loader/icon/IconController.cpp        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2011, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="cx">  * Copyright (C) 2008 Alp Toker &lt;alp@atoker.com&gt;
</span><span class="lines">@@ -37,12 +37,13 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;DocumentLoader.h&quot;
</span><ins>+#include &quot;ElementChildIterator.h&quot;
</ins><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><span class="cx"> #include &quot;FrameLoaderClient.h&quot;
</span><ins>+#include &quot;HTMLHeadElement.h&quot;
+#include &quot;HTMLLinkElement.h&quot;
</ins><span class="cx"> #include &quot;IconDatabase.h&quot;
</span><del>-#include &quot;IconDatabaseBase.h&quot;
</del><span class="cx"> #include &quot;IconLoader.h&quot;
</span><del>-#include &quot;IconURL.h&quot;
</del><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="lines">@@ -51,9 +52,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+enum class LinkElementSelector { All, WithMIMEType };
+
</ins><span class="cx"> IconController::IconController(Frame&amp; frame)
</span><span class="cx">     : m_frame(frame)
</span><del>-    , m_waitingForLoadDecision(false)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -61,63 +63,63 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-URL IconController::url()
</del><ins>+// FIXME: Given how this is used, there's no real need to use a vector here.
+// Should straighten this out and tighten up the code.
+static Vector&lt;URL&gt; iconsFromLinkElements(Frame&amp; frame, LinkElementSelector selector)
</ins><span class="cx"> {
</span><del>-    IconURLs iconURLs = urlsForTypes(Favicon);
-    return iconURLs.isEmpty() ? URL() : iconURLs[0].m_iconURL;
-}
</del><ins>+    Vector&lt;URL&gt; result;
</ins><span class="cx"> 
</span><del>-IconURL IconController::iconURL(IconType iconType) const
-{
-    IconURL result;
-    const Vector&lt;IconURL&gt;&amp; iconURLs = m_frame.document()-&gt;iconURLs(iconType);
-    Vector&lt;IconURL&gt;::const_iterator iter(iconURLs.begin());
-    for (; iter != iconURLs.end(); ++iter) {
-        if (result.m_iconURL.isEmpty() || !iter-&gt;m_mimeType.isEmpty())
-            result = *iter;
</del><ins>+    auto* document = frame.document();
+    if (!document)
+        return result;
+
+    auto* head = document-&gt;head();
+    if (!head)
+        return result;
+
+    for (auto&amp; linkElement : childrenOfType&lt;HTMLLinkElement&gt;(*head)) {
+        if (!(linkElement.iconType() &amp; Favicon))
+            continue;
+        if (linkElement.href().isEmpty())
+            continue;
+        if (selector == WithMIMEType &amp;&amp; linkElement.type().isEmpty())
+            continue;
+        result.append(linkElement.href());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // Put last icon seen at the front. This helps us implement a rule that says that icons seen later should take precedence.
+    result.reverse();
+
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IconURLs IconController::urlsForTypes(int iconTypesMask)
</del><ins>+URL IconController::url()
</ins><span class="cx"> {
</span><del>-    IconURLs iconURLs;
-    if (m_frame.tree().parent())
-        return iconURLs;
-        
-    if (iconTypesMask &amp; Favicon &amp;&amp; !appendToIconURLs(Favicon, &amp;iconURLs))
-        iconURLs.append(defaultURL(Favicon));
</del><ins>+    if (!m_frame.isMainFrame())
+        return URL();
</ins><span class="cx"> 
</span><del>-#if ENABLE(TOUCH_ICON_LOADING)
-    int missedIcons = 0;
-    if (iconTypesMask &amp; TouchPrecomposedIcon)
-        missedIcons += appendToIconURLs(TouchPrecomposedIcon, &amp;iconURLs) ? 0:1;
</del><ins>+    // FIXME: This implements a rule that says &quot;first icon seen with a MIME type wins&quot;.
+    // But that is not consistent with the comment in iconsFromLinkElements that says
+    // that icons seen *later* should take precedence.
+    URL icon;
+    for (auto&amp; candidate : iconsFromLinkElements(m_frame, LinkElementSelector::WithMIMEType))
+        icon = candidate;
+    if (!icon.isEmpty())
+        return icon;
</ins><span class="cx"> 
</span><del>-    if (iconTypesMask &amp; TouchIcon)
-      missedIcons += appendToIconURLs(TouchIcon, &amp;iconURLs) ? 0:1;
-
-    // Only return the default touch icons when the both were required and neither was gotten.
-    if (missedIcons == 2) {
-        iconURLs.append(defaultURL(TouchPrecomposedIcon));
-        iconURLs.append(defaultURL(TouchIcon));
</del><ins>+    icon = m_frame.document()-&gt;completeURL(ASCIILiteral(&quot;/favicon.ico&quot;));
+    if (icon.protocolIsInHTTPFamily()) {
+        // FIXME: Not sure we need to remove credentials like this.
+        // However this preserves behavior this code path has historically had.
+        icon.setUser(String());
+        icon.setPass(String());
+        return icon;
</ins><span class="cx">     }
</span><del>-#endif
</del><span class="cx"> 
</span><del>-    // Finally, append all remaining icons of this type.
-    const Vector&lt;IconURL&gt;&amp; allIconURLs = m_frame.document()-&gt;iconURLs(iconTypesMask);
-    for (Vector&lt;IconURL&gt;::const_iterator iter = allIconURLs.begin(); iter != allIconURLs.end(); ++iter) {
-        int i;
-        int iconCount = iconURLs.size();
-        for (i = 0; i &lt; iconCount; ++i) {
-            if (*iter == iconURLs.at(i))
-                break;
-        }
-        if (i == iconCount)
-            iconURLs.append(*iter);
-    }
</del><ins>+    for (auto&amp; candidate : iconsFromLinkElements(m_frame, LinkElementSelector::All))
+        return candidate;
</ins><span class="cx"> 
</span><del>-    return iconURLs;
</del><ins>+    return URL();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IconController::commitToDatabase(const URL&amp; icon)
</span><span class="lines">@@ -142,9 +144,8 @@
</span><span class="cx">     if (!documentCanHaveIcon(m_frame.document()-&gt;url()))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    URL iconURL(url());
-    String urlString(iconURL.string());
-    if (urlString.isEmpty())
</del><ins>+    URL iconURL = url();
+    if (iconURL.isEmpty())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // People who want to avoid loading images generally want to avoid loading all images, unless an exception has been made for site icons.
</span><span class="lines">@@ -164,20 +165,20 @@
</span><span class="cx">         if (m_frame.page() &amp;&amp; m_frame.page()-&gt;usesEphemeralSession())
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        m_frame.loader().documentLoader()-&gt;getIconLoadDecisionForIconURL(urlString);
</del><ins>+        m_frame.loader().documentLoader()-&gt;getIconLoadDecisionForIconURL(iconURL.string());
</ins><span class="cx">         // Commit the icon url mapping to the database just in case we don't end up loading later.
</span><span class="cx">         commitToDatabase(iconURL);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    IconLoadDecision decision = iconDatabase().synchronousLoadDecisionForIconURL(urlString, m_frame.loader().documentLoader());
</del><ins>+    IconLoadDecision decision = iconDatabase().synchronousLoadDecisionForIconURL(iconURL.string(), m_frame.loader().documentLoader());
</ins><span class="cx"> 
</span><span class="cx">     if (decision == IconLoadUnknown) {
</span><span class="cx">         // In this case, we may end up loading the icon later, but we still want to commit the icon url mapping to the database
</span><span class="cx">         // just in case we don't end up loading later - if we commit the mapping a second time after the load, that's no big deal
</span><span class="cx">         // We also tell the client to register for the notification that the icon is received now so it isn't missed in case the 
</span><span class="cx">         // icon is later read in from disk
</span><del>-        LOG(IconDatabase, &quot;IconController %p might load icon %s later&quot;, this, urlString.ascii().data());
</del><ins>+        LOG(IconDatabase, &quot;IconController %p might load icon %s later&quot;, this, iconURL.string().utf8().data());
</ins><span class="cx">         m_waitingForLoadDecision = true;    
</span><span class="cx">         m_frame.loader().client().registerForIconNotification();
</span><span class="cx">         commitToDatabase(iconURL);
</span><span class="lines">@@ -208,16 +209,15 @@
</span><span class="cx">     ASSERT(iconLoadDecision != IconLoadUnknown);
</span><span class="cx"> 
</span><span class="cx">     if (iconLoadDecision == IconLoadNo) {
</span><del>-        URL iconURL(url());
-        String urlString(iconURL.string());
-        if (urlString.isEmpty())
</del><ins>+        URL iconURL = url();
+        if (iconURL.isEmpty())
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        LOG(IconDatabase, &quot;IconController::startLoader() - Told not to load this icon, committing iconURL %s to database for pageURL mapping&quot;, urlString.ascii().data());
</del><ins>+        LOG(IconDatabase, &quot;IconController::startLoader() - Told not to load this icon, committing iconURL %s to database for pageURL mapping&quot;, iconURL.string().utf8().data());
</ins><span class="cx">         commitToDatabase(iconURL);
</span><span class="cx"> 
</span><span class="cx">         if (iconDatabase().supportsAsynchronousMode()) {
</span><del>-            m_frame.loader().documentLoader()-&gt;getIconDataForIconURL(urlString);
</del><ins>+            m_frame.loader().documentLoader()-&gt;getIconDataForIconURL(iconURL.string());
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -225,8 +225,8 @@
</span><span class="cx">         // If the icon data hasn't been read in from disk yet, kick off the read of the icon from the database to make sure someone
</span><span class="cx">         // has done it. This is after registering for the notification so the WebView can call the appropriate delegate method.
</span><span class="cx">         // Otherwise if the icon data *is* available, notify the delegate
</span><del>-        if (!iconDatabase().synchronousIconDataKnownForIconURL(urlString)) {
-            LOG(IconDatabase, &quot;Told not to load icon %s but icon data is not yet available - registering for notification and requesting load from disk&quot;, urlString.ascii().data());
</del><ins>+        if (!iconDatabase().synchronousIconDataKnownForIconURL(iconURL.string())) {
+            LOG(IconDatabase, &quot;Told not to load icon %s but icon data is not yet available - registering for notification and requesting load from disk&quot;, iconURL.string().ascii().data());
</ins><span class="cx">             m_frame.loader().client().registerForIconNotification();
</span><span class="cx">             iconDatabase().synchronousIconForPageURL(m_frame.document()-&gt;url().string(), IntSize(0, 0));
</span><span class="cx">             iconDatabase().synchronousIconForPageURL(m_frame.loader().initialRequest().url().string(), IntSize(0, 0));
</span><span class="lines">@@ -242,45 +242,4 @@
</span><span class="cx">     m_iconLoader-&gt;startLoading();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool IconController::appendToIconURLs(IconType iconType, IconURLs* iconURLs)
-{
-    IconURL faviconURL = iconURL(iconType);
-    if (faviconURL.m_iconURL.isEmpty())
-        return false;
-
-    iconURLs-&gt;append(faviconURL);
-    return true;
</del><span class="cx"> }
</span><del>-
-IconURL IconController::defaultURL(IconType iconType)
-{
-    // Don't return a favicon iconURL unless we're http or https
-    URL documentURL = m_frame.document()-&gt;url();
-    if (!documentURL.protocolIsInHTTPFamily())
-        return IconURL();
-
-    URL url;
-    bool couldSetProtocol = url.setProtocol(documentURL.protocol());
-    ASSERT_UNUSED(couldSetProtocol, couldSetProtocol);
-    url.setHost(documentURL.host());
-    if (documentURL.hasPort())
-        url.setPort(documentURL.port());
-
-    if (iconType == Favicon) {
-        url.setPath(&quot;/favicon.ico&quot;);
-        return IconURL::defaultIconURL(url, Favicon);
-    }
-#if ENABLE(TOUCH_ICON_LOADING)
-    if (iconType == TouchPrecomposedIcon) {
-        url.setPath(&quot;/apple-touch-icon-precomposed.png&quot;);
-        return IconURL::defaultIconURL(url, TouchPrecomposedIcon);
-    }
-    if (iconType == TouchIcon) {
-        url.setPath(&quot;/apple-touch-icon.png&quot;);
-        return IconURL::defaultIconURL(url, TouchIcon);
-    }
-#endif
-    return IconURL();
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreloadericonIconControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/icon/IconController.h (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/icon/IconController.h        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/loader/icon/IconController.h        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -32,24 +32,20 @@
</span><span class="cx"> #define IconController_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IconDatabaseBase.h&quot;
</span><del>-#include &quot;IconURL.h&quot;
-#include &quot;URL.h&quot;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Frame;
</span><span class="cx"> class IconLoader;
</span><ins>+class URL;
</ins><span class="cx"> 
</span><span class="cx"> class IconController {
</span><del>-    WTF_MAKE_NONCOPYABLE(IconController);
</del><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx">     explicit IconController(Frame&amp;);
</span><span class="cx">     ~IconController();
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT URL url();
</span><del>-    IconURLs urlsForTypes(int iconTypesMask);
-    IconURL iconURL(IconType) const;
</del><span class="cx"> 
</span><span class="cx">     void startLoader();
</span><span class="cx">     void stopLoader();
</span><span class="lines">@@ -60,13 +56,9 @@
</span><span class="cx">     void commitToDatabase(const URL&amp; icon);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    bool appendToIconURLs(IconType, IconURLs*);
-    IconURL defaultURL(IconType);
-
</del><span class="cx">     Frame&amp; m_frame;
</span><del>-
</del><span class="cx">     std::unique_ptr&lt;IconLoader&gt; m_iconLoader;
</span><del>-    bool m_waitingForLoadDecision;
</del><ins>+    bool m_waitingForLoadDecision { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/testing/Internals.cpp        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> #include &quot;HTMLVideoElement.h&quot;
</span><span class="cx"> #include &quot;HistoryController.h&quot;
</span><span class="cx"> #include &quot;HistoryItem.h&quot;
</span><ins>+#include &quot;IconController.h&quot;
</ins><span class="cx"> #include &quot;InspectorClient.h&quot;
</span><span class="cx"> #include &quot;InspectorController.h&quot;
</span><span class="cx"> #include &quot;InspectorForwarding.h&quot;
</span><span class="lines">@@ -1848,28 +1849,19 @@
</span><span class="cx">     return PrintContext::pageNumberForElement(element, FloatSize(pageWidth, pageHeight));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;String&gt; Internals::iconURLs(Document* document, int iconTypesMask) const
</del><ins>+Vector&lt;String&gt; Internals::shortcutIconURLs() const
</ins><span class="cx"> {
</span><del>-    Vector&lt;IconURL&gt; iconURLs = document-&gt;iconURLs(iconTypesMask);
-    Vector&lt;String&gt; array;
</del><ins>+    Vector&lt;String&gt; vector;
</ins><span class="cx"> 
</span><del>-    Vector&lt;IconURL&gt;::const_iterator iter(iconURLs.begin());
-    for (; iter != iconURLs.end(); ++iter)
-        array.append(iter-&gt;m_iconURL.string());
</del><ins>+    if (!frame())
+        return vector;
</ins><span class="cx"> 
</span><del>-    return array;
</del><ins>+    auto string = frame()-&gt;loader().icon().url().string();
+    if (!string.isNull())
+        vector.append(string);
+    return vector;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;String&gt; Internals::shortcutIconURLs() const
-{
-    return iconURLs(contextDocument(), Favicon);
-}
-
-Vector&lt;String&gt; Internals::allIconURLs() const
-{
-    return iconURLs(contextDocument(), Favicon | TouchIcon | TouchPrecomposedIcon);
-}
-
</del><span class="cx"> int Internals::numberOfPages(float pageWidth, float pageHeight)
</span><span class="cx"> {
</span><span class="cx">     if (!frame())
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/testing/Internals.h        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -258,7 +258,6 @@
</span><span class="cx"> 
</span><span class="cx">     int pageNumber(Element*, float pageWidth = 800, float pageHeight = 600);
</span><span class="cx">     Vector&lt;String&gt; shortcutIconURLs() const;
</span><del>-    Vector&lt;String&gt; allIconURLs() const;
</del><span class="cx"> 
</span><span class="cx">     int numberOfPages(float pageWidthInPixels = 800, float pageHeightInPixels = 600);
</span><span class="cx">     String pageProperty(String, int, ExceptionCode&amp; = ASSERT_NO_EXCEPTION) const;
</span><span class="lines">@@ -386,7 +385,6 @@
</span><span class="cx">     explicit Internals(Document*);
</span><span class="cx">     Document* contextDocument() const;
</span><span class="cx">     Frame* frame() const;
</span><del>-    Vector&lt;String&gt; iconURLs(Document*, int iconTypesMask) const;
</del><span class="cx"> 
</span><span class="cx">     RenderedDocumentMarker* markerAt(Node*, const String&amp; markerType, unsigned index, ExceptionCode&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (182350 => 182351)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2015-04-05 00:53:22 UTC (rev 182350)
+++ trunk/Source/WebCore/testing/Internals.idl        2015-04-05 01:01:49 UTC (rev 182351)
</span><span class="lines">@@ -233,7 +233,6 @@
</span><span class="cx">     DOMString counterValue(Element element);
</span><span class="cx">     long pageNumber(Element element, optional unrestricted float pageWidth, optional unrestricted float pageHeight);
</span><span class="cx">     DOMString[] shortcutIconURLs();
</span><del>-    DOMString[] allIconURLs();
</del><span class="cx">     long numberOfPages(optional unrestricted double pageWidthInPixels, optional unrestricted double pageHeightInPixels);
</span><span class="cx">     [RaisesException] DOMString pageProperty(DOMString propertyName, long pageNumber);
</span><span class="cx">     [RaisesException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft);
</span></span></pre>
</div>
</div>

</body>
</html>