DeferredLoadingScope incorrectly disabled images or enables deferred loading
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Dec 2017 06:48:48 +0000 (06:48 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Dec 2017 06:48:48 +0000 (06:48 +0000)
commit1163c25e4ca9837c6a10cb8ecf504a6fd9705f8d
treefd985b94c8a5267f7b9835aca26732dd93b1c012
parent27c3d63e2fab1c7841c00239dd039247d216092f
DeferredLoadingScope incorrectly disabled images or enables deferred loading
https://bugs.webkit.org/show_bug.cgi?id=181077

Reviewed by Wenson Hsieh.

Source/WebCore:

Fixed the bug that DeferredLoadingScope::~DeferredLoadingScope was checking the wrong flag
for restoring the disabledness of images and deferred loading.

Test: editing/pasteboard/pasting-with-images-disabled-should-not-enable-deferred-loading.html

* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::DeferredLoadingScope::~DeferredLoadingScope): Fixed the bug.
* testing/Internals.cpp:
(WebCore::Internals::pageDefersLoading): Added for testing.
* testing/Internals.h:
* testing/Internals.idl: Added pageDefersLoading.

LayoutTests:

Added a regression test.

* editing/pasteboard/pasting-with-images-disabled-should-not-enable-deferred-loading-expected.txt: Added.
* editing/pasteboard/pasting-with-images-disabled-should-not-enable-deferred-loading.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/pasting-with-images-disabled-should-not-enable-deferred-loading-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/pasting-with-images-disabled-should-not-enable-deferred-loading.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl