Changeset 267287 in webkit
- Timestamp:
- Sep 18, 2020, 3:50:34 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
page/FrameView.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r267283 r267287 1 2020-09-18 Chris Dumez <cdumez@apple.com> 2 3 Crash under WebCore::shouldResetFocusNavigationStartingNode() 4 https://bugs.webkit.org/show_bug.cgi?id=216714 5 <rdar://problem/68132047> 6 7 Reviewed by Darin Adler. 8 9 Protect anchorElement in FrameView::scrollToFragmentInternal() to make sure 10 it stays alive until the time we pass it to setFocusNavigationStartingNode(). 11 12 * page/FrameView.cpp: 13 (WebCore::FrameView::scrollToFragmentInternal): 14 1 15 2020-09-18 Aditya Keerthi <akeerthi@apple.com> 2 16 -
trunk/Source/WebCore/page/FrameView.cpp
r267188 r267287 2214 2214 RELEASE_ASSERT(document.haveStylesheetsLoaded()); 2215 2215 2216 Element* anchorElement = document.findAnchor(fragmentIdentifier);2217 2218 LOG(Scrolling, " anchorElement is %p", anchorElement );2216 auto anchorElement = makeRefPtr(document.findAnchor(fragmentIdentifier)); 2217 2218 LOG(Scrolling, " anchorElement is %p", anchorElement.get()); 2219 2219 2220 2220 // Setting to null will clear the current target. 2221 document.setCSSTarget(anchorElement );2221 document.setCSSTarget(anchorElement.get()); 2222 2222 2223 2223 if (is<SVGDocument>(document)) { … … 2236 2236 } 2237 2237 2238 ContainerNode*scrollPositionAnchor = anchorElement;2238 RefPtr<ContainerNode> scrollPositionAnchor = anchorElement; 2239 2239 if (!scrollPositionAnchor) 2240 2240 scrollPositionAnchor = frame().document(); 2241 maintainScrollPositionAtAnchor(scrollPositionAnchor );2241 maintainScrollPositionAtAnchor(scrollPositionAnchor.get()); 2242 2242 2243 2243 // If the anchor accepts keyboard focus, move focus there to aid users relying on keyboard navigation. 2244 2244 if (anchorElement) { 2245 2245 if (anchorElement->isFocusable()) 2246 document.setFocusedElement(anchorElement );2246 document.setFocusedElement(anchorElement.get()); 2247 2247 else { 2248 2248 document.setFocusedElement(nullptr); 2249 document.setFocusNavigationStartingNode(anchorElement );2249 document.setFocusNavigationStartingNode(anchorElement.get()); 2250 2250 } 2251 2251 }
Note:
See TracChangeset
for help on using the changeset viewer.