Loading should be disabled while constructing the fragment in WebContentReader::readW...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Oct 2017 20:50:20 +0000 (20:50 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Oct 2017 20:50:20 +0000 (20:50 +0000)
commit25309767fed3bf5b362dff3ed6df01c0b2bbcb3f
treef42403d8319424861829d853d07d6e79a3b6ff91
parent7f0e129122f49801d91ee6e59c58b6761d325da9
Loading should be disabled while constructing the fragment in WebContentReader::readWebArchive
https://bugs.webkit.org/show_bug.cgi?id=178118

Reviewed by Antti Koivisto.

Source/WebCore:

Disable image loading while constructing the document fragment in WebContentReader::readWebArchive
as we do in createFragmentAndAddResources for RTF/RTFD. This refactoring is needed to start using
blob URL in the pasted document fragment for webkit.org/b/124391.

Also modified WebContentReader::readWebArchive to take a reference to SharedBuffer instead of a pointer.

No new tests since existing tests have been updated to cover this behavior change.

* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readWebArchive): Use DeferredLoadingScope to disable the loader and images
while constructing the document fragment.
* platform/Pasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::readPasteboardWebContentDataForType):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::read):

LayoutTests:

Updated the existing tests to wait for images to load in each step explicitly instead of relying on
them being loaded synchronously or that it's loaded within 100-200ms.

* editing/pasteboard/4641033.html:
* editing/pasteboard/4947130.html:
* editing/pasteboard/4989774.html:
* editing/pasteboard/drag-selected-image-to-contenteditable.html:
* editing/selection/drag-to-contenteditable-iframe.html:
* platform/ios/TestExpectations: Skipped editing/selection/drag-to-contenteditable-iframe.html on iOS
since we don't support testing drag & drop on iOS. Also added [ Skip ] to other entires there.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/4641033.html
LayoutTests/editing/pasteboard/4947130.html
LayoutTests/editing/pasteboard/4989774.html
LayoutTests/editing/pasteboard/drag-selected-image-to-contenteditable.html
LayoutTests/editing/selection/drag-to-contenteditable-iframe.html
LayoutTests/platform/ios/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/editing/WebContentReader.h
Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm
Source/WebCore/platform/Pasteboard.h
Source/WebCore/platform/ios/PasteboardIOS.mm
Source/WebCore/platform/mac/PasteboardMac.mm