From 33db2853923923c29974e1e0b3e9b5de4fc60bdc Mon Sep 17 00:00:00 2001 From: Commit Queue Date: Fri, 17 Jun 2016 06:23:26 +0000 Subject: [PATCH] Unreviewed, rolling out r202147. https://bugs.webkit.org/show_bug.cgi?id=158867 Broke scrolling tests on iOS Simulator (Requested by ap on #webkit). Reverted changeset: "Focus event dispatched in iframe causes parent document to scroll incorrectly" https://bugs.webkit.org/show_bug.cgi?id=158629 http://trac.webkit.org/changeset/202147 Canonical link: https://commits.webkit.org/176938@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202160 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 15 +++++ .../ios/focus-input-in-iframe-expected.txt | 7 --- .../fast/forms/ios/focus-input-in-iframe.html | 48 ---------------- ...ammatic-focus-input-in-iframe-expected.txt | 4 -- .../programmatic-focus-input-in-iframe.html | 57 ------------------- Source/WebCore/ChangeLog | 15 +++++ Source/WebCore/dom/Element.cpp | 10 ++-- Source/WebCore/history/CachedPage.cpp | 15 +++-- 8 files changed, 47 insertions(+), 124 deletions(-) delete mode 100644 LayoutTests/fast/forms/ios/focus-input-in-iframe-expected.txt delete mode 100644 LayoutTests/fast/forms/ios/focus-input-in-iframe.html delete mode 100644 LayoutTests/fast/forms/ios/programmatic-focus-input-in-iframe-expected.txt delete mode 100644 LayoutTests/fast/forms/ios/programmatic-focus-input-in-iframe.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 5b10f9710065..c742692375d6 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,18 @@ +2016-06-16 Commit Queue + + Unreviewed, rolling out r202147. + https://bugs.webkit.org/show_bug.cgi?id=158867 + + Broke scrolling tests on iOS Simulator (Requested by ap on + #webkit). + + Reverted changeset: + + "Focus event dispatched in iframe causes parent document to + scroll incorrectly" + https://bugs.webkit.org/show_bug.cgi?id=158629 + http://trac.webkit.org/changeset/202147 + 2016-06-16 Benjamin Poulain :in-range & :out-of-range CSS pseudo-classes shouldn't match disabled or readonly inputs diff --git a/LayoutTests/fast/forms/ios/focus-input-in-iframe-expected.txt b/LayoutTests/fast/forms/ios/focus-input-in-iframe-expected.txt deleted file mode 100644 index f5a2ebd2ffab..000000000000 --- a/LayoutTests/fast/forms/ios/focus-input-in-iframe-expected.txt +++ /dev/null @@ -1,7 +0,0 @@ -Tests zooming into a text input on tap. - -Click to focus input - -tap location { x: 20.000, y: 62.000 } -scale 1.455 -visibleRect { left: 0.000, top: 1201.976, width: 219.979, height: 329.968 } diff --git a/LayoutTests/fast/forms/ios/focus-input-in-iframe.html b/LayoutTests/fast/forms/ios/focus-input-in-iframe.html deleted file mode 100644 index c3712def0ae8..000000000000 --- a/LayoutTests/fast/forms/ios/focus-input-in-iframe.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - -

Tests zooming into a text input on tap.

- - - - - - diff --git a/LayoutTests/fast/forms/ios/programmatic-focus-input-in-iframe-expected.txt b/LayoutTests/fast/forms/ios/programmatic-focus-input-in-iframe-expected.txt deleted file mode 100644 index 4eef465861ef..000000000000 --- a/LayoutTests/fast/forms/ios/programmatic-focus-input-in-iframe-expected.txt +++ /dev/null @@ -1,4 +0,0 @@ -Tests that a programmatic focus should not scroll into view - -PASS: page did not scroll. - diff --git a/LayoutTests/fast/forms/ios/programmatic-focus-input-in-iframe.html b/LayoutTests/fast/forms/ios/programmatic-focus-input-in-iframe.html deleted file mode 100644 index 6edb5fa45392..000000000000 --- a/LayoutTests/fast/forms/ios/programmatic-focus-input-in-iframe.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - -

