Changeset 202243 in webkit
- Timestamp:
- Jun 20, 2016, 2:22:54 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 21 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/forms/ios/focus-input-in-iframe-expected.txt (added)
-
LayoutTests/fast/forms/ios/focus-input-in-iframe.html (added)
-
LayoutTests/fast/forms/ios/programmatic-focus-input-in-iframe-expected.txt (added)
-
LayoutTests/fast/forms/ios/programmatic-focus-input-in-iframe.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Document.h (modified) (1 diff)
-
Source/WebCore/dom/Element.cpp (modified) (5 diffs)
-
Source/WebCore/dom/Element.h (modified) (1 diff)
-
Source/WebCore/editing/Editor.cpp (modified) (3 diffs)
-
Source/WebCore/editing/FrameSelection.cpp (modified) (5 diffs)
-
Source/WebCore/editing/FrameSelection.h (modified) (3 diffs)
-
Source/WebCore/html/HTMLInputElement.cpp (modified) (1 diff)
-
Source/WebCore/html/HTMLTextAreaElement.cpp (modified) (1 diff)
-
Source/WebCore/page/ContextMenuController.cpp (modified) (1 diff)
-
Source/WebCore/page/FrameView.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayer.cpp (modified) (5 diffs)
-
Source/WebCore/rendering/RenderLayer.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderObject.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderObject.h (modified) (1 diff)
-
Source/WebKit/mac/ChangeLog (modified) (1 diff)
-
Source/WebKit/mac/WebView/WebFrame.mm (modified) (3 diffs)
-
Source/WebKit/mac/WebView/WebHTMLView.mm (modified) (2 diffs)
-
Source/WebKit2/ChangeLog (modified) (1 diff)
-
Source/WebKit2/WebProcess/WebPage/WebPage.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202239 r202243 1 2016-06-20 Simon Fraser <simon.fraser@apple.com> 2 3 Focus event dispatched in iframe causes parent document to scroll incorrectly 4 https://bugs.webkit.org/show_bug.cgi?id=158629 5 rdar://problem/26521616 6 7 Reviewed by Tim Horton. 8 9 * fast/forms/ios/focus-input-in-iframe-expected.txt: Added. 10 * fast/forms/ios/focus-input-in-iframe.html: Added. 11 * fast/forms/ios/programmatic-focus-input-in-iframe-expected.txt: Added. 12 * fast/forms/ios/programmatic-focus-input-in-iframe.html: Added. 13 1 14 2016-06-20 Commit Queue <commit-queue@webkit.org> 2 15 -
trunk/Source/WebCore/ChangeLog
r202242 r202243 1 2016-06-20 Simon Fraser <simon.fraser@apple.com> 2 3 Focus event dispatched in iframe causes parent document to scroll incorrectly 4 https://bugs.webkit.org/show_bug.cgi?id=158629 5 rdar://problem/26521616 6 7 Reviewed by Tim Horton. 8 9 When focussing elements in iframes, the page could scroll to an incorrect location. 10 This happened because code in Element::focus() tried to disable scrolling on focus, 11 but did so only for the current frame, so ancestor frames got programmatically scrolled. 12 On iOS we handle the scrolling in the UI process, so never want the web process to 13 do programmatic scrolling. 14 15 Fix by changing the focus and cache restore code to use SelectionRevealMode::DoNotReveal, 16 rather than manually prohibiting frame scrolling. Pass SelectionRevealMode through various callers, 17 and use RevealUpToMainFrame for iOS, allowing the UI process to do the zoomToRect: for the main frame. 18 19 Tests: fast/forms/ios/focus-input-in-iframe.html 20 fast/forms/ios/programmatic-focus-input-in-iframe.html 21 22 * dom/Document.h: 23 * dom/Element.cpp: 24 (WebCore::Element::scrollIntoView): 25 (WebCore::Element::scrollIntoViewIfNeeded): 26 (WebCore::Element::scrollIntoViewIfNotVisible): 27 (WebCore::Element::focus): 28 (WebCore::Element::updateFocusAppearance): 29 * dom/Element.h: 30 * editing/Editor.cpp: 31 (WebCore::Editor::insertTextWithoutSendingTextEvent): 32 (WebCore::Editor::revealSelectionAfterEditingOperation): 33 (WebCore::Editor::findStringAndScrollToVisible): 34 * editing/FrameSelection.cpp: 35 (WebCore::FrameSelection::updateAndRevealSelection): 36 (WebCore::FrameSelection::revealSelection): 37 (WebCore::FrameSelection::FrameSelection): Deleted. 38 * editing/FrameSelection.h: 39 * html/HTMLInputElement.cpp: 40 (WebCore::HTMLInputElement::updateFocusAppearance): 41 * html/HTMLTextAreaElement.cpp: 42 (WebCore::HTMLTextAreaElement::updateFocusAppearance): 43 * page/ContextMenuController.cpp: 44 (WebCore::ContextMenuController::contextMenuItemSelected): 45 * page/FrameView.cpp: 46 (WebCore::FrameView::scrollToAnchor): 47 * rendering/RenderLayer.cpp: 48 (WebCore::RenderLayer::scrollRectToVisible): 49 (WebCore::RenderLayer::autoscroll): 50 * rendering/RenderLayer.h: 51 * rendering/RenderObject.cpp: 52 (WebCore::RenderObject::scrollRectToVisible): 53 * rendering/RenderObject.h: 54 1 55 2016-06-20 Keith Rollin <krollin@apple.com> 2 56 -
trunk/Source/WebCore/dom/Document.h
r202183 r202243 283 283 }; 284 284 285 enum class SelectionRevealMode {286 Reveal,287 DoNotReveal288 };289 290 285 enum class HttpEquivPolicy { 291 286 Enabled, -
trunk/Source/WebCore/dom/Element.cpp
r202197 r202243 640 640 // Align to the top / bottom and to the closest edge. 641 641 if (alignToTop) 642 renderer()->scrollRectToVisible( bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);642 renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways); 643 643 else 644 renderer()->scrollRectToVisible( bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignBottomAlways);644 renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignBottomAlways); 645 645 } 646 646 … … 654 654 LayoutRect bounds = renderer()->anchorRect(); 655 655 if (centerIfNeeded) 656 renderer()->scrollRectToVisible( bounds, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded);656 renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, bounds, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded); 657 657 else 658 renderer()->scrollRectToVisible( bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);658 renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded); 659 659 } 660 660 … … 668 668 LayoutRect bounds = renderer()->anchorRect(); 669 669 if (centerIfNotVisible) 670 renderer()->scrollRectToVisible( bounds, ScrollAlignment::alignCenterIfNotVisible, ScrollAlignment::alignCenterIfNotVisible);670 renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, bounds, ScrollAlignment::alignCenterIfNotVisible, ScrollAlignment::alignCenterIfNotVisible); 671 671 else 672 renderer()->scrollRectToVisible( bounds, ScrollAlignment::alignToEdgeIfNotVisible, ScrollAlignment::alignToEdgeIfNotVisible);672 renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, bounds, ScrollAlignment::alignToEdgeIfNotVisible, ScrollAlignment::alignToEdgeIfNotVisible); 673 673 } 674 674 … … 2246 2246 2247 2247 cancelFocusAppearanceUpdate(); 2248 2249 SelectionRevealMode revealMode = SelectionRevealMode::Reveal; 2248 2250 #if PLATFORM(IOS) 2249 2251 // Focusing a form element triggers animation in UIKit to scroll to the right position. 2250 2252 // Calling updateFocusAppearance() would generate an unnecessary call to ScrollView::setScrollPosition(), 2251 2253 // which would jump us around during this animation. See <rdar://problem/6699741>. 2252 FrameView* view = document().view(); 2253 bool isFormControl = view && is<HTMLFormControlElement>(*this); 2254 bool isFormControl = is<HTMLFormControlElement>(*this); 2254 2255 if (isFormControl) 2255 view->setProhibitsScrolling(true);2256 revealMode = SelectionRevealMode::RevealUpToMainFrame; 2256 2257 #endif 2257 updateFocusAppearance(restorePreviousSelection ? SelectionRestorationMode::Restore : SelectionRestorationMode::SetDefault); 2258 #if PLATFORM(IOS) 2259 if (isFormControl) 2260 view->setProhibitsScrolling(false); 2261 #endif 2258 2259 updateFocusAppearance(restorePreviousSelection ? SelectionRestorationMode::Restore : SelectionRestorationMode::SetDefault, revealMode); 2262 2260 } 2263 2261 … … 2291 2289 if (frame->selection().shouldChangeSelection(newSelection)) { 2292 2290 frame->selection().setSelection(newSelection, FrameSelection::defaultSetSelectionOptions(), Element::defaultFocusTextStateChangeIntent()); 2293 if (revealMode == SelectionRevealMode::Reveal) 2294 frame->selection().revealSelection(); 2291 frame->selection().revealSelection(revealMode); 2295 2292 } 2296 } else if (renderer() && !renderer()->isWidget() && revealMode == SelectionRevealMode::Reveal)2297 renderer()->scrollRectToVisible(re nderer()->anchorRect());2293 } else if (renderer() && !renderer()->isWidget()) 2294 renderer()->scrollRectToVisible(revealMode, renderer()->anchorRect()); 2298 2295 } 2299 2296 -
trunk/Source/WebCore/dom/Element.h
r202197 r202243 61 61 }; 62 62 63 enum class SelectionRevealMode { 64 Reveal, 65 RevealUpToMainFrame, // Scroll overflow and iframes, but not the main frame. 66 DoNotReveal 67 }; 68 63 69 class Element : public ContainerNode { 64 70 public: -
trunk/Source/WebCore/editing/Editor.cpp
r202242 r202243 1205 1205 if (Frame* editedFrame = document->frame()) 1206 1206 if (Page* page = editedFrame->page()) 1207 page->focusController().focusedOrMainFrame().selection().revealSelection(S crollAlignment::alignCenterIfNeeded);1207 page->focusController().focusedOrMainFrame().selection().revealSelection(SelectionRevealMode::Reveal, ScrollAlignment::alignCenterIfNeeded); 1208 1208 } 1209 1209 } … … 2800 2800 return; 2801 2801 2802 m_frame.selection().revealSelection( alignment, revealExtentOption);2802 m_frame.selection().revealSelection(SelectionRevealMode::Reveal, alignment, revealExtentOption); 2803 2803 } 2804 2804 … … 3148 3148 return nullptr; 3149 3149 3150 nextMatch->firstNode()->renderer()->scrollRectToVisible( nextMatch->absoluteBoundingBox(),3150 nextMatch->firstNode()->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, nextMatch->absoluteBoundingBox(), 3151 3151 ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded); 3152 3152 -
trunk/Source/WebCore/editing/FrameSelection.cpp
r202105 r202243 128 128 , m_updateAppearanceEnabled(false) 129 129 , m_caretBlinks(true) 130 , m_scrollingSuppressCount(0)131 130 #endif 132 131 { … … 389 388 alignment = m_alwaysAlignCursorOnScrollWhenRevealingSelection ? ScrollAlignment::alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded; 390 389 391 revealSelection( alignment, RevealExtent);390 revealSelection(SelectionRevealMode::Reveal, alignment, RevealExtent); 392 391 } 393 392 … … 2291 2290 } 2292 2291 2293 void FrameSelection::revealSelection(const ScrollAlignment& alignment, RevealExtentOption revealExtentOption) 2294 { 2292 void FrameSelection::revealSelection(SelectionRevealMode revealMode, const ScrollAlignment& alignment, RevealExtentOption revealExtentOption) 2293 { 2294 if (revealMode == SelectionRevealMode::DoNotReveal) 2295 return; 2296 2295 2297 LayoutRect rect; 2296 2298 … … 2313 2315 if (!m_scrollingSuppressCount) { 2314 2316 layer->setAdjustForIOSCaretWhenScrolling(true); 2315 layer->scrollRectToVisible(re ct, alignment, alignment);2317 layer->scrollRectToVisible(revealMode, rect, alignment, alignment); 2316 2318 layer->setAdjustForIOSCaretWhenScrolling(false); 2317 2319 updateAppearance(); … … 2324 2326 // the selection rect could intersect more than just that. 2325 2327 // See <rdar://problem/4799899>. 2326 if (start.deprecatedNode()->renderer()->scrollRectToVisible(re ct, alignment, alignment))2328 if (start.deprecatedNode()->renderer()->scrollRectToVisible(revealMode, rect, alignment, alignment)) 2327 2329 updateAppearance(); 2328 2330 #endif -
trunk/Source/WebCore/editing/FrameSelection.h
r199817 r202243 29 29 #include "AXTextStateChangeIntent.h" 30 30 #include "EditingStyle.h" 31 #include "Element.h" 31 32 #include "IntRect.h" 32 33 #include "LayoutRect.h" … … 267 268 WEBCORE_EXPORT HTMLFormElement* currentForm() const; 268 269 269 WEBCORE_EXPORT void revealSelection( const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, RevealExtentOption = DoNotRevealExtent);270 WEBCORE_EXPORT void revealSelection(SelectionRevealMode = SelectionRevealMode::Reveal, const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, RevealExtentOption = DoNotRevealExtent); 270 271 WEBCORE_EXPORT void setSelectionFromNone(); 271 272 … … 351 352 bool m_caretBlinks : 1; 352 353 Color m_caretColor; 353 int m_scrollingSuppressCount ;354 int m_scrollingSuppressCount { 0 }; 354 355 #endif 355 356 }; -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r202197 r202243 405 405 else 406 406 restoreCachedSelection(); 407 if (document().frame() && revealMode == SelectionRevealMode::Reveal)408 document().frame()->selection().revealSelection( );407 if (document().frame()) 408 document().frame()->selection().revealSelection(revealMode); 409 409 } else 410 410 HTMLTextFormControlElement::updateFocusAppearance(restorationMode, revealMode); -
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
r200895 r202243 261 261 restoreCachedSelection(Element::defaultFocusTextStateChangeIntent()); 262 262 263 if (document().frame() && revealMode == SelectionRevealMode::Reveal)264 document().frame()->selection().revealSelection( );263 if (document().frame()) 264 document().frame()->selection().revealSelection(revealMode); 265 265 } 266 266 -
trunk/Source/WebCore/page/ContextMenuController.cpp
r199817 r202243 373 373 RefPtr<ReplaceSelectionCommand> command = ReplaceSelectionCommand::create(*document, createFragmentFromMarkup(*document, title, ""), replaceOptions); 374 374 applyCommand(command); 375 frame->selection().revealSelection(S crollAlignment::alignToEdgeIfNeeded);375 frame->selection().revealSelection(SelectionRevealMode::Reveal, ScrollAlignment::alignToEdgeIfNeeded); 376 376 } 377 377 break; -
trunk/Source/WebCore/page/FrameView.cpp
r202198 r202243 3051 3051 // Align to the top and to the closest side (this matches other browsers). 3052 3052 if (anchorNode->renderer()->style().isHorizontalWritingMode()) 3053 anchorNode->renderer()->scrollRectToVisible( rect, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);3053 anchorNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, rect, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways); 3054 3054 else if (anchorNode->renderer()->style().isFlippedBlocksWritingMode()) 3055 anchorNode->renderer()->scrollRectToVisible( rect, ScrollAlignment::alignRightAlways, ScrollAlignment::alignToEdgeIfNeeded);3055 anchorNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, rect, ScrollAlignment::alignRightAlways, ScrollAlignment::alignToEdgeIfNeeded); 3056 3056 else 3057 anchorNode->renderer()->scrollRectToVisible( rect, ScrollAlignment::alignLeftAlways, ScrollAlignment::alignToEdgeIfNeeded);3057 anchorNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, rect, ScrollAlignment::alignLeftAlways, ScrollAlignment::alignToEdgeIfNeeded); 3058 3058 3059 3059 if (AXObjectCache* cache = frame().document()->existingAXObjectCache()) -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r202242 r202243 81 81 #include "HitTestResult.h" 82 82 #include "Logging.h" 83 #include "MainFrame.h" 83 84 #include "NoEventDispatchAssertion.h" 84 85 #include "OverflowEvent.h" … … 2491 2492 } 2492 2493 2493 void RenderLayer::scrollRectToVisible( const LayoutRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY)2494 void RenderLayer::scrollRectToVisible(SelectionRevealMode revealMode, const LayoutRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY) 2494 2495 { 2495 2496 LOG_WITH_STREAM(Scrolling, stream << "Layer " << this << " scrollRectToVisible " << rect); … … 2551 2552 } 2552 2553 } else { 2554 if (revealMode == SelectionRevealMode::RevealUpToMainFrame && frameView.frame().isMainFrame()) 2555 return; 2556 2553 2557 #if !PLATFORM(IOS) 2554 2558 LayoutRect viewRect = frameView.visibleContentRect(); … … 2575 2579 2576 2580 if (parentLayer) 2577 parentLayer->scrollRectToVisible( newRect, alignX, alignY);2581 parentLayer->scrollRectToVisible(revealMode, newRect, alignX, alignY); 2578 2582 } 2579 2583 … … 2668 2672 { 2669 2673 IntPoint currentDocumentPosition = renderer().view().frameView().windowToContents(position); 2670 scrollRectToVisible( LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);2674 scrollRectToVisible(SelectionRevealMode::Reveal, LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded); 2671 2675 } 2672 2676 -
trunk/Source/WebCore/rendering/RenderLayer.h
r201071 r202243 206 206 void availableContentSizeChanged(AvailableSizeChangeReason) override; 207 207 208 void scrollRectToVisible( const LayoutRect&, const ScrollAlignment& alignX, const ScrollAlignment& alignY);208 void scrollRectToVisible(SelectionRevealMode, const LayoutRect&, const ScrollAlignment& alignX, const ScrollAlignment& alignY); 209 209 210 210 LayoutRect getRectToExpose(const LayoutRect& visibleRect, const LayoutRect& visibleRectRelativeToDocument, const LayoutRect& exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY); -
trunk/Source/WebCore/rendering/RenderObject.cpp
r201635 r202243 359 359 } 360 360 361 bool RenderObject::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY) 362 { 361 bool RenderObject::scrollRectToVisible(SelectionRevealMode revealMode, const LayoutRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY) 362 { 363 if (revealMode == SelectionRevealMode::DoNotReveal) 364 return false; 365 363 366 RenderLayer* enclosingLayer = this->enclosingLayer(); 364 367 if (!enclosingLayer) 365 368 return false; 366 369 367 enclosingLayer->scrollRectToVisible(re ct, alignX, alignY);370 enclosingLayer->scrollRectToVisible(revealMode, rect, alignX, alignY); 368 371 return true; 369 372 } -
trunk/Source/WebCore/rendering/RenderObject.h
r202231 r202243 156 156 157 157 // Scrolling is a RenderBox concept, however some code just cares about recursively scrolling our enclosing ScrollableArea(s). 158 WEBCORE_EXPORT bool scrollRectToVisible( const LayoutRect&, const ScrollAlignment& alignX = ScrollAlignment::alignCenterIfNeeded, const ScrollAlignment& alignY = ScrollAlignment::alignCenterIfNeeded);158 WEBCORE_EXPORT bool scrollRectToVisible(SelectionRevealMode, const LayoutRect&, const ScrollAlignment& alignX = ScrollAlignment::alignCenterIfNeeded, const ScrollAlignment& alignY = ScrollAlignment::alignCenterIfNeeded); 159 159 160 160 // Convenience function for getting to the nearest enclosing box of a RenderObject. -
trunk/Source/WebKit/mac/ChangeLog
r202242 r202243 1 2016-06-20 Simon Fraser <simon.fraser@apple.com> 2 3 Focus event dispatched in iframe causes parent document to scroll incorrectly 4 https://bugs.webkit.org/show_bug.cgi?id=158629 5 rdar://problem/26521616 6 7 Reviewed by Tim Horton. 8 9 Pass SelectionRevealMode::Reveal in existing code. 10 11 * WebView/WebFrame.mm: 12 (-[WebFrame _scrollDOMRangeToVisible:]): 13 (-[WebFrame _scrollDOMRangeToVisible:withInset:]): 14 (-[WebFrame revealSelectionAtExtent:]): 15 * WebView/WebHTMLView.mm: 16 (-[WebHTMLView jumpToSelection:]): 17 (-[WebHTMLView centerSelectionInVisibleArea:]): 18 1 19 2016-06-20 Keith Rollin <krollin@apple.com> 2 20 -
trunk/Source/WebKit/mac/WebView/WebFrame.mm
r202242 r202243 718 718 if (startNode && startNode->renderer()) { 719 719 #if !PLATFORM(IOS) 720 startNode->renderer()->scrollRectToVisible( enclosingIntRect(rangeRect), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);720 startNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, enclosingIntRect(rangeRect), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded); 721 721 #else 722 722 RenderLayer* layer = startNode->renderer()->enclosingLayer(); 723 723 if (layer) { 724 724 layer->setAdjustForIOSCaretWhenScrolling(true); 725 startNode->renderer()->scrollRectToVisible( enclosingIntRect(rangeRect), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);725 startNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, enclosingIntRect(rangeRect), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded); 726 726 layer->setAdjustForIOSCaretWhenScrolling(false); 727 727 _private->coreFrame->selection().setCaretRectNeedsUpdate(); … … 742 742 if (layer) { 743 743 layer->setAdjustForIOSCaretWhenScrolling(true); 744 startNode->renderer()->scrollRectToVisible( enclosingIntRect(rangeRect), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);744 startNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, enclosingIntRect(rangeRect), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded); 745 745 layer->setAdjustForIOSCaretWhenScrolling(false); 746 746 … … 1376 1376 WebCore::Frame *frame = core(self); 1377 1377 RevealExtentOption revealExtentOption = revealExtent ? RevealExtent : DoNotRevealExtent; 1378 frame->selection().revealSelection(S crollAlignment::alignToEdgeIfNeeded, revealExtentOption);1378 frame->selection().revealSelection(SelectionRevealMode::Reveal, ScrollAlignment::alignToEdgeIfNeeded, revealExtentOption); 1379 1379 } 1380 1380 -
trunk/Source/WebKit/mac/WebView/WebHTMLView.mm
r201884 r202243 3147 3147 3148 3148 if (Frame* coreFrame = core([self _frame])) 3149 coreFrame->selection().revealSelection(S crollAlignment::alignCenterAlways);3149 coreFrame->selection().revealSelection(SelectionRevealMode::Reveal, ScrollAlignment::alignCenterAlways); 3150 3150 } 3151 3151 … … 5346 5346 5347 5347 if (Frame* coreFrame = core([self _frame])) 5348 coreFrame->selection().revealSelection(S crollAlignment::alignCenterAlways);5348 coreFrame->selection().revealSelection(SelectionRevealMode::Reveal, ScrollAlignment::alignCenterAlways); 5349 5349 } 5350 5350 -
trunk/Source/WebKit2/ChangeLog
r202242 r202243 1 2016-06-20 Simon Fraser <simon.fraser@apple.com> 2 3 Focus event dispatched in iframe causes parent document to scroll incorrectly 4 https://bugs.webkit.org/show_bug.cgi?id=158629 5 rdar://problem/26521616 6 7 Reviewed by Tim Horton. 8 9 Pass SelectionRevealMode::Reveal in existing code. 10 11 * WebProcess/WebPage/WebPage.cpp: 12 (WebKit::WebPage::centerSelectionInVisibleArea): 13 1 14 2016-06-20 Keith Rollin <krollin@apple.com> 2 15 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r202242 r202243 2397 2397 { 2398 2398 Frame& frame = m_page->focusController().focusedOrMainFrame(); 2399 frame.selection().revealSelection(S crollAlignment::alignCenterAlways);2399 frame.selection().revealSelection(SelectionRevealMode::Reveal, ScrollAlignment::alignCenterAlways); 2400 2400 m_findController.showFindIndicatorInSelection(); 2401 2401 }
Note:
See TracChangeset
for help on using the changeset viewer.