REGRESSION (r192098): Content missing after copy and paste to Notes App on retina...
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 May 2016 17:35:30 +0000 (17:35 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 May 2016 17:35:30 +0000 (17:35 +0000)
commit375d7d08b2b24f50edc66ab17eeae36f159a0e04
tree563c3447416582dac9c7119fdd991cff4233ba3b
parentee4c789485db66326bdcda08123f1f463b43f075
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.

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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
41 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/images/hidpi-srcset-copy-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/images/hidpi-srcset-copy.html [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image1-620x442.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image2-1024x731.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image2-1400x1000.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image2-300x214.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image2-620x442.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image2-840x600.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image3-250x178.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image3-615x438.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image3-620x440.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image3-700x498.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image3-840x598.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image3.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image4-1024x612.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image4-300x179.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image4-620x370.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image4-768x459.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image4-840x502.jpg [new file with mode: 0644]
LayoutTests/http/tests/resources/img-srcset/image4-940x560.jpg [new file with mode: 0644]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/editing/cocoa/HTMLConverter.mm
Source/WebCore/html/HTMLImageElement.cpp
Tools/ChangeLog
Tools/DumpRenderTree/TestRunner.cpp
Tools/DumpRenderTree/TestRunner.h
Tools/DumpRenderTree/mac/TestRunnerMac.mm
Tools/DumpRenderTree/win/TestRunnerWin.cpp
Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestController.h
Tools/WebKitTestRunner/TestInvocation.cpp
Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm