WebKit Bugzilla
Attachment 341465 Details for
Bug 186042
: [Extra zoom mode] "Significant area painted" rendering progress event is rarely fired
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186042-20180528193123.patch (text/plain), 17.08 KB, created by
Wenson Hsieh
on 2018-05-28 19:31:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-05-28 19:31:24 PDT
Size:
17.08 KB
patch
obsolete
>Subversion Revision: 232250 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 32a42d1f98a15235c9eb70a2831e6fc42cefb89e..eaf265ed3abc3d2a2a58b6f4aa35ac44457de9b3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2018-05-28 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Extra zoom mode] "Significant area painted" rendering progress event is rarely fired >+ https://bugs.webkit.org/show_bug.cgi?id=186042 >+ <rdar://problem/40604182> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Makes a minor tweak to the size of the relevant view rect in extra zoom mode, such that it's no wider than the >+ visible content rect. Previously, the width of this rect has hard-coded to a value optimized for macOS (980), >+ which makes it difficult for content laid out at device width in extra zoom mode to cover a significant portion >+ of the relevant view rect. >+ >+ Test: RenderingProgressTests.FirstPaintWithSignificantArea >+ >+ * page/Page.cpp: >+ (WebCore::relevantViewRect): >+ > 2018-05-28 Zalan Bujtas <zalan@apple.com> > > [LFC] Add Rect interface to Display::Box >diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp >index a3d874d3bb0904b8927c7baaf4025af266101954..500e34e2c28b81edae4507ccf390e1b2f662972f 100644 >--- a/Source/WebCore/page/Page.cpp >+++ b/Source/WebCore/page/Page.cpp >@@ -1856,14 +1856,19 @@ void Page::resetRelevantPaintedObjectCounter() > > static LayoutRect relevantViewRect(RenderView* view) > { >+ LayoutRect viewRect = view->viewRect(); >+ >+ float relevantViewRectWidth = 980; >+#if ENABLE(EXTRA_ZOOM_MODE) >+ relevantViewRectWidth = std::min<float>(viewRect.width().toFloat(), relevantViewRectWidth); >+#endif >+ > // DidHitRelevantRepaintedObjectsAreaThreshold is a LayoutMilestone intended to indicate that > // a certain relevant amount of content has been drawn to the screen. This is the rect that > // has been determined to be relevant in the context of this goal. We may choose to tweak > // the rect over time, much like we may choose to tweak gMinimumPaintedAreaRatio and > // gMaximumUnpaintedAreaRatio. But this seems to work well right now. >- LayoutRect relevantViewRect = LayoutRect(0, 0, 980, 1300); >- >- LayoutRect viewRect = view->viewRect(); >+ LayoutRect relevantViewRect { 0, 0, relevantViewRectWidth, 1300 }; > // If the viewRect is wider than the relevantViewRect, center the relevantViewRect. > if (viewRect.width() > relevantViewRect.width()) > relevantViewRect.setX((viewRect.width() - relevantViewRect.width()) / 2); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index ab7261f1a377c362039757370ea4d9f33b2d1423..e4232c5caf126952e4dfe8bdcf4fa5590f7e0ab0 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,23 @@ >+2018-05-28 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Extra zoom mode] "Significant area painted" rendering progress event is rarely fired >+ https://bugs.webkit.org/show_bug.cgi?id=186042 >+ <rdar://problem/40604182> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Adds a new API test to check that the "significant area painting" rendering milestone is dispatched when a >+ significant portion of the page has been painted before document load is finished. >+ >+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: >+ * TestWebKitAPI/Tests/WebKitCocoa/paint-significant-area-milestone.html: Added. >+ * TestWebKitAPI/Tests/ios/RenderingProgressTests.mm: Added. >+ (-[TimeoutSchemeHandler webView:stopURLSchemeTask:]): >+ (-[TimeoutSchemeHandler webView:startURLSchemeTask:]): >+ (-[RenderingProgressHandler initWithHandler:]): >+ (-[RenderingProgressHandler _webView:renderingProgressDidChange:]): >+ (TEST): >+ > 2018-05-28 Thibault Saunier <tsaunier@igalia.com> > > [GStreamer] Handle changes in the "drm-preferred-decryption-system-id" NEED_CONTEXT message. >diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >index d00694c3ec7577f4fd3b6c646ce2d2b5aaa29dc1..6680845d44bd8f0cfff3fa17acbcbe2671885145 100644 >--- a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >+++ b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >@@ -780,6 +780,7 @@ > F457A9D6202D68AF00F7E9D5 /* DataTransfer.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F457A9B3202D535300F7E9D5 /* DataTransfer.html */; }; > F45B63FB1F197F4A009D38B9 /* image-map.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F45B63FA1F197F33009D38B9 /* image-map.html */; }; > F45B63FE1F19D410009D38B9 /* ActionSheetTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45B63FC1F19D410009D38B9 /* ActionSheetTests.mm */; }; >+ F464AF9220BB66EA007F9B18 /* RenderingProgressTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F464AF9120BB66EA007F9B18 /* RenderingProgressTests.mm */; }; > F46849BE1EEF58E400B937FE /* UIPasteboardTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F46849BD1EEF58E400B937FE /* UIPasteboardTests.mm */; }; > F46849C01EEF5EF300B937FE /* rich-and-plain-text.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F46849BF1EEF5EDC00B937FE /* rich-and-plain-text.html */; }; > F469FB241F01804B00401539 /* contenteditable-and-target.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F469FB231F01803500401539 /* contenteditable-and-target.html */; }; >@@ -793,6 +794,7 @@ > F4A9202F1FEE34E900F59590 /* apple-data-url.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4A9202E1FEE34C800F59590 /* apple-data-url.html */; }; > F4AB578A1F65165400DB0DA1 /* custom-draggable-div.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4AB57891F65164B00DB0DA1 /* custom-draggable-div.html */; }; > F4B825D81EF4DBFB006E417F /* compressed-files.zip in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4B825D61EF4DBD4006E417F /* compressed-files.zip */; }; >+ F4B86D4F20BCD5B20099A7E6 /* paint-significant-area-milestone.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4B86D4E20BCD5970099A7E6 /* paint-significant-area-milestone.html */; }; > F4BFA68E1E4AD08000154298 /* DragAndDropPasteboardTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4BFA68C1E4AD08000154298 /* DragAndDropPasteboardTests.mm */; }; > F4C2AB221DD6D95E00E06D5B /* enormous-video-with-sound.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4C2AB211DD6D94100E06D5B /* enormous-video-with-sound.html */; }; > F4C8797F2059D8D3009CD00B /* ScrollViewInsetTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4C8797E2059D8D3009CD00B /* ScrollViewInsetTests.mm */; }; >@@ -1075,6 +1077,7 @@ > CEBCA13A1E3A807A00C73293 /* page-without-csp.html in Copy Resources */, > A1C4FB731BACD1CA003742D0 /* pages.pages in Copy Resources */, > A57A34F216AF6B2B00C2501F /* PageVisibilityStateWithWindowChanges.html in Copy Resources */, >+ F4B86D4F20BCD5B20099A7E6 /* paint-significant-area-milestone.html in Copy Resources */, > A1409AD91E7254D4004949D9 /* password-protected.pages in Copy Resources */, > 9BD6D3A71F7B21DC00BD4962 /* paste-image.html in Copy Resources */, > 9B7D740F1F8378770006C432 /* paste-rtfd.html in Copy Resources */, >@@ -1952,6 +1955,7 @@ > F457A9B6202D5CDC00F7E9D5 /* PasteMixedContent.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteMixedContent.mm; sourceTree = "<group>"; }; > F45B63FA1F197F33009D38B9 /* image-map.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "image-map.html"; sourceTree = "<group>"; }; > F45B63FC1F19D410009D38B9 /* ActionSheetTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ActionSheetTests.mm; sourceTree = "<group>"; }; >+ F464AF9120BB66EA007F9B18 /* RenderingProgressTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderingProgressTests.mm; sourceTree = "<group>"; }; > F46849BD1EEF58E400B937FE /* UIPasteboardTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = UIPasteboardTests.mm; sourceTree = "<group>"; }; > F46849BF1EEF5EDC00B937FE /* rich-and-plain-text.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "rich-and-plain-text.html"; sourceTree = "<group>"; }; > F469FB231F01803500401539 /* contenteditable-and-target.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "contenteditable-and-target.html"; sourceTree = "<group>"; }; >@@ -1966,6 +1970,7 @@ > F4A9202E1FEE34C800F59590 /* apple-data-url.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "apple-data-url.html"; sourceTree = "<group>"; }; > F4AB57891F65164B00DB0DA1 /* custom-draggable-div.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "custom-draggable-div.html"; sourceTree = "<group>"; }; > F4B825D61EF4DBD4006E417F /* compressed-files.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = "compressed-files.zip"; sourceTree = "<group>"; }; >+ F4B86D4E20BCD5970099A7E6 /* paint-significant-area-milestone.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "paint-significant-area-milestone.html"; sourceTree = "<group>"; }; > F4BFA68C1E4AD08000154298 /* DragAndDropPasteboardTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragAndDropPasteboardTests.mm; sourceTree = "<group>"; }; > F4C2AB211DD6D94100E06D5B /* enormous-video-with-sound.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "enormous-video-with-sound.html"; sourceTree = "<group>"; }; > F4C8797E2059D8D3009CD00B /* ScrollViewInsetTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollViewInsetTests.mm; sourceTree = "<group>"; }; >@@ -2398,6 +2403,7 @@ > F4D4F3B71E4E36E400BB2767 /* DataInteractionTests.mm */, > 574F55CE204D3763002948C6 /* LocalAuthenticator.mm */, > 7560917719259C59009EF06E /* MemoryCacheAddImageToCacheIOS.mm */, >+ F464AF9120BB66EA007F9B18 /* RenderingProgressTests.mm */, > F4C8797E2059D8D3009CD00B /* ScrollViewInsetTests.mm */, > CE6E819F20A6935F00E2C80F /* SetTimeoutFunction.mm */, > 4433A395208044130091ED57 /* SynchronousTimeoutTests.mm */, >@@ -2571,6 +2577,7 @@ > CEBCA1351E3A803400C73293 /* page-with-csp.html */, > CEBCA1361E3A803400C73293 /* page-without-csp-iframe.html */, > CEBCA1371E3A803400C73293 /* page-without-csp.html */, >+ F4B86D4E20BCD5970099A7E6 /* paint-significant-area-milestone.html */, > A1409AD81E7254AC004949D9 /* password-protected.pages */, > 9BD6D3A61F7B21CC00BD4962 /* paste-image.html */, > 9B7D740E1F8377E60006C432 /* paste-rtfd.html */, >@@ -3724,6 +3731,7 @@ > 7CCE7EC91A411A7E00447C4C /* RenderedImageFromDOMNode.mm in Sources */, > 7CCE7ECA1A411A7E00447C4C /* RenderedImageFromDOMRange.mm in Sources */, > A12DDBFB1E836F0700CF6CAE /* RenderedImageWithOptions.mm in Sources */, >+ F464AF9220BB66EA007F9B18 /* RenderingProgressTests.mm in Sources */, > 7C83E0C41D0A654200FEBCF3 /* RequiresUserActionForPlayback.mm in Sources */, > 7CCE7F0E1A411AE600447C4C /* ResizeReversePaginatedWebView.cpp in Sources */, > 7CCE7F0F1A411AE600447C4C /* ResizeWindowAfterCrash.cpp in Sources */, >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/paint-significant-area-milestone.html b/Tools/TestWebKitAPI/Tests/WebKitCocoa/paint-significant-area-milestone.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f071d0f6655e9686b891b4218826f0aa85cbacff >--- /dev/null >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/paint-significant-area-milestone.html >@@ -0,0 +1,35 @@ >+<!DOCTYPE html> >+<html> >+ <meta name="viewport" content="width=device-width"> >+ <head> >+ <style> >+ body { >+ width: 100%; >+ height: 100%; >+ margin: 0; >+ line-height: 200%; >+ font-size: 16px; >+ } >+ >+ svg { >+ width: 75px; >+ height: 75px; >+ } >+ </style> >+ </head> >+ <body> >+ <h2>This is some placeholder text</h2> >+ <br> >+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> >+ <path d="M30,1h40l29,29v40l-29,29h-40l-29-29v-40z" stroke="black" fill="none"/> >+ <path d="M31,3h38l28,28v38l-28,28h-38l-28-28v-38z" stroke="white" fill="black"/> >+ </svg> >+ <p>Lorem ipsum dolor sit amet, <a href="#">consectetur adipiscing elit</a>.</p> >+ <p>Aenean laoreet nisi felis, <strong>eu scelerisque dolor imperdiet in.</strong> Sed at porttitor purus, in placerat justo.</p> >+ <h2>This is some placeholder text</h2> >+ <p>Phasellus nec mattis ipsum, <a href="#">eget pellentesque est</a>. At vero eos et accusam et justo duo dolores et ea rebum.</p> >+ <p>Sed lacinia nisi quis velit aliquam, et placerat augue posuere. Nullam sed fermentum leo, a cursus tellus. <strong>Ut sed mattis erat,</strong> quis volutpat leo. Duis ac cursus metus. Nullam eu libero eget quam scelerisque dictum.</p> >+ <p>Duis ac cursus metus. Nullam eu libero eget quam scelerisque dictum.</p> >+ <script src="timeout://script.html"></script> >+ </body> >+</html> >diff --git a/Tools/TestWebKitAPI/Tests/ios/RenderingProgressTests.mm b/Tools/TestWebKitAPI/Tests/ios/RenderingProgressTests.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..831bd4932194b50ddf6927575750cdf049c1f928 >--- /dev/null >+++ b/Tools/TestWebKitAPI/Tests/ios/RenderingProgressTests.mm >@@ -0,0 +1,95 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+ >+#include "PlatformUtilities.h" >+#include "TestWKWebView.h" >+#include <WebKit/WKNavigationDelegatePrivate.h> >+#include <wtf/BlockPtr.h> >+ >+// This scheme handler will cause all subresource requests with the timeout:// URL scheme to time out. >+@interface TimeoutSchemeHandler : NSObject<WKURLSchemeHandler> >+@end >+ >+@implementation TimeoutSchemeHandler >+ >+- (void)webView:(WKWebView *)webView stopURLSchemeTask:(id<WKURLSchemeTask>)urlSchemeTask >+{ >+} >+ >+- (void)webView:(WKWebView *)webView startURLSchemeTask:(id<WKURLSchemeTask>)urlSchemeTask >+{ >+} >+ >+@end >+ >+@interface RenderingProgressHandler : NSObject<WKNavigationDelegatePrivate> >+ >+- (instancetype)initWithHandler:(void (^)(_WKRenderingProgressEvents))handler; >+ >+@end >+ >+@implementation RenderingProgressHandler { >+ BlockPtr<void(_WKRenderingProgressEvents)> _handler; >+} >+ >+- (instancetype)initWithHandler:(void (^)(_WKRenderingProgressEvents))handler >+{ >+ if (self = [super init]) >+ _handler = handler; >+ return self; >+} >+ >+- (void)_webView:(WKWebView *)webView renderingProgressDidChange:(_WKRenderingProgressEvents)progressEvents >+{ >+ if (_handler) >+ _handler(progressEvents); >+} >+ >+@end >+ >+#if ENABLE(EXTRA_ZOOM_MODE) >+ >+TEST(RenderingProgressTests, FirstPaintWithSignificantArea) >+{ >+ auto schemeHandler = adoptNS([[TimeoutSchemeHandler alloc] init]); >+ auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); >+ [configuration setURLSchemeHandler:schemeHandler.get() forURLScheme:@"timeout"]; >+ auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 160, 568) configuration:configuration.get()]); >+ [webView _setObservedRenderingProgressEvents:_WKRenderingProgressEventFirstPaintWithSignificantArea]; >+ >+ bool observedSignificantPaint = false; >+ auto renderingProgressHandler = adoptNS([[RenderingProgressHandler alloc] initWithHandler:[&] (_WKRenderingProgressEvents events) { >+ if (events & _WKRenderingProgressEventFirstPaintWithSignificantArea) >+ observedSignificantPaint = true; >+ }]); >+ >+ [webView setNavigationDelegate:renderingProgressHandler.get()]; >+ [webView loadTestPageNamed:@"paint-significant-area-milestone"]; >+ TestWebKitAPI::Util::run(&observedSignificantPaint); >+} >+ >+#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186042
:
341465
|
341467
|
341486