<!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>[200591] trunk/Source</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/200591">200591</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2016-05-09 13:41:31 -0700 (Mon, 09 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add injected bundle SPI for getting favicon and touch icon URLs
https://bugs.webkit.org/show_bug.cgi?id=157435

Reviewed by Darin Adler.

Source/WebCore:

* CMakeLists.txt:
Add new files.

* WebCore.xcodeproj/project.pbxproj:
Add new files.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::iconType):
* html/HTMLLinkElement.h:
Rename LinkRelAttribute::IconType to LinkIconType.

* html/LinkIconCollector.cpp: Added.
(WebCore::iconSize):
New helper function that returns the icon size for an icon.

(WebCore::compareIcons):
Icon comparison function, to be used by for sorting.

(LinkIconCollector::iconsOfTypes):
Gather the right icons, sort them (descending by size) and return them.

* html/LinkIconCollector.h:
Added.

* html/LinkIconType.h:
Move icon type declarations here and arrange them so we can use them in an OptionSet.

* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::LinkRelAttribute):
* html/LinkRelAttribute.h:
* loader/icon/IconController.cpp:
(WebCore::iconFromLinkElements):
Rename IconType to LinkIconType.

Source/WebKit2:

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
(collectIcons):
New helper function that calls into the WebCore LinkCollector.

(-[WKWebProcessPlugInFrame appleTouchIconURLs]):
Call collectIcons.

