<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[191451] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/191451">191451</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-22 04:37:46 -0700 (Thu, 22 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/181972">r181972</a>): Scroll position changes to top of youtube page when switching tabs
https://bugs.webkit.org/show_bug.cgi?id=150428

Reviewed by Antti Koivisto.

Source/WebCore:

The bug was caused by updateFocusAppearance in WebPage::restoreSelectionInFocusedEditableElement
revealing the focused element which was added in <a href="http://trac.webkit.org/projects/webkit/changeset/181972">r181972</a>. Fixed the bug by adding an option to
suppress this behavior here.

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::updateFocusAppearanceSoon):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::focus):
(WebCore::Element::updateFocusAppearanceAfterAttachIfNeeded):
(WebCore::Element::updateFocusAppearance):
* dom/Element.h:
* history/CachedPage.cpp:
(WebCore::CachedPage::restore):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::updateFocusAppearance):
* html/HTMLAreaElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateFocusAppearance):
(WebCore::HTMLInputElement::runPostTypeUpdateTasks):
(WebCore::HTMLInputElement::didAttachRenderers):
* html/HTMLInputElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::updateFocusAppearance):
* html/HTMLTextAreaElement.h:

Source/WebKit2:

Call updateFocusAppearance with RevealMode::DoNotReveal to avoid revealing the focused element.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::restoreSelectionInFocusedEditableElement):

Tools:

