Changeset 225288 in webkit
- Timestamp:
- Nov 29, 2017 12:41:47 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r225283 r225288 1 2017-11-29 Simon Fraser <simon.fraser@apple.com> 2 3 REGRESSION (r213590): Scrolling to anchors broken in web views when content loaded via HTML string 4 https://bugs.webkit.org/show_bug.cgi?id=180155 5 rdar://problem/34220827 6 7 Reviewed by Zalan Bujtas. 8 9 When content is loaded in a UIWebView or WKWebView via an HTML string, history().currentItem() 10 is null so itemAllowsScrollRestoration() would return false, preventing scrolling to anchors. 11 12 Fix by allowing scroll restoration if the the history item is null. 13 14 Tested by WebKit.NoHistoryItemScrollToFragment API test. 15 16 * loader/FrameLoader.cpp: 17 (WebCore::itemAllowsScrollRestoration): 18 1 19 2017-11-29 Chris Dumez <cdumez@apple.com> 2 20 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r225144 r225288 2890 2890 static bool itemAllowsScrollRestoration(HistoryItem* historyItem) 2891 2891 { 2892 return historyItem &&historyItem->shouldRestoreScrollPosition();2892 return !historyItem || historyItem->shouldRestoreScrollPosition(); 2893 2893 } 2894 2894 -
trunk/Tools/ChangeLog
r225287 r225288 1 2017-11-29 Simon Fraser <simon.fraser@apple.com> 2 3 REGRESSION (r213590): Scrolling to anchors broken in web views when content loaded via HTML string 4 https://bugs.webkit.org/show_bug.cgi?id=180155 5 rdar://problem/34220827 6 7 Reviewed by Zalan Bujtas. 8 9 API test that loads a page with a relative anchor, and simulates a click to scroll to it. 10 11 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 12 * TestWebKitAPI/Tests/WebKit/MediaStreamTrackDetached.mm: 13 (TestWebKitAPI::TEST): 14 * TestWebKitAPI/Tests/WebKit/NoHistoryItemScrollToFragment.mm: Added. 15 (-[DidScrollToFragmentDelegate _webViewDidScroll:]): 16 (TestWebKitAPI::TEST): 17 * TestWebKitAPI/Tests/WebKit/scroll-to-anchor.html: Added. 18 1 19 2017-11-29 Ryan Haddad <ryanhaddad@apple.com> 2 20 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r225231 r225288 38 38 0F3B94A71A77267400DE3272 /* WKWebViewEvaluateJavaScript.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F3B94A51A77266C00DE3272 /* WKWebViewEvaluateJavaScript.mm */; }; 39 39 0F4FFA9E1ED3AA8500F7111F /* SnapshotViaRenderInContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F4FFA9D1ED3AA8500F7111F /* SnapshotViaRenderInContext.mm */; }; 40 0F5651F71FCE4DDC00310FBC /* NoHistoryItemScrollToFragment.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F5651F61FCE4DDB00310FBC /* NoHistoryItemScrollToFragment.mm */; }; 41 0F5651F91FCE513500310FBC /* scroll-to-anchor.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 0F5651F81FCE50E800310FBC /* scroll-to-anchor.html */; }; 40 42 115EB3431EE0BA03003C2C0A /* ViewportSizeForViewportUnits.mm in Sources */ = {isa = PBXBuildFile; fileRef = 115EB3421EE0B720003C2C0A /* ViewportSizeForViewportUnits.mm */; }; 41 43 1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 1A02C84B125D4A5E00E3F4BD /* find.html */; }; … … 1003 1005 A12DDC001E8373E700CF6CAE /* rendered-image-excluding-overflow.html in Copy Resources */, 1004 1006 F46849C01EEF5EF300B937FE /* rich-and-plain-text.html in Copy Resources */, 1007 0F5651F91FCE513500310FBC /* scroll-to-anchor.html in Copy Resources */, 1005 1008 F4D65DA81F5E4704009D8C27 /* selected-text-image-link-and-editable.html in Copy Resources */, 1006 1009 7A66BDB81EAF18D500CCC924 /* set-long-title.html in Copy Resources */, … … 1072 1075 0F4FFA9D1ED3AA8500F7111F /* SnapshotViaRenderInContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SnapshotViaRenderInContext.mm; sourceTree = "<group>"; }; 1073 1076 0F4FFAA01ED3D0DE00F7111F /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; }; 1077 0F5651F61FCE4DDB00310FBC /* NoHistoryItemScrollToFragment.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NoHistoryItemScrollToFragment.mm; sourceTree = "<group>"; }; 1078 0F5651F81FCE50E800310FBC /* scroll-to-anchor.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "scroll-to-anchor.html"; sourceTree = "<group>"; }; 1074 1079 0FC6C4CB141027E0005B7F0C /* RedBlackTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RedBlackTree.cpp; sourceTree = "<group>"; }; 1075 1080 0FC6C4CE141034AD005B7F0C /* MetaAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MetaAllocator.cpp; sourceTree = "<group>"; }; … … 2520 2525 93F7E86B14DC8E4D00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames.cpp */, 2521 2526 93F7E86E14DC8E5B00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp */, 2527 0F5651F61FCE4DDB00310FBC /* NoHistoryItemScrollToFragment.mm */, 2522 2528 7CCB4DA71C83AE7300CC6918 /* PageGroup.cpp */, 2523 2529 BC909779125571AB00083756 /* PageLoadBasic.cpp */, … … 2708 2714 CEA6CF2719CCF69D0064F5A7 /* open-and-close-window.html */, 2709 2715 F6FDDDD514241C48004F1729 /* push-state.html */, 2716 0F5651F81FCE50E800310FBC /* scroll-to-anchor.html */, 2710 2717 7A66BDB71EAF150100CCC924 /* set-long-title.html */, 2711 2718 CEBABD481B71687C0051210A /* should-open-external-schemes.html */, … … 3411 3418 7CCE7F041A411AE600447C4C /* NewFirstVisuallyNonEmptyLayoutForImages.cpp in Sources */, 3412 3419 7CCE7F051A411AE600447C4C /* NewFirstVisuallyNonEmptyLayoutFrames.cpp in Sources */, 3420 0F5651F71FCE4DDC00310FBC /* NoHistoryItemScrollToFragment.mm in Sources */, 3413 3421 2ECFF5551D9B12F800B55394 /* NowPlayingControlsTests.mm in Sources */, 3414 3422 A10F047E1E3AD29C00C95E19 /* NSFileManagerExtras.mm in Sources */, -
trunk/Tools/TestWebKitAPI/Tests/WebKit/MediaStreamTrackDetached.mm
r221505 r225288 81 81 82 82 TestWebKitAPI::Util::run(&hasRecievedCorrectCaptureState); 83 84 85 83 } 86 84
Note: See TracChangeset
for help on using the changeset viewer.