<!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>[200945] 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/200945">200945</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2016-05-16 10:35:30 -0700 (Mon, 16 May 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/192098">r192098</a>): Content missing after copy and paste to Notes App on retina displays
https://bugs.webkit.org/show_bug.cgi?id=157630
<rdar://problem/25277577>
Reviewed by Simon Fraser.
Source/WebCore:
Tested by http/tests/images/hidpi-srcset-copy.html
The code to create a WebArchive (or other representation) of a webpage was using the 'src' attribute of
the image element, which might be changed to reflect the optimal image dimensions for a specific
display. Instead, we should use the 'imageSourceURL' method of the Element class so we get the correct
'original' image URL in our cached resources.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_processElement): Use 'imageSourceURL', rather than getting the raw 'src' attribute.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::addSubresourceAttributeURLs): Ditto.
Tools:
Update test infrastructure to support checking the number of images in the pasteboard.
* DumpRenderTree/TestRunner.cpp:
(imageCountInGeneralPasteboardCallback): Added.
(TestRunner::staticFunctions):
* DumpRenderTree/TestRunner.h:
* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::imageCountInGeneralPasteboard): Added.
* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::imageCountInGeneralPasteboard): Added stub method.
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::imageCountInGeneralPasteboard): Added.
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::imageCountInGeneralPasteboard): Added.
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::imageCountInGeneralPasteboard): Added stub implementation.
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): Handle copy message.
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::imageCountInGeneralPasteboard): Added.
LayoutTests:
* http/tests/images/hidpi-srcset-copy-expected.txt: Added.
* http/tests/images/hidpi-srcset-copy.html: Added.
* http/tests/resources/img-srcset: Added.
* http/tests/resources/img-srcset/image1-620x442.jpg: Added.
* http/tests/resources/img-srcset/image2-1024x731.jpg: Added.
* http/tests/resources/img-srcset/image2-1400x1000.jpg: Added.
* http/tests/resources/img-srcset/image2-300x214.jpg: Added.
* http/tests/resources/img-srcset/image2-620x442.jpg: Added.
* http/tests/resources/img-srcset/image2-840x600.jpg: Added.
* http/tests/resources/img-srcset/image3-250x178.jpg: Added.
* http/tests/resources/img-srcset/image3-615x438.jpg: Added.
* http/tests/resources/img-srcset/image3-620x440.jpg: Added.
* http/tests/resources/img-srcset/image3-700x498.jpg: Added.
* http/tests/resources/img-srcset/image3-840x598.jpg: Added.
* http/tests/resources/img-srcset/image3.jpg: Added.
* http/tests/resources/img-srcset/image4-1024x612.jpg: Added.
* http/tests/resources/img-srcset/image4-300x179.jpg: Added.
* http/tests/resources/img-srcset/image4-620x370.jpg: Added.
* http/tests/resources/img-srcset/image4-768x459.jpg: Added.
* http/tests/resources/img-srcset/image4-840x502.jpg: Added.
* http/tests/resources/img-srcset/image4-940x560.jpg: Added.
* platform/efl/TestExpectations: No pasteboard implementation. Skip.
* platform/gtk/TestExpectations: Ditto.
* platform/win/TestExpectations: Ditto.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformeflTestExpectations">trunk/LayoutTests/platform/efl/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreeditingcocoaHTMLConvertermm">trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLImageElementcpp">trunk/Source/WebCore/html/HTMLImageElement.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeTestRunnercpp">trunk/Tools/DumpRenderTree/TestRunner.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeTestRunnerh">trunk/Tools/DumpRenderTree/TestRunner.h</a></li>
<li><a href="#trunkToolsDumpRenderTreemacTestRunnerMacmm">trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreewinTestRunnerWincpp">trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl">trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundleh">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/WebKitTestRunner/TestController.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllerh">trunk/Tools/WebKitTestRunner/TestController.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestInvocationcpp">trunk/Tools/WebKitTestRunner/TestInvocation.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnercocoaTestControllerCocoamm">trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestsimageshidpisrcsetcopyexpectedtxt">trunk/LayoutTests/http/tests/images/hidpi-srcset-copy-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsimageshidpisrcsetcopyhtml">trunk/LayoutTests/http/tests/images/hidpi-srcset-copy.html</a></li>
<li>trunk/LayoutTests/http/tests/resources/img-srcset/</li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage1620x442jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image1-620x442.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage21024x731jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image2-1024x731.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage21400x1000jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image2-1400x1000.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage2300x214jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image2-300x214.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage2620x442jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image2-620x442.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage2840x600jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image2-840x600.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage3250x178jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image3-250x178.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage3615x438jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image3-615x438.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage3620x440jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image3-620x440.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage3700x498jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image3-700x498.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage3840x598jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image3-840x598.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage3jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image3.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage41024x612jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image4-1024x612.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage4300x179jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image4-300x179.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage4620x370jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image4-620x370.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage4768x459jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image4-768x459.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage4840x502jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image4-840x502.jpg</a></li>
<li><a href="#trunkLayoutTestshttptestsresourcesimgsrcsetimage4940x560jpg">trunk/LayoutTests/http/tests/resources/img-srcset/image4-940x560.jpg</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/LayoutTests/ChangeLog        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-05-16 Brent Fulgham <bfulgham@apple.com>
+
+ REGRESSION (r192098): Content missing after copy and paste to Notes App on retina displays
+ https://bugs.webkit.org/show_bug.cgi?id=157630
+ <rdar://problem/25277577>
+
+ Reviewed by Simon Fraser.
+
+ * http/tests/images/hidpi-srcset-copy-expected.txt: Added.
+ * http/tests/images/hidpi-srcset-copy.html: Added.
+ * http/tests/resources/img-srcset: Added.
+ * http/tests/resources/img-srcset/image1-620x442.jpg: Added.
+ * http/tests/resources/img-srcset/image2-1024x731.jpg: Added.
+ * http/tests/resources/img-srcset/image2-1400x1000.jpg: Added.
+ * http/tests/resources/img-srcset/image2-300x214.jpg: Added.
+ * http/tests/resources/img-srcset/image2-620x442.jpg: Added.
+ * http/tests/resources/img-srcset/image2-840x600.jpg: Added.
+ * http/tests/resources/img-srcset/image3-250x178.jpg: Added.
+ * http/tests/resources/img-srcset/image3-615x438.jpg: Added.
+ * http/tests/resources/img-srcset/image3-620x440.jpg: Added.
+ * http/tests/resources/img-srcset/image3-700x498.jpg: Added.
+ * http/tests/resources/img-srcset/image3-840x598.jpg: Added.
+ * http/tests/resources/img-srcset/image3.jpg: Added.
+ * http/tests/resources/img-srcset/image4-1024x612.jpg: Added.
+ * http/tests/resources/img-srcset/image4-300x179.jpg: Added.
+ * http/tests/resources/img-srcset/image4-620x370.jpg: Added.
+ * http/tests/resources/img-srcset/image4-768x459.jpg: Added.
+ * http/tests/resources/img-srcset/image4-840x502.jpg: Added.
+ * http/tests/resources/img-srcset/image4-940x560.jpg: Added.
+ * platform/efl/TestExpectations: No pasteboard implementation. Skip.
+ * platform/gtk/TestExpectations: Ditto.
+ * platform/win/TestExpectations: Ditto.
+
</ins><span class="cx"> 2016-05-16 Joanmarie Diggs <jdiggs@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Unreviewed gardening
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsimageshidpisrcsetcopyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/images/hidpi-srcset-copy-expected.txt (0 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/images/hidpi-srcset-copy-expected.txt         (rev 0)
+++ trunk/LayoutTests/http/tests/images/hidpi-srcset-copy-expected.txt        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+Tests that we get the correct number of images when copying under different display resolutions.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+PASS Found all 4 images at 1x Resolution.
+PASS Found all 4 images at 2x Resolution.
+PASS Found all 4 images at 3x Resolution.
+Image 1
+
+
+Image 2
+
+
+Image 3
+
+
+Image 4
+
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsimageshidpisrcsetcopyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/images/hidpi-srcset-copy.html (0 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/images/hidpi-srcset-copy.html         (rev 0)
+++ trunk/LayoutTests/http/tests/images/hidpi-srcset-copy.html        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test-pre.js"></script>
+<script type="text/javascript">
+ description("Tests that we get the correct number of images when copying under different display resolutions.");
+
+ var pixelRatio = 1;
+
+ if (window.testRunner) {
+ testRunner.dumpAsText(true);
+ testRunner.waitUntilDone();
+ }
+
+ function doCopy()
+ {
+ document.execCommand("selectAll", true);
+ document.execCommand("copy");
+ }
+
+ function checkCount()
+ {
+ var imageCount = testRunner.imageCountInGeneralPasteboard();
+ if (imageCount == 4)
+ testPassed("Found all 4 images at " + pixelRatio + "x Resolution.");
+ else
+ testFailed("Only found " + imageCount + " images at " + pixelRatio + "x Resolution.");
+ }
+
+ function doTest()
+ {
+ doCopy();
+ checkCount();
+ if (pixelRatio < 3) {
+ pixelRatio = pixelRatio + 1;
+ testRunner.setBackingScaleFactor(pixelRatio, doTest);
+ } else {
+ setTimeout(function() { testRunner.notifyDone(); }, 0);
+ }
+ }
+
+ function runTests()
+ {
+ if (window.testRunner)
+ testRunner.setBackingScaleFactor(pixelRatio, doTest);
+ }
+</script>
+</head>
+<body onLoad="runTests()">
+ <div id="images">
+ <p>Image 1</p>
+ <img src="http://127.0.0.1:8000/resources/img-srcset/image1-620x442.jpg">
+ <p>Image 2</p>
+ <img src="http://127.0.0.1:8000/resources/img-srcset/image2-1024x731.jpg"
+ srcset="http://127.0.0.1:8000/resources/img-srcset/image2-300x214.jpg 300w,
+ http://127.0.0.1:8000/resources/img-srcset/image2-1024x731.jpg 1024w,
+ http://127.0.0.1:8000/resources/img-srcset/image2-620x442.jpg 620w,
+ http://127.0.0.1:8000/resources/img-srcset/image2-840x600.jpg 840w,
+ http://127.0.0.1:8000/resources/img-srcset/image2-1400x1000.jpg 1400w"
+ sizes="(max-width: 1024px) 100vw, 1024px">
+ <p>Image 3</p>
+ <img src="http://127.0.0.1:8000/resources/img-srcset/image3-700x498.jpg"
+ srcset="http://127.0.0.1:8000/resources/img-srcset/image3-250x178.jpg 250w,
+ http://127.0.0.1:8000/resources/img-srcset/image3-700x498.jpg 700w,
+ http://127.0.0.1:8000/resources/img-srcset/image3-620x440.jpg 620w,
+ http://127.0.0.1:8000/resources/img-srcset/image3-615x438.jpg 615w,
+ http://127.0.0.1:8000/resources/img-srcset/image3-840x598.jpg 840w,
+ http://127.0.0.1:8000/resources/img-srcset/image3.jpg 1403w"
+ sizes="(max-width: 700px) 100vw, 700px">
+ <p>Image 4</p>
+ <img src="http://127.0.0.1:8000/resources/img-srcset/image4-1024x612.jpg"
+ srcset="http://127.0.0.1:8000/resources/img-srcset/image4-300x179.jpg 300w,
+ http://127.0.0.1:8000/resources/img-srcset/image4-1024x612.jpg 1024w,
+ http://127.0.0.1:8000/resources/img-srcset/image4-620x370.jpg 620w,
+ http://127.0.0.1:8000/resources/img-srcset/image4-840x502.jpg 840w,
+ http://127.0.0.1:8000/resources/img-srcset/image4-940x560.jpg 940w,
+ http://127.0.0.1:8000/resources/img-srcset/image4-768x459.jpg 768w"
+ sizes="(max-width: 1024px) 100vw, 1024px">
+ </div>
+ <div id="console"></div>
+</body>
+<script src="../../../resources/js-test-post.js"></script>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage1620x442jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image1-620x442.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image1-620x442.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage21024x731jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image2-1024x731.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image2-1024x731.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage21400x1000jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image2-1400x1000.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image2-1400x1000.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage2300x214jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image2-300x214.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image2-300x214.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage2620x442jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image2-620x442.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image2-620x442.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage2840x600jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image2-840x600.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image2-840x600.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage3250x178jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image3-250x178.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image3-250x178.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage3615x438jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image3-615x438.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image3-615x438.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage3620x440jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image3-620x440.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image3-620x440.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage3700x498jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image3-700x498.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image3-700x498.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage3840x598jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image3-840x598.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image3-840x598.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage3jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image3.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image3.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage41024x612jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image4-1024x612.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image4-1024x612.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage4300x179jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image4-300x179.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image4-300x179.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage4620x370jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image4-620x370.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image4-620x370.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage4768x459jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image4-768x459.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image4-768x459.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage4840x502jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image4-840x502.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image4-840x502.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsresourcesimgsrcsetimage4940x560jpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/http/tests/resources/img-srcset/image4-940x560.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/http/tests/resources/img-srcset/image4-940x560.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformeflTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/TestExpectations (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/TestExpectations        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/LayoutTests/platform/efl/TestExpectations        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1119,6 +1119,7 @@
</span><span class="cx">
</span><span class="cx"> # EFL port needs Pasteboard implementation, needs baselines.
</span><span class="cx"> webkit.org/b/84338 fast/forms/plaintext-mode-2.html [ Pass ]
</span><ins>+http/tests/images/hidpi-srcset-copy.html [ Skip ]
</ins><span class="cx">
</span><span class="cx"> # Controls are not zoomed.
</span><span class="cx"> webkit.org/b/102367 fast/forms/zoomed-controls.html [ Pass ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -2186,6 +2186,7 @@
</span><span class="cx">
</span><span class="cx"> # PasteBoard::plainText() does not support file names.
</span><span class="cx"> webkit.org/b/99070 editing/pasteboard/drag-files-to-editable-element.html [ Failure ]
</span><ins>+http/tests/images/hidpi-srcset-copy.html [ Skip ]
</ins><span class="cx">
</span><span class="cx"> # Opera-submitted tests to W3C for <track>, a lot of failures still.
</span><span class="cx"> webkit.org/b/103926 media/track/opera/idl/media-idl-tests.html [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/TestExpectations        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/LayoutTests/platform/win/TestExpectations        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1230,6 +1230,8 @@
</span><span class="cx"> # Assertion failure in replaySavedEvents
</span><span class="cx"> webkit.org/b/21796 editing/pasteboard/drop-text-events.html [ Skip ]
</span><span class="cx">
</span><ins>+http/tests/images/hidpi-srcset-copy.html [ Skip ]
+
</ins><span class="cx"> ###### Selection
</span><span class="cx"> editing/selection/ [ Pass Failure ]
</span><span class="cx"> # This test is flaky due to capitalization; perhaps a capslock keypress or something?
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Source/WebCore/ChangeLog        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-05-16 Brent Fulgham <bfulgham@apple.com>
+
+ REGRESSION (r192098): Content missing after copy and paste to Notes App on retina displays
+ https://bugs.webkit.org/show_bug.cgi?id=157630
+ <rdar://problem/25277577>
+
+ Reviewed by Simon Fraser.
+
+ Tested by http/tests/images/hidpi-srcset-copy.html
+
+ The code to create a WebArchive (or other representation) of a webpage was using the 'src' attribute of
+ the image element, which might be changed to reflect the optimal image dimensions for a specific
+ display. Instead, we should use the 'imageSourceURL' method of the Element class so we get the correct
+ 'original' image URL in our cached resources.
+
+ * editing/cocoa/HTMLConverter.mm:
+ (HTMLConverter::_processElement): Use 'imageSourceURL', rather than getting the raw 'src' attribute.
+ * html/HTMLImageElement.cpp:
+ (WebCore::HTMLImageElement::addSubresourceAttributeURLs): Ditto.
+
</ins><span class="cx"> 2016-05-16 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><span class="cx"> Random CachedFont.cpp cleanup.
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingcocoaHTMLConvertermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2016 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">@@ -1901,7 +1901,7 @@
</span><span class="cx"> retval = NO;
</span><span class="cx"> #endif
</span><span class="cx"> } else if (element.hasTagName(imgTag)) {
</span><del>- NSString *urlString = element.getAttribute(srcAttr);
</del><ins>+ NSString *urlString = element.imageSourceURL();
</ins><span class="cx"> if (urlString && [urlString length] > 0) {
</span><span class="cx"> NSURL *url = element.document().completeURL(stripLeadingAndTrailingHTMLSpaces(urlString));
</span><span class="cx"> if (!url)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLImageElement.cpp (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLImageElement.cpp        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Source/WebCore/html/HTMLImageElement.cpp        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx"> * (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2016 Apple Inc. All rights reserved.
</ins><span class="cx"> * Copyright (C) 2010 Google Inc. All rights reserved.
</span><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -542,7 +542,7 @@
</span><span class="cx"> {
</span><span class="cx"> HTMLElement::addSubresourceAttributeURLs(urls);
</span><span class="cx">
</span><del>- addSubresourceURL(urls, src());
</del><ins>+ addSubresourceURL(urls, document().completeURL(imageSourceURL()));
</ins><span class="cx"> // FIXME: What about when the usemap attribute begins with "#"?
</span><span class="cx"> addSubresourceURL(urls, document().completeURL(fastGetAttribute(usemapAttr)));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/ChangeLog        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-05-16 Brent Fulgham <bfulgham@apple.com>
+
+ REGRESSION (r192098): Content missing after copy and paste to Notes App on retina displays
+ https://bugs.webkit.org/show_bug.cgi?id=157630
+ <rdar://problem/25277577>
+
+ Reviewed by Simon Fraser.
+
+ Update test infrastructure to support checking the number of images in the pasteboard.
+
+ * DumpRenderTree/TestRunner.cpp:
+ (imageCountInGeneralPasteboardCallback): Added.
+ (TestRunner::staticFunctions):
+ * DumpRenderTree/TestRunner.h:
+ * DumpRenderTree/mac/TestRunnerMac.mm:
+ (TestRunner::imageCountInGeneralPasteboard): Added.
+ * DumpRenderTree/win/TestRunnerWin.cpp:
+ (TestRunner::imageCountInGeneralPasteboard): Added stub method.
+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::imageCountInGeneralPasteboard): Added.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::imageCountInGeneralPasteboard): Added.
+ * WebKitTestRunner/InjectedBundle/TestRunner.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::imageCountInGeneralPasteboard): Added stub implementation.
+ * WebKitTestRunner/TestController.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): Handle copy message.
+ * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+ (WTR::TestController::imageCountInGeneralPasteboard): Added.
+
</ins><span class="cx"> 2016-05-13 Dewei Zhu <dewei_zhu@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix JSBench which causes math domain error in run-benchmark script.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/TestRunner.cpp (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/TestRunner.cpp        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/DumpRenderTree/TestRunner.cpp        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007-2016 Apple Inc. All rights reserved.
</ins><span class="cx"> * Copyright (C) 2010 Joone Hur <joone@kldp.org>
</span><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -1747,6 +1747,14 @@
</span><span class="cx"> return JSValueMakeNumber(context, WTF::currentTime());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static JSValueRef imageCountInGeneralPasteboardCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac & windows implementation
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
+
+ return JSValueMakeNumber(context, controller->imageCountInGeneralPasteboard());
+}
+
</ins><span class="cx"> // Static Values
</span><span class="cx">
</span><span class="cx"> static JSValueRef getTimeoutCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="lines">@@ -2175,6 +2183,7 @@
</span><span class="cx"> { "numberOfDFGCompiles", numberOfDFGCompiles, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx"> { "neverInlineFunction", neverInlineFunction, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx"> { "accummulateLogsForChannel", accummulateLogsForChannel, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><ins>+ { "imageCountInGeneralPasteboard", imageCountInGeneralPasteboardCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</ins><span class="cx"> { 0, 0, 0 }
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeTestRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/TestRunner.h (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/TestRunner.h        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/DumpRenderTree/TestRunner.h        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007-2016 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">@@ -359,6 +359,8 @@
</span><span class="cx"> void setCustomTimeout(int duration) { m_timeout = duration; }
</span><span class="cx"> double timeout() { return m_timeout; }
</span><span class="cx">
</span><ins>+ unsigned imageCountInGeneralPasteboard() const;
+
</ins><span class="cx"> private:
</span><span class="cx"> TestRunner(const std::string& testURL, const std::string& expectedPixelHash);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacTestRunnerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007-2016 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">@@ -1224,3 +1224,33 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static NSString * const WebArchivePboardType = @"Apple Web Archive pasteboard type";
+static NSString * const WebSubresourcesKey = @"WebSubresources";
+static NSString * const WebSubframeArchivesKey = @"WebResourceMIMEType like 'image*'";
+
+unsigned TestRunner::imageCountInGeneralPasteboard() const
+{
+#if PLATFORM(MAC)
+ NSData *data = [[NSPasteboard generalPasteboard] dataForType:WebArchivePboardType];
+#elif PLATFORM(IOS)
+ NSData *data = [[UIPasteboard generalPasteboard] valueForPasteboardType:WebArchivePboardType];
+#endif
+ if (!data)
+ return 0;
+
+ NSError *error = nil;
+ id webArchive = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:NULL error:&error];
+ if (error) {
+ NSLog(@"Encountered error while serializing Web Archive pasteboard data: %@", error);
+ return 0;
+ }
+
+ NSArray *subItems = [NSArray arrayWithArray:[webArchive objectForKey:WebSubresourcesKey]];
+ NSPredicate *predicate = [NSPredicate predicateWithFormat:WebSubframeArchivesKey];
+ NSArray *imagesArray = [subItems filteredArrayUsingPredicate:predicate];
+
+ if (!imagesArray)
+ return 0;
+
+ return imagesArray.count;
+}
</ins></span></pre></div>
<a id="trunkToolsDumpRenderTreewinTestRunnerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1333,3 +1333,10 @@
</span><span class="cx"> {
</span><span class="cx"> // FIXME: Implement.
</span><span class="cx"> }
</span><ins>+
+unsigned TestRunner::imageCountInGeneralPasteboard() const
+{
+ printf("ERROR: TestRunner::imageCountInGeneralPasteboard() not implemented\n");
+ return 0;
+}
+
</ins></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2016 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">@@ -219,6 +219,8 @@
</span><span class="cx"> void installDidEndSwipeCallback(object callback);
</span><span class="cx"> void installDidRemoveSwipeSnapshotCallback(object callback);
</span><span class="cx">
</span><ins>+ unsigned long imageCountInGeneralPasteboard();
+
</ins><span class="cx"> // UI Process Testing
</span><span class="cx"> void runUIScript(DOMString script, object callback);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -552,6 +552,16 @@
</span><span class="cx"> return WKBooleanGetValue(isActive.get());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+unsigned InjectedBundle::imageCountInGeneralPasteboard() const
+{
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ImageCountInGeneralPasteboard"));
+ WKTypeRef resultToPass = 0;
+ WKBundlePagePostSynchronousMessageForTesting(page()->page(), messageName.get(), 0, &resultToPass);
+ WKRetainPtr<WKUInt64Ref> imageCount(AdoptWK, static_cast<WKUInt64Ref>(resultToPass));
+
+ return static_cast<unsigned>(WKUInt64GetValue(imageCount.get()));
+}
+
</ins><span class="cx"> void InjectedBundle::setUserMediaPermission(bool enabled)
</span><span class="cx"> {
</span><span class="cx"> auto messageName = adoptWK(WKStringCreateWithUTF8CString("SetUserMediaPermission"));
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundleh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2016 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">@@ -121,6 +121,8 @@
</span><span class="cx">
</span><span class="cx"> bool isAllowedHost(WKStringRef);
</span><span class="cx">
</span><ins>+ unsigned imageCountInGeneralPasteboard() const;
+
</ins><span class="cx"> private:
</span><span class="cx"> InjectedBundle();
</span><span class="cx"> ~InjectedBundle();
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -178,6 +178,11 @@
</span><span class="cx"> m_waitToDump = false;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+unsigned TestRunner::imageCountInGeneralPasteboard() const
+{
+ return InjectedBundle::singleton().imageCountInGeneralPasteboard();
+}
+
</ins><span class="cx"> void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
</span><span class="cx"> {
</span><span class="cx"> WKRetainPtr<WKStringRef> sourceWK = toWK(source);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -322,6 +322,8 @@
</span><span class="cx">
</span><span class="cx"> void accummulateLogsForChannel(JSStringRef channel);
</span><span class="cx">
</span><ins>+ unsigned imageCountInGeneralPasteboard() const;
+
</ins><span class="cx"> private:
</span><span class="cx"> TestRunner();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -2163,6 +2163,12 @@
</span><span class="cx"> {
</span><span class="cx">
</span><span class="cx"> }
</span><ins>+
+unsigned TestController::imageCountInGeneralPasteboard() const
+{
+ return 0;
+}
+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> } // namespace WTR
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.h (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.h        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/WebKitTestRunner/TestController.h        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010, 2015-2016 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">@@ -111,6 +111,8 @@
</span><span class="cx"> // Page Visibility.
</span><span class="cx"> void setHidden(bool);
</span><span class="cx">
</span><ins>+ unsigned imageCountInGeneralPasteboard() const;
+
</ins><span class="cx"> bool resetStateToConsistentValues(const TestOptions&);
</span><span class="cx"> void resetPreferencesToConsistentValues(const TestOptions&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestInvocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
</ins><span class="cx"> * Copyright (C) 2012 Intel Corporation. All rights reserved.
</span><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -708,6 +708,12 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (WKStringIsEqualToUTF8CString(messageName, "ImageCountInGeneralPasteboard")) {
+ unsigned count = TestController::singleton().imageCountInGeneralPasteboard();
+ WKRetainPtr<WKUInt64Ref> result(AdoptWK, WKUInt64Create(count));
+ return result;
+ }
+
</ins><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnercocoaTestControllerCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (200944 => 200945)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm        2016-05-16 17:22:13 UTC (rev 200944)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm        2016-05-16 17:35:30 UTC (rev 200945)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2016 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">@@ -142,4 +142,35 @@
</span><span class="cx"> setCrashReportApplicationSpecificInformationToURL(testInvocation.url());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static NSString * const WebArchivePboardType = @"Apple Web Archive pasteboard type";
+static NSString * const WebSubresourcesKey = @"WebSubresources";
+static NSString * const WebSubframeArchivesKey = @"WebResourceMIMEType like 'image*'";
+
+unsigned TestController::imageCountInGeneralPasteboard() const
+{
+#if PLATFORM(MAC)
+ NSData *data = [[NSPasteboard generalPasteboard] dataForType:WebArchivePboardType];
+#elif PLATFORM(IOS)
+ NSData *data = [[UIPasteboard generalPasteboard] valueForPasteboardType:WebArchivePboardType];
+#endif
+ if (!data)
+ return 0;
+
+ NSError *error = nil;
+ id webArchive = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:NULL error:&error];
+ if (error) {
+ NSLog(@"Encountered error while serializing Web Archive pasteboard data: %@", error);
+ return 0;
+ }
+
+ NSArray *subItems = [NSArray arrayWithArray:[webArchive objectForKey:WebSubresourcesKey]];
+ NSPredicate *predicate = [NSPredicate predicateWithFormat:WebSubframeArchivesKey];
+ NSArray *imagesArray = [subItems filteredArrayUsingPredicate:predicate];
+
+ if (!imagesArray)
+ return 0;
+
+ return imagesArray.count;
+}
+
</ins><span class="cx"> } // namespace WTR
</span></span></pre>
</div>
</div>
</body>
</html>