Tests that a programmatic focus should not scroll into view

-
- PASS: page did not scroll. -
- - - - - diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 8be134b07418..03cff38eb27e 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2016-06-16 Commit Queue + + Unreviewed, rolling out r202147. + https://bugs.webkit.org/show_bug.cgi?id=158867 + + Broke scrolling tests on iOS Simulator (Requested by ap on + #webkit). + + Reverted changeset: + + "Focus event dispatched in iframe causes parent document to + scroll incorrectly" + https://bugs.webkit.org/show_bug.cgi?id=158629 + http://trac.webkit.org/changeset/202147 + 2016-06-16 Benjamin Poulain :in-range & :out-of-range CSS pseudo-classes shouldn't match disabled or readonly inputs diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp index cdb65a4dc6b1..eebb715b0970 100644 --- a/Source/WebCore/dom/Element.cpp +++ b/Source/WebCore/dom/Element.cpp @@ -2245,8 +2245,6 @@ void Element::focus(bool restorePreviousSelection, FocusDirection direction) } cancelFocusAppearanceUpdate(); - - SelectionRevealMode revealMode = SelectionRevealMode::Reveal; #if PLATFORM(IOS) // Focusing a form element triggers animation in UIKit to scroll to the right position. // Calling updateFocusAppearance() would generate an unnecessary call to ScrollView::setScrollPosition(), @@ -2254,9 +2252,13 @@ void Element::focus(bool restorePreviousSelection, FocusDirection direction) FrameView* view = document().view(); bool isFormControl = view && is(*this); if (isFormControl) - revealMode = SelectionRevealMode::DoNotReveal; + view->setProhibitsScrolling(true); +#endif + updateFocusAppearance(restorePreviousSelection ? SelectionRestorationMode::Restore : SelectionRestorationMode::SetDefault); +#if PLATFORM(IOS) + if (isFormControl) + view->setProhibitsScrolling(false); #endif - updateFocusAppearance(restorePreviousSelection ? SelectionRestorationMode::Restore : SelectionRestorationMode::SetDefault, revealMode); } void Element::updateFocusAppearanceAfterAttachIfNeeded() diff --git a/Source/WebCore/history/CachedPage.cpp b/Source/WebCore/history/CachedPage.cpp index e701ad72b70a..add64e0c1b2e 100644 --- a/Source/WebCore/history/CachedPage.cpp +++ b/Source/WebCore/history/CachedPage.cpp @@ -77,18 +77,25 @@ void CachedPage::restore(Page& page) m_cachedMainFrame->open(); // Restore the focus appearance for the focused element. - // FIXME: Right now we don't support pages with frames in the b/f cache. This may need to be tweaked when we add support for that. + // FIXME: Right now we don't support pages w/ frames in the b/f cache. This may need to be tweaked when we add support for that. Document* focusedDocument = page.focusController().focusedOrMainFrame().document(); if (Element* element = focusedDocument->focusedElement()) { - SelectionRevealMode revealMode = SelectionRevealMode::Reveal; #if PLATFORM(IOS) // We don't want focused nodes changing scroll position when restoring from the cache // as it can cause ugly jumps before we manage to restore the cached position. page.mainFrame().selection().suppressScrolling(); - revealMode = SelectionRevealMode::DoNotReveal; + + bool hadProhibitsScrolling = false; + FrameView* frameView = page.mainFrame().view(); + if (frameView) { + hadProhibitsScrolling = frameView->prohibitsScrolling(); + frameView->setProhibitsScrolling(true); + } #endif - element->updateFocusAppearance(SelectionRestorationMode::Restore, revealMode); + element->updateFocusAppearance(SelectionRestorationMode::Restore); #if PLATFORM(IOS) + if (frameView) + frameView->setProhibitsScrolling(hadProhibitsScrolling); page.mainFrame().selection().restoreScrolling(); #endif }