Changeset 267678 in webkit
- Timestamp:
- Sep 27, 2020, 1:00:28 PM (6 years ago)
- Location:
- branches/safari-610-branch/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
page/FrameView.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-610-branch/Source/WebCore/ChangeLog
r267676 r267678 1 2020-09-27 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r267287. rdar://problem/69594243 4 5 Crash under WebCore::shouldResetFocusNavigationStartingNode() 6 https://bugs.webkit.org/show_bug.cgi?id=216714 7 <rdar://problem/68132047> 8 9 Reviewed by Darin Adler. 10 11 Protect anchorElement in FrameView::scrollToFragmentInternal() to make sure 12 it stays alive until the time we pass it to setFocusNavigationStartingNode(). 13 14 * page/FrameView.cpp: 15 (WebCore::FrameView::scrollToFragmentInternal): 16 17 18 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267287 268f45cc-cd09-0410-ab3c-d52691b4dbfc 19 20 2020-09-18 Chris Dumez <cdumez@apple.com> 21 22 Crash under WebCore::shouldResetFocusNavigationStartingNode() 23 https://bugs.webkit.org/show_bug.cgi?id=216714 24 <rdar://problem/68132047> 25 26 Reviewed by Darin Adler. 27 28 Protect anchorElement in FrameView::scrollToFragmentInternal() to make sure 29 it stays alive until the time we pass it to setFocusNavigationStartingNode(). 30 31 * page/FrameView.cpp: 32 (WebCore::FrameView::scrollToFragmentInternal): 33 1 34 2020-09-27 Alan Coon <alancoon@apple.com> 2 35 -
branches/safari-610-branch/Source/WebCore/page/FrameView.cpp
r267673 r267678 2208 2208 RELEASE_ASSERT(document.haveStylesheetsLoaded()); 2209 2209 2210 Element* anchorElement = document.findAnchor(fragmentIdentifier);2211 2212 LOG(Scrolling, " anchorElement is %p", anchorElement );2210 auto anchorElement = makeRefPtr(document.findAnchor(fragmentIdentifier)); 2211 2212 LOG(Scrolling, " anchorElement is %p", anchorElement.get()); 2213 2213 2214 2214 // Setting to null will clear the current target. 2215 document.setCSSTarget(anchorElement );2215 document.setCSSTarget(anchorElement.get()); 2216 2216 2217 2217 if (is<SVGDocument>(document)) { … … 2230 2230 } 2231 2231 2232 ContainerNode*scrollPositionAnchor = anchorElement;2232 RefPtr<ContainerNode> scrollPositionAnchor = anchorElement; 2233 2233 if (!scrollPositionAnchor) 2234 2234 scrollPositionAnchor = frame().document(); 2235 maintainScrollPositionAtAnchor(scrollPositionAnchor );2235 maintainScrollPositionAtAnchor(scrollPositionAnchor.get()); 2236 2236 2237 2237 // If the anchor accepts keyboard focus, move focus there to aid users relying on keyboard navigation. 2238 2238 if (anchorElement) { 2239 2239 if (anchorElement->isFocusable()) 2240 document.setFocusedElement(anchorElement );2240 document.setFocusedElement(anchorElement.get()); 2241 2241 else { 2242 2242 document.setFocusedElement(nullptr); 2243 document.setFocusNavigationStartingNode(anchorElement );2243 document.setFocusNavigationStartingNode(anchorElement.get()); 2244 2244 } 2245 2245 }
Note:
See TracChangeset
for help on using the changeset viewer.