Changeset 202292 in webkit
- Timestamp:
- Jun 21, 2016, 1:57:29 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 15 added
- 25 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202290 r202292 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-21 Alexey Proskuryakov <ap@apple.com> 2 15 -
trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations
r201724 r202292 861 861 fast/overflow/overflow-update-transform.html [ Failure ] 862 862 fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto.html [ Failure ] 863 fast/overflow/scroll-vertical-not-horizontal.html [ Failure ]863 # fast/overflow/scroll-vertical-not-horizontal.html [ Failure ] 864 864 fast/regions/region-styling/region-style-block-background-color2.html [ ImageOnlyFailure ] 865 865 fast/shapes/shape-outside-floats/shape-outside-floats-circle-000.html [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/ios-simulator-wk1/fast/overflow/scrollRevealButton-expected.txt
r202291 r202292 16 16 RenderBlock {HTML} at (0,0) size 300x316 17 17 RenderBody {BODY} at (8,8) size 284x300 18 layer at (8,8) size 300x300 clip at (8,8) size 285x300scrollY 545 scrollHeight 127018 layer at (8,8) size 300x300 scrollY 545 scrollHeight 1270 19 19 RenderBlock {DIV} at (0,0) size 300x300 20 RenderBlock (anonymous) at (0,0) size 285x2020 RenderBlock (anonymous) at (0,0) size 300x20 21 21 RenderText {#text} at (0,0) size 90x19 22 22 text run at (0,0) width 90: "overflow:auto" 23 RenderBlock {DIV} at (0,20) size 285x60024 RenderBlock {DIV} at (0,770) size 285x50025 layer at (8,83) size 150x150 clip at (8,83) size 135x150scrollY 477 scrollHeight 86423 RenderBlock {DIV} at (0,20) size 300x600 24 RenderBlock {DIV} at (0,770) size 300x500 25 layer at (8,83) size 150x150 scrollY 477 scrollHeight 864 26 26 RenderBlock {DIV} at (0,620) size 150x150 27 RenderBlock (anonymous) at (0,0) size 1 35x2027 RenderBlock (anonymous) at (0,0) size 150x20 28 28 RenderText {#text} at (0,0) size 90x19 29 29 text run at (0,0) width 90: "overflow:auto" 30 RenderBlock {DIV} at (0,20) size 1 35x50031 RenderBlock (anonymous) at (0,520) size 1 35x4430 RenderBlock {DIV} at (0,20) size 150x500 31 RenderBlock (anonymous) at (0,520) size 150x44 32 32 RenderBR {BR} at (0,0) size 0x19 33 33 RenderButton {INPUT} at (2,22) size 56x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)] … … 36 36 text run at (0,0) width 32: "Button" 37 37 RenderText {#text} at (0,0) size 0x0 38 RenderBlock {DIV} at (0,564) size 1 35x30038 RenderBlock {DIV} at (0,564) size 150x300 39 39 RenderText {#text} at (0,0) size 0x0 40 40 RenderBlock {DIV} at (0,674) size 784x500 41 scrolled to 0,38841 frame 'fr' scrolled to 0,18 -
trunk/LayoutTests/platform/ios-simulator-wk2/fast/overflow/scrollRevealButton-expected.txt
r177430 r202292 39 39 RenderText {#text} at (0,0) size 0x0 40 40 RenderBlock {DIV} at (0,674) size 784x500 41 scrolled to 0,388 -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r202170 r202292 1760 1760 fast/forms/option-mouseevents.html [ Failure ] 1761 1761 fast/forms/password-doubleclick-selection.html [ Failure ] 1762 fast/forms/password-placeholder-text-security.html [ ImageOnlyFailure ]1762 fast/forms/password-placeholder-text-security.html [ Pass ImageOnlyFailure ] 1763 1763 fast/forms/placeholder-position.html [ Failure ] 1764 fast/forms/radio/indeterminate-radio.html [ Failure ]1764 fast/forms/radio/indeterminate-radio.html [ Pass Failure ] 1765 1765 fast/forms/range/range-drag-when-toggled-disabled.html [ Failure ] 1766 1766 fast/forms/range/range-drag.html [ Failure ] … … 2942 2942 fast/inline/inline-with-outline-offset.html [ ImageOnlyFailure ] 2943 2943 fast/inline/outline-corners-with-offset.html [ ImageOnlyFailure ] 2944 fast/overflow/overflow-hidden-scroll-into-view.html [ ImageOnlyFailure ]2944 fast/overflow/overflow-hidden-scroll-into-view.html [ Pass ImageOnlyFailure ] 2945 2945 fast/regions/layers/region-removed-during-animation.html [ ImageOnlyFailure ] 2946 2946 fast/sub-pixel/table-with-subpixel-cell-size.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r202284 r202292 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-21 Frederic Wang <fwang@igalia.com> 2 56 -
trunk/Source/WebCore/dom/Document.h
r202263 r202292 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
r202263 r202292 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
r202263 r202292 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
r202263 r202292 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
r202263 r202292 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
r202263 r202292 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
r202263 r202292 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
r202263 r202292 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
r202263 r202292 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
r202263 r202292 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
r202263 r202292 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
r202263 r202292 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
r202263 r202292 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
r202278 r202292 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
r202279 r202292 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-21 Amir Alavi <aalavi@apple.com> 2 20 -
trunk/Source/WebKit/mac/WebView/WebFrame.mm
r202263 r202292 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
r202263 r202292 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/WebKit/win/WebView.cpp
r202163 r202292 3973 3973 return E_UNEXPECTED; 3974 3974 3975 coreFrame->selection().revealSelection(S crollAlignment::alignCenterAlways);3975 coreFrame->selection().revealSelection(SelectionRevealMode::Reveal, ScrollAlignment::alignCenterAlways); 3976 3976 return S_OK; 3977 3977 } -
trunk/Source/WebKit2/ChangeLog
r202291 r202292 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-21 Said Abou-Hallawa <sabouhallawa@apple,com> 2 15 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r202263 r202292 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.