<!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>[168316] 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/168316">168316</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-05-05 14:13:22 -0700 (Mon, 05 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS][WK2] Special case ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture() for image documents
https://bugs.webkit.org/show_bug.cgi?id=132553

Reviewed by Tim Horton.


Source/WebCore: 
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* html/ImageDocument.cpp:
(WebCore::ImageDocument::imageElement):
* html/ImageDocument.h:

Source/WebKit2: 
When collecting the geometry for the smart magnification gesture, always return the image of an image document
on iOS. On iOS, it does not make much sense to return the whole document rect when the gesture is not over the image.

* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
(WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorehtmlImageDocumentcpp">trunk/Source/WebCore/html/ImageDocument.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlImageDocumenth">trunk/Source/WebCore/html/ImageDocument.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageViewGestureGeometryCollectorcpp">trunk/Source/WebKit2/WebProcess/WebPage/ViewGestureGeometryCollector.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (168315 => 168316)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-05 21:13:03 UTC (rev 168315)
+++ trunk/Source/WebCore/ChangeLog        2014-05-05 21:13:22 UTC (rev 168316)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-05-05  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        [iOS][WK2] Special case ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture() for image documents
+        https://bugs.webkit.org/show_bug.cgi?id=132553
+
+        Reviewed by Tim Horton.
+
+        * WebCore.exp.in:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/ImageDocument.cpp:
+        (WebCore::ImageDocument::imageElement):
+        * html/ImageDocument.h:
+
</ins><span class="cx"> 2014-05-05  Ion Rosca  &lt;rosca@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Blending] Webkit-blend-mode fails for accelerated parent with overflow:hidden
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (168315 => 168316)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-05-05 21:13:03 UTC (rev 168315)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-05-05 21:13:22 UTC (rev 168316)
</span><span class="lines">@@ -1589,6 +1589,7 @@
</span><span class="cx"> __ZNK7WebCore13HitTestResult5imageEv
</span><span class="cx"> __ZNK7WebCore13HitTestResult5titleERNS_13TextDirectionE
</span><span class="cx"> __ZNK7WebCore13HitTestResult9imageRectEv
</span><ins>+__ZNK7WebCore13ImageDocument12imageElementEv
</ins><span class="cx"> __ZNK7WebCore13ResourceError7cfErrorEv
</span><span class="cx"> __ZNK7WebCore13ResourceError7nsErrorEv
</span><span class="cx"> __ZNK7WebCore13ResourceErrorcvP7NSErrorEv
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (168315 => 168316)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-05-05 21:13:03 UTC (rev 168315)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-05-05 21:13:22 UTC (rev 168316)
</span><span class="lines">@@ -416,7 +416,7 @@
</span><span class="cx">                 089021A9126EF5DE0092D5EA /* SVGAnimatedLength.h in Headers */ = {isa = PBXBuildFile; fileRef = 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */ = {isa = PBXBuildFile; fileRef = 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 089582530E857A7E00F82C83 /* ImageLoader.cpp */; };
</span><del>-                089582560E857A7E00F82C83 /* ImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 089582540E857A7E00F82C83 /* ImageLoader.h */; };
</del><ins>+                089582560E857A7E00F82C83 /* ImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 089582540E857A7E00F82C83 /* ImageLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 089A8E06128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h */; };
</span><span class="cx">                 08A484770E5272C500C3FE76 /* ScriptElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08A484750E5272C500C3FE76 /* ScriptElement.cpp */; };
</span><span class="cx">                 08A484780E5272C500C3FE76 /* ScriptElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08A484760E5272C500C3FE76 /* ScriptElement.h */; };
</span><span class="lines">@@ -3325,7 +3325,7 @@
</span><span class="cx">                 97205AAF123928CA00B17380 /* FTPDirectoryDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97205AAD123928CA00B17380 /* FTPDirectoryDocument.cpp */; };
</span><span class="cx">                 97205AB0123928CA00B17380 /* FTPDirectoryDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 97205AAE123928CA00B17380 /* FTPDirectoryDocument.h */; };
</span><span class="cx">                 97205AB51239291000B17380 /* ImageDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97205AB11239291000B17380 /* ImageDocument.cpp */; };
</span><del>-                97205AB61239291000B17380 /* ImageDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 97205AB21239291000B17380 /* ImageDocument.h */; };
</del><ins>+                97205AB61239291000B17380 /* ImageDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 97205AB21239291000B17380 /* ImageDocument.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 97205AB71239291000B17380 /* MediaDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97205AB31239291000B17380 /* MediaDocument.cpp */; };
</span><span class="cx">                 97205AB81239291000B17380 /* MediaDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 97205AB41239291000B17380 /* MediaDocument.h */; };
</span><span class="cx">                 97205ABB1239292700B17380 /* PluginDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97205AB91239292700B17380 /* PluginDocument.cpp */; };
</span><span class="lines">@@ -4135,9 +4135,9 @@
</span><span class="cx">                 A8EA7CB50A192B9C00A8EF5F /* HTMLParagraphElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7CA70A192B9C00A8EF5F /* HTMLParagraphElement.h */; };
</span><span class="cx">                 A8EA7CB70A192B9C00A8EF5F /* HTMLDivElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7CA90A192B9C00A8EF5F /* HTMLDivElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A8EA7CB80A192B9C00A8EF5F /* HTMLHeadingElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7CAA0A192B9C00A8EF5F /* HTMLHeadingElement.h */; };
</span><del>-                A8EA7D2B0A19385500A8EF5F /* HTMLImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7D230A19385500A8EF5F /* HTMLImageLoader.h */; settings = {ATTRIBUTES = (); }; };
</del><ins>+                A8EA7D2B0A19385500A8EF5F /* HTMLImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7D230A19385500A8EF5F /* HTMLImageLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 A8EA7D2C0A19385500A8EF5F /* HTMLMapElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7D240A19385500A8EF5F /* HTMLMapElement.h */; };
</span><del>-                A8EA7D2D0A19385500A8EF5F /* HTMLImageElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7D250A19385500A8EF5F /* HTMLImageElement.h */; settings = {ATTRIBUTES = (); }; };
</del><ins>+                A8EA7D2D0A19385500A8EF5F /* HTMLImageElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7D250A19385500A8EF5F /* HTMLImageElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 A8EA7D2E0A19385500A8EF5F /* HTMLAreaElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7D260A19385500A8EF5F /* HTMLAreaElement.h */; };
</span><span class="cx">                 A8EA7D2F0A19385500A8EF5F /* HTMLAreaElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7D270A19385500A8EF5F /* HTMLAreaElement.cpp */; };
</span><span class="cx">                 A8EA7D300A19385500A8EF5F /* HTMLImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7D280A19385500A8EF5F /* HTMLImageLoader.cpp */; };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageDocument.cpp (168315 => 168316)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageDocument.cpp        2014-05-05 21:13:03 UTC (rev 168315)
+++ trunk/Source/WebCore/html/ImageDocument.cpp        2014-05-05 21:13:22 UTC (rev 168316)
</span><span class="lines">@@ -110,6 +110,11 @@
</span><span class="cx"> 
</span><span class="cx"> // --------
</span><span class="cx"> 
</span><ins>+HTMLImageElement* ImageDocument::imageElement() const
+{
+    return m_imageElement;
+}
+
</ins><span class="cx"> LayoutSize ImageDocument::imageSize()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_imageElement);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageDocument.h (168315 => 168316)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageDocument.h        2014-05-05 21:13:03 UTC (rev 168315)
+++ trunk/Source/WebCore/html/ImageDocument.h        2014-05-05 21:13:22 UTC (rev 168316)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class ImageDocumentElement;
</span><ins>+class HTMLImageElement;
</ins><span class="cx"> 
</span><span class="cx"> class ImageDocument final : public HTMLDocument {
</span><span class="cx"> public:
</span><span class="lines">@@ -38,6 +39,8 @@
</span><span class="cx">         return adoptRef(new ImageDocument(frame, url));
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    HTMLImageElement* imageElement() const;
+
</ins><span class="cx">     void updateDuringParsing();
</span><span class="cx">     void finishedParsing();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (168315 => 168316)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-05 21:13:03 UTC (rev 168315)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-05 21:13:22 UTC (rev 168316)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-05-05  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        [iOS][WK2] Special case ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture() for image documents
+        https://bugs.webkit.org/show_bug.cgi?id=132553
+
+        Reviewed by Tim Horton.
+
+        When collecting the geometry for the smart magnification gesture, always return the image of an image document
+        on iOS. On iOS, it does not make much sense to return the whole document rect when the gesture is not over the image.
+
+        * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
+        (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
+
</ins><span class="cx"> 2014-05-02  Gavin Barraclough  &lt;baraclough@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=132522
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageViewGestureGeometryCollectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ViewGestureGeometryCollector.cpp (168315 => 168316)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ViewGestureGeometryCollector.cpp        2014-05-05 21:13:03 UTC (rev 168315)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ViewGestureGeometryCollector.cpp        2014-05-05 21:13:22 UTC (rev 168316)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2014 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
</span><span class="lines">@@ -33,7 +33,9 @@
</span><span class="cx"> #include &quot;WebProcess.h&quot;
</span><span class="cx"> #include &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #include &lt;WebCore/FrameView.h&gt;
</span><ins>+#include &lt;WebCore/HTMLImageElement.h&gt;
</ins><span class="cx"> #include &lt;WebCore/HitTestResult.h&gt;
</span><ins>+#include &lt;WebCore/ImageDocument.h&gt;
</ins><span class="cx"> #include &lt;WebCore/RenderView.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -90,6 +92,14 @@
</span><span class="cx">         bool isReplaced;
</span><span class="cx">         FloatRect renderRect = node-&gt;renderRect(&amp;isReplaced);
</span><span class="cx"> 
</span><ins>+        if (node-&gt;document().isImageDocument()) {
+            if (HTMLImageElement* imageElement = static_cast&lt;ImageDocument&amp;&gt;(node-&gt;document()).imageElement()) {
+                renderRect = imageElement-&gt;renderRect(&amp;isReplaced);
+                origin = renderRect.center();
+                isReplaced = true;
+            }
+        }
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">         double viewportMinimumScale = 0;
</span><span class="cx">         double viewportMaximumScale = std::numeric_limits&lt;double&gt;::max();
</span></span></pre>
</div>
</div>

</body>
</html>