(-[WKWebProcessPlugInFrame faviconURLs]):
Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</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="#trunkSourceWebCoreloadericonIconControllercpp">trunk/Source/WebCore/loader/icon/IconController.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPICocoaWKWebProcessPlugInFrameh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPICocoaWKWebProcessPlugInFramemm">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorehtmlLinkIconCollectorcpp">trunk/Source/WebCore/html/LinkIconCollector.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlLinkIconCollectorh">trunk/Source/WebCore/html/LinkIconCollector.h</a></li>
<li><a href="#trunkSourceWebCorehtmlLinkIconTypeh">trunk/Source/WebCore/html/LinkIconType.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (200590 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-05-09 20:22:58 UTC (rev 200590)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -1736,6 +1736,7 @@
</span><span class="cx">     html/InputTypeNames.cpp
</span><span class="cx">     html/LabelableElement.cpp
</span><span class="cx">     html/LabelsNodeList.cpp
</span><ins>+    html/LinkIconCollector.cpp
</ins><span class="cx">     html/LinkRelAttribute.cpp
</span><span class="cx">     html/MediaController.cpp
</span><span class="cx">     html/MediaDocument.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200590 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-09 20:22:58 UTC (rev 200590)
+++ trunk/Source/WebCore/ChangeLog        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2016-05-09  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Add injected bundle SPI for getting favicon and touch icon URLs
+        https://bugs.webkit.org/show_bug.cgi?id=157435
+
+        Reviewed by Darin Adler.
+
+        * CMakeLists.txt:
+        Add new files.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Add new files.
+
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::iconType):
+        * html/HTMLLinkElement.h:
+        Rename LinkRelAttribute::IconType to LinkIconType.
+
+        * html/LinkIconCollector.cpp: Added.
+        (WebCore::iconSize):
+        New helper function that returns the icon size for an icon.
+
+        (WebCore::compareIcons):
+        Icon comparison function, to be used by for sorting.
+
+        (LinkIconCollector::iconsOfTypes):
+        Gather the right icons, sort them (descending by size) and return them.
+
+        * html/LinkIconCollector.h:
+        Added.
+
+        * html/LinkIconType.h:
+        Move icon type declarations here and arrange them so we can use them in an OptionSet.
+
+        * html/LinkRelAttribute.cpp:
+        (WebCore::LinkRelAttribute::LinkRelAttribute):
+        * html/LinkRelAttribute.h:
+        * loader/icon/IconController.cpp:
+        (WebCore::iconFromLinkElements):
+        Rename IconType to LinkIconType.
+
</ins><span class="cx"> 2016-05-06  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS WK2] Font size increases on some pages after navigating then going back
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (200590 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-05-09 20:22:58 UTC (rev 200590)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -696,6 +696,7 @@
</span><span class="cx">                 1A22464C0CC98DDB00C05240 /* SQLiteStatement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2246460CC98DDB00C05240 /* SQLiteStatement.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1A22464D0CC98DDB00C05240 /* SQLiteTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2246470CC98DDB00C05240 /* SQLiteTransaction.cpp */; };
</span><span class="cx">                 1A22464E0CC98DDB00C05240 /* SQLiteTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2246480CC98DDB00C05240 /* SQLiteTransaction.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                1A250E0D1CDD632000D0BE63 /* LinkIconType.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A250E0C1CDD632000D0BE63 /* LinkIconType.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 1A2A68230B5BEDE70002A480 /* ProgressTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A68210B5BEDE70002A480 /* ProgressTracker.cpp */; };
</span><span class="cx">                 1A2A68240B5BEDE70002A480 /* ProgressTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2A68220B5BEDE70002A480 /* ProgressTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1A2AAC580DC2A3B100A20D9A /* ApplicationCacheStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2AAC560DC2A3B100A20D9A /* ApplicationCacheStorage.cpp */; };
</span><span class="lines">@@ -723,6 +724,8 @@
</span><span class="cx">                 1A4A954D0B4EDCCB002D8C3C /* SharedBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4A954B0B4EDCCB002D8C3C /* SharedBuffer.cpp */; };
</span><span class="cx">                 1A4A954E0B4EDCCB002D8C3C /* SharedBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4A954C0B4EDCCB002D8C3C /* SharedBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1A4A95520B4EDCFF002D8C3C /* SharedBufferMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4A95510B4EDCFF002D8C3C /* SharedBufferMac.mm */; };
</span><ins>+                1A4DA4211CDD3A8300F4473C /* LinkIconCollector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4DA41F1CDD3A8300F4473C /* LinkIconCollector.cpp */; };
+                1A4DA4221CDD3A8300F4473C /* LinkIconCollector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4DA4201CDD3A8300F4473C /* LinkIconCollector.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 1A569CF70D7E2B82007C3983 /* c_class.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A569CC60D7E2B82007C3983 /* c_class.cpp */; };
</span><span class="cx">                 1A569CF80D7E2B82007C3983 /* c_class.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CC70D7E2B82007C3983 /* c_class.h */; };
</span><span class="cx">                 1A569CF90D7E2B82007C3983 /* c_instance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A569CC80D7E2B82007C3983 /* c_instance.cpp */; };
</span><span class="lines">@@ -8136,6 +8139,7 @@
</span><span class="cx">                 1A2246460CC98DDB00C05240 /* SQLiteStatement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLiteStatement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A2246470CC98DDB00C05240 /* SQLiteTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLiteTransaction.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A2246480CC98DDB00C05240 /* SQLiteTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLiteTransaction.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1A250E0C1CDD632000D0BE63 /* LinkIconType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkIconType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1A2A68210B5BEDE70002A480 /* ProgressTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ProgressTracker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A2A68220B5BEDE70002A480 /* ProgressTracker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProgressTracker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A2AAC560DC2A3B100A20D9A /* ApplicationCacheStorage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationCacheStorage.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -8166,6 +8170,8 @@
</span><span class="cx">                 1A4A954B0B4EDCCB002D8C3C /* SharedBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SharedBuffer.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A4A954C0B4EDCCB002D8C3C /* SharedBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SharedBuffer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A4A95510B4EDCFF002D8C3C /* SharedBufferMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SharedBufferMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1A4DA41F1CDD3A8300F4473C /* LinkIconCollector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LinkIconCollector.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1A4DA4201CDD3A8300F4473C /* LinkIconCollector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkIconCollector.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1A569CC60D7E2B82007C3983 /* c_class.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = c_class.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A569CC70D7E2B82007C3983 /* c_class.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = c_class.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A569CC80D7E2B82007C3983 /* c_instance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = c_instance.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -19430,6 +19436,9 @@
</span><span class="cx">                                 450CEBEF15073BBE002BB149 /* LabelableElement.h */,
</span><span class="cx">                                 A456FA2411AD4A830020B420 /* LabelsNodeList.cpp */,
</span><span class="cx">                                 A456FA2511AD4A830020B420 /* LabelsNodeList.h */,
</span><ins>+                                1A4DA41F1CDD3A8300F4473C /* LinkIconCollector.cpp */,
+                                1A4DA4201CDD3A8300F4473C /* LinkIconCollector.h */,
+                                1A250E0C1CDD632000D0BE63 /* LinkIconType.h */,
</ins><span class="cx">                                 985BB96B13A94058007A0B69 /* LinkRelAttribute.cpp */,
</span><span class="cx">                                 985BB96C13A94058007A0B69 /* LinkRelAttribute.h */,
</span><span class="cx">                                 CD27F6E6145770D30078207D /* MediaController.cpp */,
</span><span class="lines">@@ -26210,6 +26219,7 @@
</span><span class="cx">                                 A8CFF7AB0A156978000A4234 /* HTMLAnchorElement.h in Headers */,
</span><span class="cx">                                 A871D45D0A127CBC00B12A68 /* HTMLAppletElement.h in Headers */,
</span><span class="cx">                                 A8EA7D2E0A19385500A8EF5F /* HTMLAreaElement.h in Headers */,
</span><ins>+                                1A4DA4221CDD3A8300F4473C /* LinkIconCollector.h in Headers */,
</ins><span class="cx">                                 7C5F28FC1A827D8400C0F31F /* HTMLAttachmentElement.h in Headers */,
</span><span class="cx">                                 E44613A20CD6331000FADA75 /* HTMLAudioElement.h in Headers */,
</span><span class="cx">                                 A871DC1F0A15205700B12A68 /* HTMLBaseElement.h in Headers */,
</span><span class="lines">@@ -28131,6 +28141,7 @@
</span><span class="cx">                                 B22279D40D00BF220071B782 /* SVGFEDiffuseLightingElement.h in Headers */,
</span><span class="cx">                                 B22279D70D00BF220071B782 /* SVGFEDisplacementMapElement.h in Headers */,
</span><span class="cx">                                 B22279DA0D00BF220071B782 /* SVGFEDistantLightElement.h in Headers */,
</span><ins>+                                1A250E0D1CDD632000D0BE63 /* LinkIconType.h in Headers */,
</ins><span class="cx">                                 4358E8861360A33B00E4748C /* SVGFEDropShadowElement.h in Headers */,
</span><span class="cx">                                 B22279DD0D00BF220071B782 /* SVGFEFloodElement.h in Headers */,
</span><span class="cx">                                 B22279E00D00BF220071B782 /* SVGFEFuncAElement.h in Headers */,
</span><span class="lines">@@ -31680,6 +31691,7 @@
</span><span class="cx">                                 4331AC7813B6870000A9E5AE /* SVGAnimatedNumberList.cpp in Sources */,
</span><span class="cx">                                 431A2F9D13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp in Sources */,
</span><span class="cx">                                 08B5F25513B5FFF2002959EC /* SVGAnimatedPath.cpp in Sources */,
</span><ins>+                                1A4DA4211CDD3A8300F4473C /* LinkIconCollector.cpp in Sources */,
</ins><span class="cx">                                 43B9336A13B261B1004584BF /* SVGAnimatedPointList.cpp in Sources */,
</span><span class="cx">                                 431A302113B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp in Sources */,
</span><span class="cx">                                 836FBCEC178C117F00B21A15 /* SVGAnimatedProperty.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (200590 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp        2016-05-09 20:22:58 UTC (rev 200590)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -495,7 +495,7 @@
</span><span class="cx">     return getAttribute(typeAttr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Optional&lt;LinkRelAttribute::IconType&gt; HTMLLinkElement::iconType() const
</del><ins>+Optional&lt;LinkIconType&gt; HTMLLinkElement::iconType() const
</ins><span class="cx"> {
</span><span class="cx">     return m_relAttribute.iconType;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.h (200590 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.h        2016-05-09 20:22:58 UTC (rev 200590)
+++ trunk/Source/WebCore/html/HTMLLinkElement.h        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx"> 
</span><span class="cx">     const AtomicString&amp; type() const;
</span><span class="cx"> 
</span><del>-    Optional&lt;LinkRelAttribute::IconType&gt; iconType() const;
</del><ins>+    Optional&lt;LinkIconType&gt; iconType() const;
</ins><span class="cx"> 
</span><span class="cx">     // the icon size string as parsed from the HTML attribute
</span><span class="cx">     String iconSizes();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlLinkIconCollectorcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/html/LinkIconCollector.cpp (0 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/LinkIconCollector.cpp                                (rev 0)
+++ trunk/Source/WebCore/html/LinkIconCollector.cpp        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -0,0 +1,117 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * 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 APPLE INC. OR ITS 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;LinkIconCollector.h&quot;
+
+#include &quot;Document.h&quot;
+#include &quot;ElementChildIterator.h&quot;
+#include &quot;HTMLHeadElement.h&quot;
+#include &quot;HTMLLinkElement.h&quot;
+#include &quot;LinkIconType.h&quot;
+
+namespace WebCore {
+
+const unsigned defaultTouchIconWidth = 60;
+
+static unsigned iconSize(const LinkIconCollector::Icon&amp; icon)
+{
+    if (icon.size)
+        return *icon.size;
+
+    if (icon.type == LinkIconType::TouchIcon || icon.type == LinkIconType::TouchPrecomposedIcon)
+        return defaultTouchIconWidth;
+
+    return 0;
+}
+
+static int compareIcons(const LinkIconCollector::Icon&amp; a, const LinkIconCollector::Icon&amp; b)
+{
+    // Apple Touch icons always come first.
+    if (a.type == LinkIconType::Favicon &amp;&amp; b.type != LinkIconType::Favicon)
+        return 1;
+    if (a.type == LinkIconType::Favicon &amp;&amp; b.type != LinkIconType::Favicon)
+        return -1;
+
+    unsigned aSize = iconSize(a);
+    unsigned bSize = iconSize(b);
+
+    if (bSize &gt; aSize)
+        return 1;
+    if (bSize &lt; aSize)
+        return -1;
+
+    // A Precomposed icon should come first if both icons have the same size.
+    if (a.type != LinkIconType::TouchPrecomposedIcon &amp;&amp; b.type == LinkIconType::TouchPrecomposedIcon)
+        return 1;
+    if (b.type != LinkIconType::TouchPrecomposedIcon &amp;&amp; a.type == LinkIconType::TouchPrecomposedIcon)
+        return -1;
+
+    return 0;
+}
+
+auto LinkIconCollector::iconsOfTypes(OptionSet&lt;LinkIconType&gt; iconTypes) -&gt; Vector&lt;Icon&gt;
+{
+    auto* head = m_document.head();
+    if (!head)
+        return { };
+
+    Vector&lt;Icon&gt; icons;
+
+    for (auto&amp; linkElement : childrenOfType&lt;HTMLLinkElement&gt;(*head)) {
+        if (!linkElement.iconType())
+            continue;
+
+        auto iconType = *linkElement.iconType();
+        if (!iconTypes.contains(iconType))
+            continue;
+
+        auto url = linkElement.href();
+        if (!url.protocolIsInHTTPFamily())
+            continue;
+
+        // This icon size parsing is a little wonky - it only parses the first
+        // part of the size, &quot;60x70&quot; becomes &quot;60&quot;. This is for compatibility reasons
+        // and is probably good enough for now.
+        Optional&lt;unsigned&gt; iconSize;
+
+        if (linkElement.sizes().length()) {
+            bool ok;
+            unsigned size = linkElement.sizes().item(0).string().stripWhiteSpace().toUInt(&amp;ok);
+            if (ok)
+                iconSize = size;
+        }
+
+        icons.append({ url, iconType, iconSize });
+    }
+
+    std::sort(icons.begin(), icons.end(), [](const LinkIconCollector::Icon&amp; a, const LinkIconCollector::Icon&amp; b) {
+        return compareIcons(a, b) &lt; 0;
+    });
+
+    return icons;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlLinkIconCollectorhfromrev200590trunkSourceWebKit2WebProcessInjectedBundleAPICocoaWKWebProcessPlugInFrameh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/LinkIconCollector.h (from rev 200590, trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h) (0 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/LinkIconCollector.h                                (rev 0)
+++ trunk/Source/WebCore/html/LinkIconCollector.h        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * 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 APPLE INC. OR ITS 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.
+ */
+
+#pragma once
+
+#include &quot;URL.h&quot;
+#include &lt;wtf/OptionSet.h&gt;
+#include &lt;wtf/Optional.h&gt;
+
+namespace WebCore {
+
+class Document;
+enum class LinkIconType;
+
+class LinkIconCollector {
+public:
+    explicit LinkIconCollector(Document&amp; document)
+        : m_document(document)
+    {
+    }
+
+    struct Icon {
+        URL url;
+
+        LinkIconType type;
+        Optional&lt;unsigned&gt; size;
+    };
+
+    WEBCORE_EXPORT Vector&lt;Icon&gt; iconsOfTypes(OptionSet&lt;LinkIconType&gt;);
+
+private:
+    Document&amp; m_document;
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlLinkIconTypehfromrev200590trunkSourceWebKit2WebProcessInjectedBundleAPICocoaWKWebProcessPlugInFrameh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/LinkIconType.h (from rev 200590, trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h) (0 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/LinkIconType.h                                (rev 0)
+++ trunk/Source/WebCore/html/LinkIconType.h        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * 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 APPLE INC. OR ITS 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.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+// These values are arranged so that they can be used with WTF::OptionSet.
+
+enum class LinkIconType {
+    Favicon = 1 &lt;&lt; 0,
+    TouchIcon = 1 &lt;&lt; 1,
+    TouchPrecomposedIcon = 1 &lt;&lt;2
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlLinkRelAttributecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/LinkRelAttribute.cpp (200590 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/LinkRelAttribute.cpp        2016-05-09 20:22:58 UTC (rev 200590)
+++ trunk/Source/WebCore/html/LinkRelAttribute.cpp        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -32,6 +32,7 @@
</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 &quot;LinkIconType.h&quot;
</ins><span class="cx"> #include &quot;RuntimeEnabledFeatures.h&quot;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -46,11 +47,11 @@
</span><span class="cx">     if (equalLettersIgnoringASCIICase(rel, &quot;stylesheet&quot;))
</span><span class="cx">         isStyleSheet = true;
</span><span class="cx">     else if (equalLettersIgnoringASCIICase(rel, &quot;icon&quot;) || equalLettersIgnoringASCIICase(rel, &quot;shortcut icon&quot;))
</span><del>-        iconType = IconType::Favicon;
</del><ins>+        iconType = LinkIconType::Favicon;
</ins><span class="cx">     else if (equalLettersIgnoringASCIICase(rel, &quot;apple-touch-icon&quot;))
</span><del>-        iconType = IconType::TouchIcon;
</del><ins>+        iconType = LinkIconType::TouchIcon;
</ins><span class="cx">     else if (equalLettersIgnoringASCIICase(rel, &quot;apple-touch-icon-precomposed&quot;))
</span><del>-        iconType = IconType::TouchPrecomposedIcon;
</del><ins>+        iconType = LinkIconType::TouchPrecomposedIcon;
</ins><span class="cx">     else if (equalLettersIgnoringASCIICase(rel, &quot;dns-prefetch&quot;))
</span><span class="cx">         isDNSPrefetch = true;
</span><span class="cx">     else if (RuntimeEnabledFeatures::sharedFeatures().linkPreloadEnabled() &amp;&amp; equalLettersIgnoringASCIICase(rel, &quot;preload&quot;))
</span><span class="lines">@@ -70,11 +71,11 @@
</span><span class="cx">             else if (equalLettersIgnoringASCIICase(word, &quot;alternate&quot;))
</span><span class="cx">                 isAlternate = true;
</span><span class="cx">             else if (equalLettersIgnoringASCIICase(word, &quot;icon&quot;))
</span><del>-                iconType = IconType::Favicon;
</del><ins>+                iconType = LinkIconType::Favicon;
</ins><span class="cx">             else if (equalLettersIgnoringASCIICase(word, &quot;apple-touch-icon&quot;))
</span><del>-                iconType = IconType::TouchIcon;
</del><ins>+                iconType = LinkIconType::TouchIcon;
</ins><span class="cx">             else if (equalLettersIgnoringASCIICase(word, &quot;apple-touch-icon-precomposed&quot;))
</span><del>-                iconType = IconType::TouchPrecomposedIcon;
</del><ins>+                iconType = LinkIconType::TouchPrecomposedIcon;
</ins><span class="cx"> #if ENABLE(LINK_PREFETCH)
</span><span class="cx">             else if (equalLettersIgnoringASCIICase(word, &quot;prefetch&quot;))
</span><span class="cx">                 isLinkPrefetch = true;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlLinkRelAttributeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/LinkRelAttribute.h (200590 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/LinkRelAttribute.h        2016-05-09 20:22:58 UTC (rev 200590)
+++ trunk/Source/WebCore/html/LinkRelAttribute.h        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -37,15 +37,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-struct LinkRelAttribute {
-    enum class IconType {
-        Favicon,
-        TouchIcon,
-        TouchPrecomposedIcon,
-    };
</del><ins>+enum class LinkIconType;
</ins><span class="cx"> 
</span><ins>+struct LinkRelAttribute {
</ins><span class="cx">     bool isStyleSheet { false };
</span><del>-    Optional&lt;IconType&gt; iconType;
</del><ins>+    Optional&lt;LinkIconType&gt; iconType;
</ins><span class="cx">     bool isAlternate { false };
</span><span class="cx">     bool isDNSPrefetch { false };
</span><span class="cx">     bool isLinkPreload { false };
</span></span></pre></div>
<a id="trunkSourceWebCoreloadericonIconControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/icon/IconController.cpp (200590 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/icon/IconController.cpp        2016-05-09 20:22:58 UTC (rev 200590)
+++ trunk/Source/WebCore/loader/icon/IconController.cpp        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #include &quot;HTMLLinkElement.h&quot;
</span><span class="cx"> #include &quot;IconDatabase.h&quot;
</span><span class="cx"> #include &quot;IconLoader.h&quot;
</span><ins>+#include &quot;LinkIconType.h&quot;
</ins><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">@@ -81,7 +82,7 @@
</span><span class="cx">     for (auto&amp; linkElement : childrenOfType&lt;HTMLLinkElement&gt;(*head)) {
</span><span class="cx">         if (!linkElement.iconType())
</span><span class="cx">             continue;
</span><del>-        if (*linkElement.iconType() != LinkRelAttribute::IconType::Favicon)
</del><ins>+        if (*linkElement.iconType() != LinkIconType::Favicon)
</ins><span class="cx">             continue;
</span><span class="cx">         if (linkElement.href().isEmpty())
</span><span class="cx">             continue;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (200590 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-05-09 20:22:58 UTC (rev 200590)
+++ trunk/Source/WebKit2/ChangeLog        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-05-09  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Add injected bundle SPI for getting favicon and touch icon URLs
+        https://bugs.webkit.org/show_bug.cgi?id=157435
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
+        (collectIcons):
+        New helper function that calls into the WebCore LinkCollector.
+
+        (-[WKWebProcessPlugInFrame appleTouchIconURLs]):
+        Call collectIcons.
+
+        (-[WKWebProcessPlugInFrame faviconURLs]):
+        Ditto.
+
</ins><span class="cx"> 2016-05-06  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS WK2] Font size increases on some pages after navigating then going back
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPICocoaWKWebProcessPlugInFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h (200590 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h        2016-05-09 20:22:58 UTC (rev 200590)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -45,6 +45,11 @@
</span><span class="cx"> 
</span><span class="cx"> @property (nonatomic, readonly) _WKFrameHandle *handle;
</span><span class="cx"> 
</span><ins>+// Returns URLs ordered by resolution in descending order.
+// FIXME: These should be tagged nonnull.
+@property (nonatomic, readonly) WK_ARRAY(NSURL *) *appleTouchIconURLs WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
+@property (nonatomic, readonly) WK_ARRAY(NSURL *) *faviconURLs WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
+
</ins><span class="cx"> - (JSContext *)jsContextForWorld:(WKWebProcessPlugInScriptWorld *)world;
</span><span class="cx"> - (WKWebProcessPlugInHitTestResult *)hitTest:(CGPoint)point;
</span><span class="cx"> - (JSValue *)jsNodeForNodeHandle:(WKWebProcessPlugInNodeHandle *)nodeHandle inWorld:(WKWebProcessPlugInScriptWorld *)world;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPICocoaWKWebProcessPlugInFramemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm (200590 => 200591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm        2016-05-09 20:22:58 UTC (rev 200590)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm        2016-05-09 20:41:31 UTC (rev 200591)
</span><span class="lines">@@ -38,7 +38,10 @@
</span><span class="cx"> #import &quot;_WKFrameHandleInternal.h&quot;
</span><span class="cx"> #import &lt;JavaScriptCore/JSValue.h&gt;
</span><span class="cx"> #import &lt;WebCore/CertificateInfo.h&gt;
</span><ins>+#import &lt;WebCore/Frame.h&gt;
</ins><span class="cx"> #import &lt;WebCore/IntPoint.h&gt;
</span><ins>+#import &lt;WebCore/LinkIconCollector.h&gt;
+#import &lt;WebCore/LinkIconType.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebKit;
</span><span class="cx"> 
</span><span class="lines">@@ -103,6 +106,30 @@
</span><span class="cx">     return [wrapper(API::FrameHandle::create(_frame-&gt;frameID()).leakRef()) autorelease];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static RetainPtr&lt;NSArray&gt; collectIcons(WebCore::Frame* frame, OptionSet&lt;WebCore::LinkIconType&gt; iconTypes)
+{
+    auto result = adoptNS([[NSMutableArray alloc] init]);
+
+    if (frame) {
+        if (auto* document = frame-&gt;document()) {
+            for (auto&amp; icon : WebCore::LinkIconCollector(*document).iconsOfTypes(iconTypes))
+                [result addObject:(NSURL *)icon.url];
+        }
+    }
+
+    return result.autorelease();
+}
+
+- (NSArray *)appleTouchIconURLs
+{
+    return collectIcons(_frame-&gt;coreFrame(), { WebCore::LinkIconType::TouchIcon, WebCore::LinkIconType::TouchPrecomposedIcon }).autorelease();
+}
+
+- (NSArray *)faviconURLs
+{
+    return collectIcons(_frame-&gt;coreFrame(), WebCore::LinkIconType::Favicon).autorelease();
+}
+
</ins><span class="cx"> - (WKWebProcessPlugInFrame *)_parentFrame
</span><span class="cx"> {
</span><span class="cx">     WebFrame *parentFrame = _frame-&gt;parentFrame();
</span></span></pre>
</div>
</div>

</body>
</html>