WebKit Bugzilla
Attachment 358387 Details for
Bug 192996
: REGRESSION (r238522): Erratic scrolling on Google flights search result page and vrbo.com
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch and layout test
bug-192996-20190104154107.patch (text/plain), 5.42 KB, created by
Daniel Bates
on 2019-01-04 15:41:08 PST
(
hide
)
Description:
Patch and layout test
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-01-04 15:41:08 PST
Size:
5.42 KB
patch
obsolete
>Subversion Revision: 239512 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 1e56380a84f2844b4f963fdf577fe990b63c1f88..fb1f93303c6d3bc5140cac530f1b0d887a3d2927 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-01-04 Daniel Bates <dabates@apple.com> >+ >+ REGRESSION (r238522): Erratic scrolling on Google flights search result page and vrbo.com >+ https://bugs.webkit.org/show_bug.cgi?id=192996 >+ <rdar://problem/46573552> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Only scroll a text field if its inner text size changes and it is the currently active and >+ focused element on the page. >+ >+ Test: fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html >+ >+ * rendering/RenderTextControlSingleLine.cpp: >+ (WebCore::RenderTextControlSingleLine::layout): >+ > 2018-12-21 Zalan Bujtas <zalan@apple.com> > > Synchronous media query evaluation could destroy current Frame/FrameView. >diff --git a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp >index 298fac2ac2a2563dbb8cc4630a28a265961a09cc..3054b44762c9dc49aaa2729bd4c79677af178a85 100644 >--- a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp >+++ b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp >@@ -212,7 +212,7 @@ void RenderTextControlSingleLine::layout() > if (inputElement().isSearchField()) > RenderThemeIOS::adjustRoundBorderRadius(mutableStyle(), *this); > #endif >- if (innerTextSizeChanged) { >+ if (innerTextSizeChanged && frame().selection().isFocusedAndActive() && document().focusedElement() == &inputElement()) { > // The caps lock indicator was hidden or shown. If it is now visible then it may be occluding > // the current selection (say, the caret was after the last character in the text field). > // Schedule an update and reveal of the current selection. >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index ffd7c51aa49fa80a6c000d7b8a860ef60eadfc89..307b1f3a4cd1d97772f49feb45b5788cc0878e29 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2019-01-04 Daniel Bates <dabates@apple.com> >+ >+ REGRESSION (r238522): Erratic scrolling on Google flights search result page and vrbo.com >+ https://bugs.webkit.org/show_bug.cgi?id=192996 >+ <rdar://problem/46573552> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a test to ensure that we do not scroll the page when we lay out an unfocused text field. >+ >+ * fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout-expected.txt: Added. >+ * fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html: Added. >+ > 2018-12-21 Zalan Bujtas <zalan@apple.com> > > Synchronous media query evaluation could destroy current Frame/FrameView. >diff --git a/LayoutTests/fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout-expected.txt b/LayoutTests/fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..b5ee1f328753c37c8b6466c4e21db3080c322290 >--- /dev/null >+++ b/LayoutTests/fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout-expected.txt >@@ -0,0 +1,10 @@ >+Tests that the page is not scrolled to the current selection when an unfocused text field is laid out. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS window.scrollY is 0 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html b/LayoutTests/fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html >new file mode 100644 >index 0000000000000000000000000000000000000000..259858e3a9835adeac3523d0ed8c28a041c0683e >--- /dev/null >+++ b/LayoutTests/fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html >@@ -0,0 +1,45 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/js-test.js"></script> >+<style> >+#text { >+ margin-top: 1000px; /* Position outside the viewport so that we would have to scroll to see this element. */ >+ width: 256px; >+ height: 256px; >+ background-color: red; >+ color: white; >+} >+</style> >+</head> >+<body> >+<p id="description"></p> >+<div id="console"></div> >+<div id="test-container"> >+ <p id="text">If you see this text then the test FAILed.</p> >+ <input type="text" id="text-field" placeholder="placeholder"> >+</div> >+<script> >+function handleSelectionChange() { >+ // Trigger a re-layout of the text field. >+ document.getElementById("text-field").style.width = "20px"; >+ >+ // Use a zero timer to allow for a scroll to happen, if it were to happen. (We do not expect a scroll to happen). >+ window.setTimeout(() => { >+ shouldBeZero("window.scrollY"); >+ if (window.testRunner) >+ document.body.removeChild(document.getElementById("test-container")); >+ finishJSTest(); >+ }, 0); >+}; >+ >+window.jsTestIsAsync = true; >+ >+description("Tests that the page is not scrolled to the current selection when an unfocused text field is laid out."); >+ >+document.addEventListener("selectionchange", handleSelectionChange, { once: true }); >+let text = document.getElementById("text"); >+window.getSelection().setBaseAndExtent(text.firstChild, 0, text.firstChild, 0); >+</script> >+</body> >+</html> >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192996
:
357999
| 358387