WebKit Bugzilla
Attachment 343182 Details for
Bug 186860
: [WebKit on watchOS] Fixed position elements sometimes flicker when scrolling
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186860-20180620144229.patch (text/plain), 15.00 KB, created by
Wenson Hsieh
on 2018-06-20 14:42:30 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-06-20 14:42:30 PDT
Size:
15.00 KB
patch
obsolete
>Subversion Revision: 233021 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 600100b378ad29a1b8148fd0345f905c80b0016f..3a43878b21d35c310a0426f5528e8857187724bb 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,21 @@ >+2018-06-20 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [WebKit on watchOS] Fixed position elements sometimes flicker when scrolling >+ https://bugs.webkit.org/show_bug.cgi?id=186860 >+ <rdar://problem/39953563> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove conditional guards that are no longer necessary, now that the oldest iOS version our builders support is >+ iOS 11. Conditionalizing this logic only for iOS 11+ meant that on watchOS, we're always falling down the path >+ where we don't schedule a visible content rect update until the next runloop, which makes it possible for a >+ remote layer tree transaction to arrive and cause us to update the scrolling tree with stale viewport geometry. >+ >+ Test: WKScrollViewTests.PositionFixedLayerAfterScrolling >+ >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): >+ > 2018-06-20 Megan Gardner <megan_gardner@apple.com> > > Restrict Selection in contenteditable the extent of that contenteditable >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >index 51c0398a85890ae9cb1ea57f9084904db5743764..3dc1bdb706d0b5056d755cb23509593e459f1ccf 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >@@ -2727,13 +2727,11 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff > > _hasScheduledVisibleRectUpdate = YES; > >-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 > CATransactionPhase transactionPhase = [CATransaction currentPhase]; > if (transactionPhase == kCATransactionPhaseNull || transactionPhase == kCATransactionPhasePreLayout) { > [self _addUpdateVisibleContentRectPreCommitHandler]; > return; > } >-#endif > > dispatch_async(dispatch_get_main_queue(), [retainedSelf = retainPtr(self)] { > WKWebView *webView = retainedSelf.get(); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 4e46d5b800273bed2acbc296f22fd44966a4d399..bf40356db921121090cf9f85c94debbb8b668e32 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,21 @@ >+2018-06-20 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [WebKit on watchOS] Fixed position elements sometimes flicker when scrolling >+ https://bugs.webkit.org/show_bug.cgi?id=186860 >+ <rdar://problem/39953563> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a new API test to exercise a race condition between receiving remote layer tree commits and updating visible >+ content rects which would result in the compositing layer for a fixed position element sometimes appearing in >+ the wrong place. See WebKit ChangeLog for more details. >+ >+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: >+ * TestWebKitAPI/Tests/WebKitCocoa/fixed-nav-bar.html: Added. >+ * TestWebKitAPI/Tests/ios/WKScrollViewTests.mm: Added. >+ (traverseLayerTree): >+ (TEST): >+ > 2018-06-20 Robin Morisset <rmorisset@apple.com> > > [WSL] Add details to the sphinx outline >diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >index b4763f98b9b296999960382c0b7c36b2516ce381..ec079da9f171779875b6f9023712ddb3ad8da65c 100644 >--- a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >+++ b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >@@ -771,6 +771,8 @@ > F41AB9A91EF4696B0083FA08 /* prevent-start.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F41AB99A1EF4692C0083FA08 /* prevent-start.html */; }; > F41AB9AA1EF4696B0083FA08 /* textarea-to-input.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F41AB9951EF4692C0083FA08 /* textarea-to-input.html */; }; > F42DA5161D8CEFE400336F40 /* large-input-field-focus-onload.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F42DA5151D8CEFDB00336F40 /* large-input-field-focus-onload.html */; }; >+ F43E3BBF20DADA1E00A4E7ED /* WKScrollViewTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F43E3BBE20DADA1E00A4E7ED /* WKScrollViewTests.mm */; }; >+ F43E3BC120DADBC500A4E7ED /* fixed-nav-bar.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F43E3BC020DADB8000A4E7ED /* fixed-nav-bar.html */; }; > F4451C761EB8FD890020C5DA /* two-paragraph-contenteditable.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4451C751EB8FD7C0020C5DA /* two-paragraph-contenteditable.html */; }; > F44D06451F395C26001A0E29 /* editor-state-test-harness.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F44D06441F395C0D001A0E29 /* editor-state-test-harness.html */; }; > F44D06471F39627A001A0E29 /* EditorStateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F44D06461F395C4D001A0E29 /* EditorStateTests.mm */; }; >@@ -887,9 +889,6 @@ > dstPath = TestWebKitAPI.resources; > dstSubfolderSpec = 7; > files = ( >- 51460E1220D421F2005345F2 /* SimpleServiceWorkerRegistrations-2.sqlite3 in Copy Resources */, >- 51460E1320D421F2005345F2 /* SimpleServiceWorkerRegistrations-2.sqlite3-shm in Copy Resources */, >- 51460E1420D421F2005345F2 /* SimpleServiceWorkerRegistrations-2.sqlite3-wal in Copy Resources */, > 1A9E52C913E65EF4006917F5 /* 18-characters.html in Copy Resources */, > 379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */, > 1C2B81871C8925A000A5529F /* Ahem.ttf in Copy Resources */, >@@ -974,6 +973,7 @@ > 1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */, > A17EAC55208305A00084B41B /* find.pdf in Copy Resources */, > C5101C4F176B8D9200EE9B15 /* findRanges.html in Copy Resources */, >+ F43E3BC120DADBC500A4E7ED /* fixed-nav-bar.html in Copy Resources */, > 932AE53D1D371047005DFFAF /* focus-inputs.html in Copy Resources */, > 1A7E8B3618120B2F00AEB74A /* FragmentNavigation.html in Copy Resources */, > F47728991E4AE3C1007ABF6A /* full-page-contenteditable.html in Copy Resources */, >@@ -1110,6 +1110,9 @@ > BC909784125571CF00083756 /* simple.html in Copy Resources */, > 51E5C7021919C3B200D8B3E1 /* simple2.html in Copy Resources */, > 51E5C7031919C3B200D8B3E1 /* simple3.html in Copy Resources */, >+ 51460E1220D421F2005345F2 /* SimpleServiceWorkerRegistrations-2.sqlite3 in Copy Resources */, >+ 51460E1320D421F2005345F2 /* SimpleServiceWorkerRegistrations-2.sqlite3-shm in Copy Resources */, >+ 51460E1420D421F2005345F2 /* SimpleServiceWorkerRegistrations-2.sqlite3-wal in Copy Resources */, > F4F405BD1D4C0D1C007A9707 /* skinny-autoplaying-video-with-audio.html in Copy Resources */, > C01A23F21266156700C9ED55 /* spacebar-scrolling.html in Copy Resources */, > E194E1BD177E53C7009C4D4E /* StopLoadingFromDidReceiveResponse.html in Copy Resources */, >@@ -1951,6 +1954,8 @@ > F41AB99D1EF4692C0083FA08 /* link-and-target-div.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "link-and-target-div.html"; sourceTree = "<group>"; }; > F41AB99E1EF4692C0083FA08 /* div-and-large-image.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "div-and-large-image.html"; sourceTree = "<group>"; }; > F42DA5151D8CEFDB00336F40 /* large-input-field-focus-onload.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = "large-input-field-focus-onload.html"; path = "Tests/WebKitCocoa/large-input-field-focus-onload.html"; sourceTree = SOURCE_ROOT; }; >+ F43E3BBE20DADA1E00A4E7ED /* WKScrollViewTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WKScrollViewTests.mm; sourceTree = "<group>"; }; >+ F43E3BC020DADB8000A4E7ED /* fixed-nav-bar.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "fixed-nav-bar.html"; sourceTree = "<group>"; }; > F4451C751EB8FD7C0020C5DA /* two-paragraph-contenteditable.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "two-paragraph-contenteditable.html"; sourceTree = "<group>"; }; > F44D06441F395C0D001A0E29 /* editor-state-test-harness.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "editor-state-test-harness.html"; sourceTree = "<group>"; }; > F44D06461F395C4D001A0E29 /* EditorStateTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EditorStateTests.mm; sourceTree = "<group>"; }; >@@ -2422,6 +2427,7 @@ > 4433A395208044130091ED57 /* SynchronousTimeoutTests.mm */, > F45033F4206BEC95009351CE /* TextAutosizingBoost.mm */, > F46849BD1EEF58E400B937FE /* UIPasteboardTests.mm */, >+ F43E3BBE20DADA1E00A4E7ED /* WKScrollViewTests.mm */, > 514958BD1F7427AC00E87BAD /* WKWebViewAutofillTests.mm */, > ); > path = ios; >@@ -2478,9 +2484,6 @@ > A16F66B81C40E9E100BD4D24 /* Resources */ = { > isa = PBXGroup; > children = ( >- 51460E0F20D4216E005345F2 /* SimpleServiceWorkerRegistrations-2.sqlite3 */, >- 51460E1020D4216E005345F2 /* SimpleServiceWorkerRegistrations-2.sqlite3-shm */, >- 51460E1120D4216E005345F2 /* SimpleServiceWorkerRegistrations-2.sqlite3-wal */, > C25CCA0C1E5140E50026CB8A /* AllAhem.svg */, > F4A9202E1FEE34C800F59590 /* apple-data-url.html */, > F47D30EB1ED28619000482E1 /* apple.gif */, >@@ -2526,6 +2529,7 @@ > F407FE381F1D0DE60017CF25 /* enormous.svg */, > F41AB99B1EF4692C0083FA08 /* file-uploading.html */, > A17EAC542083056E0084B41B /* find.pdf */, >+ F43E3BC020DADB8000A4E7ED /* fixed-nav-bar.html */, > 93575C551D30366E000D604D /* focus-inputs.html */, > F4F405BA1D4C0CF8007A9707 /* full-size-autoplaying-video-with-audio.html */, > CD78E11B1DB7EA360014A2DE /* FullscreenDelegate.html */, >@@ -2605,6 +2609,9 @@ > F46849BF1EEF5EDC00B937FE /* rich-and-plain-text.html */, > F4D65DA71F5E46C0009D8C27 /* selected-text-image-link-and-editable.html */, > C9B4AD291ECA6EA500F5FEA0 /* silence-long.m4a */, >+ 51460E0F20D4216E005345F2 /* SimpleServiceWorkerRegistrations-2.sqlite3 */, >+ 51460E1020D4216E005345F2 /* SimpleServiceWorkerRegistrations-2.sqlite3-shm */, >+ 51460E1120D4216E005345F2 /* SimpleServiceWorkerRegistrations-2.sqlite3-wal */, > F4F405BB1D4C0CF8007A9707 /* skinny-autoplaying-video-with-audio.html */, > 515BE16E1D4288FF00DD7C68 /* StoreBlobToBeDeleted.html */, > 9BD6D3A11F7B202100BD4962 /* sunset-in-cupertino-100px.tiff */, >@@ -3873,6 +3880,7 @@ > 44817A2F1F0486BF00003810 /* WKRequestActivatedElementInfo.mm in Sources */, > 7C83E0B51D0A649300FEBCF3 /* WKRetainPtr.cpp in Sources */, > 5E4B1D2E1D404C6100053621 /* WKScrollViewDelegate.mm in Sources */, >+ F43E3BBF20DADA1E00A4E7ED /* WKScrollViewTests.mm in Sources */, > 7CCE7F221A411AE600447C4C /* WKString.cpp in Sources */, > 7CCE7F1E1A411AE600447C4C /* WKStringJSString.cpp in Sources */, > 2D4CF8BD1D8360CC0001CE8D /* WKThumbnailView.mm in Sources */, >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/fixed-nav-bar.html b/Tools/TestWebKitAPI/Tests/WebKitCocoa/fixed-nav-bar.html >new file mode 100644 >index 0000000000000000000000000000000000000000..aaf17501a602c2d0a99300c550aa454a59528033 >--- /dev/null >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/fixed-nav-bar.html >@@ -0,0 +1,24 @@ >+<!DOCTYPE html> >+<html> >+<head> >+ <meta name='viewport' content='width=device-width, initial-scale=1'> >+ <style> >+ body { >+ margin: 0; >+ width: 100%; >+ height: 10000px; >+ } >+ #nav { >+ position: fixed; >+ top: 0; >+ left: 0; >+ width: 100%; >+ height: 50px; >+ background-color: black; >+ } >+ </style> >+</head> >+<body> >+ <div id="nav"></div> >+</body> >+</html> >diff --git a/Tools/TestWebKitAPI/Tests/ios/WKScrollViewTests.mm b/Tools/TestWebKitAPI/Tests/ios/WKScrollViewTests.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..34376943d5f5f11033645e92d029e2c81e0c9e67 >--- /dev/null >+++ b/Tools/TestWebKitAPI/Tests/ios/WKScrollViewTests.mm >@@ -0,0 +1,74 @@ >+/* >+ * 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" >+ >+#if WK_API_ENABLED && PLATFORM(IOS) >+ >+#import "PlatformUtilities.h" >+#import "TestWKWebView.h" >+#import <WebKit/WKWebViewPrivate.h> >+ >+static void traverseLayerTree(CALayer *layer, void(^block)(CALayer *)) >+{ >+ for (CALayer *child in layer.sublayers) >+ traverseLayerTree(child, block); >+ block(layer); >+} >+ >+TEST(WKScrollViewTests, PositionFixedLayerAfterScrolling) >+{ >+ auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]); >+ [webView synchronouslyLoadTestPageNamed:@"fixed-nav-bar"]; >+ >+ __block bool done = false; >+ [webView _doAfterNextPresentationUpdate:^() { >+ done = true; >+ }]; >+ >+ [CATransaction begin]; >+ [webView scrollView].contentOffset = CGPointMake(0, 5000); >+ [CATransaction commit]; >+ >+ // Purposefully hang the main thread for a short while to give the remote layer tree transaction an >+ // opportunity to arrive in the UI process before dispatching the next visible content rect update. >+ sleep(1); >+ >+ TestWebKitAPI::Util::run(&done); >+ >+ bool foundLayerForFixedNavBar = false; >+ traverseLayerTree([webView layer], [&] (CALayer *layer) { >+ if (!CGSizeEqualToSize(layer.bounds.size, CGSizeMake(320, 50))) >+ return; >+ >+ auto boundsInWebViewCoordinates = [layer convertRect:layer.bounds toLayer:[webView layer]]; >+ EXPECT_EQ(CGRectGetMinX(boundsInWebViewCoordinates), 0); >+ EXPECT_EQ(CGRectGetMinY(boundsInWebViewCoordinates), 0); >+ foundLayerForFixedNavBar = true; >+ }); >+ EXPECT_TRUE(foundLayerForFixedNavBar); >+} >+ >+#endif // WK_API_ENABLED && PLATFORM(IOS)
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
Flags:
thorton
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186860
: 343182 |
343187