Added a regression test using WebKit API test.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/FirstResponderScrollingPosition.mm: Added.
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::TEST):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCorehistoryCachedPagecpp">trunk/Source/WebCore/history/CachedPage.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAreaElementcpp">trunk/Source/WebCore/html/HTMLAreaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAreaElementh">trunk/Source/WebCore/html/HTMLAreaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementcpp">trunk/Source/WebCore/html/HTMLInputElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementh">trunk/Source/WebCore/html/HTMLInputElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementcpp">trunk/Source/WebCore/html/HTMLTextAreaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementh">trunk/Source/WebCore/html/HTMLTextAreaElement.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPITestsmacFirstResponderScrollingPositionmm">trunk/Tools/TestWebKitAPI/Tests/mac/FirstResponderScrollingPosition.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebCore/ChangeLog        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2015-10-22  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        REGRESSION (r181972): Scroll position changes to top of youtube page when switching tabs
+        https://bugs.webkit.org/show_bug.cgi?id=150428
+
+        Reviewed by Antti Koivisto.
+
+        The bug was caused by updateFocusAppearance in WebPage::restoreSelectionInFocusedEditableElement
+        revealing the focused element which was added in r181972. Fixed the bug by adding an option to
+        suppress this behavior here.
+
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::Document::updateFocusAppearanceSoon):
+        * dom/Document.h:
+        * dom/Element.cpp:
+        (WebCore::Element::focus):
+        (WebCore::Element::updateFocusAppearanceAfterAttachIfNeeded):
+        (WebCore::Element::updateFocusAppearance):
+        * dom/Element.h:
+        * history/CachedPage.cpp:
+        (WebCore::CachedPage::restore):
+        * html/HTMLAreaElement.cpp:
+        (WebCore::HTMLAreaElement::updateFocusAppearance):
+        * html/HTMLAreaElement.h:
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::updateFocusAppearance):
+        (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
+        (WebCore::HTMLInputElement::didAttachRenderers):
+        * html/HTMLInputElement.h:
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::updateFocusAppearance):
+        * html/HTMLTextAreaElement.h:
+
</ins><span class="cx"> 2015-10-22  Joonghun Park  &lt;jh718.park@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL] Fix build break since r191439
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebCore/dom/Document.cpp        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -455,7 +455,7 @@
</span><span class="cx">     , m_closeAfterStyleRecalc(false)
</span><span class="cx">     , m_gotoAnchorNeededAfterStylesheetsLoad(false)
</span><span class="cx">     , m_frameElementsShouldIgnoreScrolling(false)
</span><del>-    , m_updateFocusAppearanceRestoresSelection(false)
</del><ins>+    , m_updateFocusAppearanceRestoresSelection(SelectionRestorationMode::SetDefault)
</ins><span class="cx">     , m_ignoreDestructiveWriteCount(0)
</span><span class="cx">     , m_markers(std::make_unique&lt;DocumentMarkerController&gt;(*this))
</span><span class="cx">     , m_updateFocusAppearanceTimer(*this, &amp;Document::updateFocusAppearanceTimerFired)
</span><span class="lines">@@ -5079,9 +5079,9 @@
</span><span class="cx">         m_pendingStateObject = stateObject;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Document::updateFocusAppearanceSoon(bool restorePreviousSelection)
</del><ins>+void Document::updateFocusAppearanceSoon(SelectionRestorationMode mode)
</ins><span class="cx"> {
</span><del>-    m_updateFocusAppearanceRestoresSelection = restorePreviousSelection;
</del><ins>+    m_updateFocusAppearanceRestoresSelection = mode;
</ins><span class="cx">     if (!m_updateFocusAppearanceTimer.isActive())
</span><span class="cx">         m_updateFocusAppearanceTimer.startOneShot(0);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebCore/dom/Document.h        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -274,6 +274,16 @@
</span><span class="cx"> 
</span><span class="cx"> enum DimensionsCheck { WidthDimensionsCheck = 1 &lt;&lt; 0, HeightDimensionsCheck = 1 &lt;&lt; 1, AllDimensionsCheck = 1 &lt;&lt; 2 };
</span><span class="cx"> 
</span><ins>+enum class SelectionRestorationMode {
+    Restore,
+    SetDefault,
+};
+
+enum class SelectionRevealMode {
+    Reveal,
+    DoNotReveal
+};
+
</ins><span class="cx"> enum class HttpEquivPolicy {
</span><span class="cx">     Enabled,
</span><span class="cx">     DisabledBySettings,
</span><span class="lines">@@ -966,7 +976,7 @@
</span><span class="cx">     bool hasNodesWithPlaceholderStyle() const { return m_hasNodesWithPlaceholderStyle; }
</span><span class="cx">     void setHasNodesWithPlaceholderStyle() { m_hasNodesWithPlaceholderStyle = true; }
</span><span class="cx"> 
</span><del>-    void updateFocusAppearanceSoon(bool restorePreviousSelection);
</del><ins>+    void updateFocusAppearanceSoon(SelectionRestorationMode);
</ins><span class="cx">     void cancelFocusAppearanceUpdate();
</span><span class="cx"> 
</span><span class="cx">     // Extension for manipulating canvas drawing contexts for use in CSS
</span><span class="lines">@@ -1492,7 +1502,7 @@
</span><span class="cx">     bool m_isDNSPrefetchEnabled;
</span><span class="cx">     bool m_haveExplicitlyDisabledDNSPrefetch;
</span><span class="cx">     bool m_frameElementsShouldIgnoreScrolling;
</span><del>-    bool m_updateFocusAppearanceRestoresSelection;
</del><ins>+    SelectionRestorationMode m_updateFocusAppearanceRestoresSelection;
</ins><span class="cx"> 
</span><span class="cx">     // http://www.whatwg.org/specs/web-apps/current-work/#ignore-destructive-writes-counter
</span><span class="cx">     unsigned m_ignoreDestructiveWriteCount;
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebCore/dom/Element.cpp        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -2219,7 +2219,7 @@
</span><span class="cx">     if (isFormControl)
</span><span class="cx">         view-&gt;setProhibitsScrolling(true);
</span><span class="cx"> #endif
</span><del>-    updateFocusAppearance(restorePreviousSelection);
</del><ins>+    updateFocusAppearance(restorePreviousSelection ? SelectionRestorationMode::Restore : SelectionRestorationMode::SetDefault);
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     if (isFormControl)
</span><span class="cx">         view-&gt;setProhibitsScrolling(false);
</span><span class="lines">@@ -2234,11 +2234,11 @@
</span><span class="cx">     if (!data-&gt;needsFocusAppearanceUpdateSoonAfterAttach())
</span><span class="cx">         return;
</span><span class="cx">     if (isFocusable() &amp;&amp; document().focusedElement() == this)
</span><del>-        document().updateFocusAppearanceSoon(false /* don't restore selection */);
</del><ins>+        document().updateFocusAppearanceSoon(SelectionRestorationMode::SetDefault);
</ins><span class="cx">     data-&gt;setNeedsFocusAppearanceUpdateSoonAfterAttach(false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Element::updateFocusAppearance(bool /*restorePreviousSelection*/)
</del><ins>+void Element::updateFocusAppearance(SelectionRestorationMode, SelectionRevealMode revealMode)
</ins><span class="cx"> {
</span><span class="cx">     if (isRootEditableElement()) {
</span><span class="cx">         Frame* frame = document().frame();
</span><span class="lines">@@ -2254,9 +2254,10 @@
</span><span class="cx">         
</span><span class="cx">         if (frame-&gt;selection().shouldChangeSelection(newSelection)) {
</span><span class="cx">             frame-&gt;selection().setSelection(newSelection, FrameSelection::defaultSetSelectionOptions(), Element::defaultFocusTextStateChangeIntent());
</span><del>-            frame-&gt;selection().revealSelection();
</del><ins>+            if (revealMode == SelectionRevealMode::Reveal)
+                frame-&gt;selection().revealSelection();
</ins><span class="cx">         }
</span><del>-    } else if (renderer() &amp;&amp; !renderer()-&gt;isWidget())
</del><ins>+    } else if (renderer() &amp;&amp; !renderer()-&gt;isWidget() &amp;&amp; revealMode == SelectionRevealMode::Reveal)
</ins><span class="cx">         renderer()-&gt;scrollRectToVisible(renderer()-&gt;anchorRect());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebCore/dom/Element.h        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -327,7 +327,7 @@
</span><span class="cx">     static AXTextStateChangeIntent defaultFocusTextStateChangeIntent() { return AXTextStateChangeIntent(AXTextStateChangeTypeSelectionMove, AXTextSelection { AXTextSelectionDirectionDiscontiguous, AXTextSelectionGranularityUnknown, true }); }
</span><span class="cx">     void updateFocusAppearanceAfterAttachIfNeeded();
</span><span class="cx">     virtual void focus(bool restorePreviousSelection = true, FocusDirection = FocusDirectionNone);
</span><del>-    virtual void updateFocusAppearance(bool restorePreviousSelection);
</del><ins>+    virtual void updateFocusAppearance(SelectionRestorationMode, SelectionRevealMode = SelectionRevealMode::Reveal);
</ins><span class="cx">     virtual void blur();
</span><span class="cx"> 
</span><span class="cx">     String innerHTML() const;
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryCachedPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/CachedPage.cpp (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/CachedPage.cpp        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebCore/history/CachedPage.cpp        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">             frameView-&gt;setProhibitsScrolling(true);
</span><span class="cx">         }
</span><span class="cx"> #endif
</span><del>-        element-&gt;updateFocusAppearance(true);
</del><ins>+        element-&gt;updateFocusAppearance(SelectionRestorationMode::Restore);
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">         if (frameView)
</span><span class="cx">             frameView-&gt;setProhibitsScrolling(hadProhibitsScrolling);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAreaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAreaElement.cpp (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAreaElement.cpp        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebCore/html/HTMLAreaElement.cpp        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -224,7 +224,7 @@
</span><span class="cx">     downcast&lt;RenderImage&gt;(*renderer).areaElementFocusChanged(this);
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-void HTMLAreaElement::updateFocusAppearance(bool restorePreviousSelection)
</del><ins>+void HTMLAreaElement::updateFocusAppearance(SelectionRestorationMode restorationMode, SelectionRevealMode revealMode)
</ins><span class="cx"> {
</span><span class="cx">     if (!isFocusable())
</span><span class="cx">         return;
</span><span class="lines">@@ -233,7 +233,7 @@
</span><span class="cx">     if (!imageElement)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    imageElement-&gt;updateFocusAppearance(restorePreviousSelection);
</del><ins>+    imageElement-&gt;updateFocusAppearance(restorationMode, revealMode);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> bool HTMLAreaElement::supportsFocus() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAreaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAreaElement.h (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAreaElement.h        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebCore/html/HTMLAreaElement.h        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">     virtual bool isKeyboardFocusable(KeyboardEvent*) const override;
</span><span class="cx">     virtual bool isMouseFocusable() const override;
</span><span class="cx">     virtual bool isFocusable() const override;
</span><del>-    virtual void updateFocusAppearance(bool /*restorePreviousSelection*/) override;
</del><ins>+    virtual void updateFocusAppearance(SelectionRestorationMode, SelectionRevealMode) override;
</ins><span class="cx">     virtual void setFocus(bool) override;
</span><span class="cx"> 
</span><span class="cx">     enum Shape { Default, Poly, Rect, Circle, Unknown };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.cpp        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -402,17 +402,17 @@
</span><span class="cx">     return HTMLTextFormControlElement::isMouseFocusable();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLInputElement::updateFocusAppearance(bool restorePreviousSelection)
</del><ins>+void HTMLInputElement::updateFocusAppearance(SelectionRestorationMode restorationMode, SelectionRevealMode revealMode)
</ins><span class="cx"> {
</span><span class="cx">     if (isTextField()) {
</span><del>-        if (!restorePreviousSelection || !hasCachedSelection())
</del><ins>+        if (restorationMode == SelectionRestorationMode::SetDefault || !hasCachedSelection())
</ins><span class="cx">             select(Element::defaultFocusTextStateChangeIntent());
</span><span class="cx">         else
</span><span class="cx">             restoreCachedSelection();
</span><del>-        if (document().frame())
</del><ins>+        if (document().frame() &amp;&amp; revealMode == SelectionRevealMode::Reveal)
</ins><span class="cx">             document().frame()-&gt;selection().revealSelection();
</span><span class="cx">     } else
</span><del>-        HTMLTextFormControlElement::updateFocusAppearance(restorePreviousSelection);
</del><ins>+        HTMLTextFormControlElement::updateFocusAppearance(restorationMode, revealMode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLInputElement::endEditing()
</span><span class="lines">@@ -528,7 +528,7 @@
</span><span class="cx">         setNeedsStyleRecalc(ReconstructRenderTree);
</span><span class="cx"> 
</span><span class="cx">     if (document().focusedElement() == this)
</span><del>-        updateFocusAppearance(true);
</del><ins>+        updateFocusAppearance(SelectionRestorationMode::Restore, SelectionRevealMode::Reveal);
</ins><span class="cx"> 
</span><span class="cx">     setChangedSinceLastFormControlChangeEvent(false);
</span><span class="cx"> 
</span><span class="lines">@@ -785,7 +785,7 @@
</span><span class="cx">     m_inputType-&gt;attach();
</span><span class="cx"> 
</span><span class="cx">     if (document().focusedElement() == this)
</span><del>-        document().updateFocusAppearanceSoon(true /* restore selection */);
</del><ins>+        document().updateFocusAppearanceSoon(SelectionRestorationMode::Restore);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLInputElement::didDetachRenderers()
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.h (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.h        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebCore/html/HTMLInputElement.h        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">     virtual bool isMouseFocusable() const override final;
</span><span class="cx">     virtual bool isEnumeratable() const override final;
</span><span class="cx">     virtual bool supportLabels() const override final;
</span><del>-    virtual void updateFocusAppearance(bool restorePreviousSelection) override final;
</del><ins>+    virtual void updateFocusAppearance(SelectionRestorationMode, SelectionRevealMode) override final;
</ins><span class="cx">     virtual bool shouldUseInputMethod() override final;
</span><span class="cx"> 
</span><span class="cx">     virtual bool isTextFormControl() const override final { return isTextField(); }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -251,9 +251,9 @@
</span><span class="cx">     return isFocusable();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLTextAreaElement::updateFocusAppearance(bool restorePreviousSelection)
</del><ins>+void HTMLTextAreaElement::updateFocusAppearance(SelectionRestorationMode restorationMode, SelectionRevealMode revealMode)
</ins><span class="cx"> {
</span><del>-    if (!restorePreviousSelection || !hasCachedSelection()) {
</del><ins>+    if (restorationMode == SelectionRestorationMode::SetDefault || !hasCachedSelection()) {
</ins><span class="cx">         // If this is the first focus, set a caret at the beginning of the text.  
</span><span class="cx">         // This matches some browsers' behavior; see bug 11746 Comment #15.
</span><span class="cx">         // http://bugs.webkit.org/show_bug.cgi?id=11746#c15
</span><span class="lines">@@ -261,7 +261,7 @@
</span><span class="cx">     } else
</span><span class="cx">         restoreCachedSelection(Element::defaultFocusTextStateChangeIntent());
</span><span class="cx"> 
</span><del>-    if (document().frame())
</del><ins>+    if (document().frame() &amp;&amp; revealMode == SelectionRevealMode::Reveal)
</ins><span class="cx">         document().frame()-&gt;selection().revealSelection();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.h (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.h        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.h        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx">     virtual bool hasCustomFocusLogic() const override;
</span><span class="cx">     virtual bool isMouseFocusable() const override;
</span><span class="cx">     virtual bool isKeyboardFocusable(KeyboardEvent*) const override;
</span><del>-    virtual void updateFocusAppearance(bool restorePreviousSelection) override;
</del><ins>+    virtual void updateFocusAppearance(SelectionRestorationMode, SelectionRevealMode) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void accessKeyAction(bool sendMouseEvents) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-10-22  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        REGRESSION (r181972): Scroll position changes to top of youtube page when switching tabs
+        https://bugs.webkit.org/show_bug.cgi?id=150428
+
+        Reviewed by Antti Koivisto.
+
+        Call updateFocusAppearance with RevealMode::DoNotReveal to avoid revealing the focused element.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::restoreSelectionInFocusedEditableElement):
+
</ins><span class="cx"> 2015-10-22  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed. Fix a crash in GTk+ after r191402.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -3444,7 +3444,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (auto document = frame.document()) {
</span><span class="cx">         if (auto element = document-&gt;focusedElement())
</span><del>-            element-&gt;updateFocusAppearance(true /* restoreSelection */);
</del><ins>+            element-&gt;updateFocusAppearance(SelectionRestorationMode::Restore, SelectionRevealMode::DoNotReveal);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Tools/ChangeLog        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-10-22  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        REGRESSION (r181972): Scroll position changes to top of youtube page when switching tabs
+        https://bugs.webkit.org/show_bug.cgi?id=150428
+
+        Reviewed by Antti Koivisto.
+
+        Added a regression test using WebKit API test.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/mac/FirstResponderScrollingPosition.mm: Added.
+        (TestWebKitAPI::didFinishLoadForFrame):
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2015-10-22  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed. Fix GTK+ build after r191423.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (191450 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-10-22 10:50:09 UTC (rev 191450)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -265,6 +265,7 @@
</span><span class="cx">                 93F7E86F14DC8E5C00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F7E86E14DC8E5B00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp */; };
</span><span class="cx">                 9B26FCCA159D16DE00CC3765 /* HTMLFormCollectionNamedItem.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */; };
</span><span class="cx">                 9B4F8FA7159D52DD002D9F94 /* HTMLCollectionNamedItem.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B4F8FA6159D52CA002D9F94 /* HTMLCollectionNamedItem.html */; };
</span><ins>+                9B7916501BD89D0D00D50B8F /* FirstResponderScrollingPosition.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9B79164F1BD89D0D00D50B8F /* FirstResponderScrollingPosition.mm */; settings = {ASSET_TAGS = (); }; };
</ins><span class="cx">                 A13EBBAA1B87428D00097110 /* WebProcessPlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = A13EBBA91B87428D00097110 /* WebProcessPlugIn.mm */; };
</span><span class="cx">                 A13EBBAB1B87434600097110 /* PlatformUtilitiesCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F139E721A423A2B00F590F5 /* PlatformUtilitiesCocoa.mm */; };
</span><span class="cx">                 A13EBBB01B87436F00097110 /* BundleParametersPlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = A13EBBAE1B87436F00097110 /* BundleParametersPlugIn.mm */; };
</span><span class="lines">@@ -638,6 +639,7 @@
</span><span class="cx">                 9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = HTMLFormCollectionNamedItem.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9B4F8FA3159D52B1002D9F94 /* HTMLCollectionNamedItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HTMLCollectionNamedItem.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9B4F8FA6159D52CA002D9F94 /* HTMLCollectionNamedItem.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = HTMLCollectionNamedItem.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                9B79164F1BD89D0D00D50B8F /* FirstResponderScrollingPosition.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FirstResponderScrollingPosition.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A13EBB491B87339E00097110 /* TestWebKitAPI.wkbundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestWebKitAPI.wkbundle; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">                 A13EBB521B87346600097110 /* WebProcessPlugIn.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebProcessPlugIn.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A13EBB541B8734E000097110 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1313,6 +1315,7 @@
</span><span class="cx">                                 7A99D9931AD4A29D00373141 /* MenuTypesForMouseEvents.mm */,
</span><span class="cx">                                 E19DB9781B32137C00DB38D4 /* NavigatorLanguage.mm */,
</span><span class="cx">                                 A57A34EF16AF677200C2501F /* PageVisibilityStateWithWindowChanges.mm */,
</span><ins>+                                9B79164F1BD89D0D00D50B8F /* FirstResponderScrollingPosition.mm */,
</ins><span class="cx">                                 00BC16851680FE810065F1E5 /* PublicSuffix.mm */,
</span><span class="cx">                                 37C784DE197C8F2E0010A496 /* RenderedImageFromDOMNode.mm */,
</span><span class="cx">                                 3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */,
</span><span class="lines">@@ -1752,6 +1755,7 @@
</span><span class="cx">                                 A1C4FB6E1BACCE50003742D0 /* QuickLook.mm in Sources */,
</span><span class="cx">                                 7A5623111AD5AF3E0096B920 /* MenuTypesForMouseEvents.cpp in Sources */,
</span><span class="cx">                                 51CB4AD81B3A079C00C1B1C6 /* ModalAlertsSPI.cpp in Sources */,
</span><ins>+                                9B7916501BD89D0D00D50B8F /* FirstResponderScrollingPosition.mm in Sources */,
</ins><span class="cx">                                 1CF0D3791BBF2F3D00B4EF54 /* WKRetainPtr.cpp in Sources */,
</span><span class="cx">                                 26F6E1F01ADC749B00DE696B /* DFAMinimizer.cpp in Sources */,
</span><span class="cx">                                 260BA5791B1D2E7B004FA07C /* DFACombiner.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsmacFirstResponderScrollingPositionmm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/mac/FirstResponderScrollingPosition.mm (0 => 191451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/mac/FirstResponderScrollingPosition.mm                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/FirstResponderScrollingPosition.mm        2015-10-22 11:37:46 UTC (rev 191451)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+/*
+ * Copyright (C) 2011, 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;JavaScriptTest.h&quot;
+#import &quot;PlatformUtilities.h&quot;
+#import &quot;PlatformWebView.h&quot;
+#import &lt;WebKit/WKRetainPtr.h&gt;
+#import &lt;WebKit/WKPage.h&gt;
+#import &lt;WebKit/WKPreferencesPrivate.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+namespace TestWebKitAPI {
+    
+static bool didFinishLoad;
+
+static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void*)
+{
+    didFinishLoad = true;
+}
+
+TEST(WebKit2, FirstResponderScrollingPosition)
+{
+    WKRetainPtr&lt;WKContextRef&gt; context(AdoptWK, Util::createContextWithInjectedBundle());
+
+    // Turn off threaded scrolling; synchronously waiting for the main thread scroll position to
+    // update using WKPageForceRepaint would be better, but for some reason the test still fails occasionally.
+    WKRetainPtr&lt;WKPageGroupRef&gt; pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK(&quot;NoThreadedScrollingPageGroup&quot;).get()));
+    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
+    WKPreferencesSetThreadedScrollingEnabled(preferences, false);
+
+    RetainPtr&lt;NSWindow&gt; window = adoptNS([[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
+        styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
+    [window.get() makeKeyAndOrderFront:nil];
+    EXPECT_TRUE([window.get() isVisible]);
+
+    PlatformWebView webView(context.get(), pageGroup.get());
+
+    WKPageLoaderClientV0 loaderClient;
+    memset(&amp;loaderClient, 0, sizeof(loaderClient));
+    loaderClient.base.version = 0;
+    loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+    WKPageSetPageLoaderClient(webView.page(), &amp;loaderClient.base);
+    
+    [window.get().contentView addSubview:webView.platformView()];
+    [window.get() makeFirstResponder:webView.platformView()];
+
+    WKRetainPtr&lt;WKURLRef&gt; url(AdoptWK, Util::createURLForResource(&quot;simple-tall&quot;, &quot;html&quot;));
+    WKPageLoadURL(webView.page(), url.get());
+    Util::run(&amp;didFinishLoad);
+    didFinishLoad = false;
+
+    EXPECT_JS_EQ(webView.page(), &quot;var input = document.createElement('input');&quot;
+        &quot;document.body.insertBefore(input, document.body.firstChild);&quot;
+        &quot;input.focus(); false&quot;, &quot;false&quot;);
+    EXPECT_JS_EQ(webView.page(), &quot;window.scrollY&quot;, &quot;0&quot;);
+
+    ASSERT_TRUE([webView.platformView() respondsToSelector:@selector(scrollLineDown:)]);
+    [webView.platformView() scrollLineDown:nil];
+
+    EXPECT_JS_EQ(webView.page(), &quot;window.scrollY&quot;, &quot;40&quot;);
+
+    PlatformWebView newWebView(context.get(), pageGroup.get());
+    WKPageSetPageLoaderClient(newWebView.page(), &amp;loaderClient.base);
+
+    [window.get().contentView addSubview:newWebView.platformView()];
+    [window.get() makeFirstResponder:newWebView.platformView()];
+
+    WKPageLoadURL(newWebView.page(), url.get());
+    Util::run(&amp;didFinishLoad);
+
+    EXPECT_JS_EQ(webView.page(), &quot;window.scrollY&quot;, &quot;40&quot;);
+    EXPECT_JS_EQ(newWebView.page(), &quot;window.scrollY&quot;, &quot;0&quot;);
+
+    [window.get() makeFirstResponder:webView.platformView()];
+
+    EXPECT_JS_EQ(webView.page(), &quot;window.scrollY&quot;, &quot;40&quot;);
+    EXPECT_JS_EQ(newWebView.page(), &quot;window.scrollY&quot;, &quot;0&quot;);
+}
+    
+} // namespace TestWebKitAPI
</ins></span></pre>
</div>
</div>

</body>
</html>