Skip to content

Commit

Permalink
Unreviewed, rolling out r202147.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
webkit-commit-queue committed Jun 17, 2016
1 parent 5916341 commit 33db285
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 124 deletions.
15 changes: 15 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
2016-06-16 Commit Queue <commit-queue@webkit.org>

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 <bpoulain@apple.com>

:in-range & :out-of-range CSS pseudo-classes shouldn't match disabled or readonly inputs
Expand Down
7 changes: 0 additions & 7 deletions LayoutTests/fast/forms/ios/focus-input-in-iframe-expected.txt

This file was deleted.

48 changes: 0 additions & 48 deletions LayoutTests/fast/forms/ios/focus-input-in-iframe.html

This file was deleted.

This file was deleted.

57 changes: 0 additions & 57 deletions LayoutTests/fast/forms/ios/programmatic-focus-input-in-iframe.html

This file was deleted.

15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
2016-06-16 Commit Queue <commit-queue@webkit.org>

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 <bpoulain@apple.com>

:in-range & :out-of-range CSS pseudo-classes shouldn't match disabled or readonly inputs
Expand Down
10 changes: 6 additions & 4 deletions Source/WebCore/dom/Element.cpp
Expand Up @@ -2245,18 +2245,20 @@ 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(),
// which would jump us around during this animation. See <rdar://problem/6699741>.
FrameView* view = document().view();
bool isFormControl = view && is<HTMLFormControlElement>(*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()
Expand Down
15 changes: 11 additions & 4 deletions Source/WebCore/history/CachedPage.cpp
Expand Up @@ -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
}
Expand Down

0 comments on commit 33db285

Please sign in to comment.