<!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>[183655] trunk/Source</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/183655">183655</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-04-30 16:44:49 -0700 (Thu, 30 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fixed elements end up in the middle of the view with pageScale &lt; 1
https://bugs.webkit.org/show_bug.cgi?id=144428
rdar://problem/20404982

Reviewed by Tim Horton.

Source/WebCore:

When pageScale is &lt; 1, we used fixed layout mode, and FrameView::fixedElementsLayoutRelativeToFrame()
returns true. However, the scrolling thread was calling the static scrollOffsetForFixedPosition()
hardcoding 'false' for this parameter.

Fix by sending the value of fixedElementsLayoutRelativeToFrame over to the scrolling thread,
so we can use it when doing scrolling-thread fixed position stuff.

Not testable.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setFixedElementsLayoutRelativeToFrame):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
(WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
(WebCore::ScrollingTreeFrameScrollingNode::fixedElementsLayoutRelativeToFrame):
(WebCore::ScrollingTreeFrameScrollingNode::shouldUpdateScrollLayerPositionSynchronously): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):

Source/WebKit2:

Encode/decode fixedElementsLayoutRelativeToFrame.

* Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder&lt;ScrollingStateFrameScrollingNode&gt;::encode):
(ArgumentCoder&lt;ScrollingStateFrameScrollingNode&gt;::decode):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp">trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeFrameScrollingNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeFrameScrollingNodeh">trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingiosScrollingTreeFrameScrollingNodeIOSmm">trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMacmm">trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacWebLayermm">trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedScrollingRemoteScrollingCoordinatorTransactioncpp">trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183654 => 183655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-30 23:35:26 UTC (rev 183654)
+++ trunk/Source/WebCore/ChangeLog        2015-04-30 23:44:49 UTC (rev 183655)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2015-04-30  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Fixed elements end up in the middle of the view with pageScale &lt; 1
+        https://bugs.webkit.org/show_bug.cgi?id=144428
+        rdar://problem/20404982
+
+        Reviewed by Tim Horton.
+
+        When pageScale is &lt; 1, we used fixed layout mode, and FrameView::fixedElementsLayoutRelativeToFrame()
+        returns true. However, the scrolling thread was calling the static scrollOffsetForFixedPosition()
+        hardcoding 'false' for this parameter.
+        
+        Fix by sending the value of fixedElementsLayoutRelativeToFrame over to the scrolling thread,
+        so we can use it when doing scrolling-thread fixed position stuff.
+
+        Not testable.
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
+        * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+        (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
+        (WebCore::ScrollingStateFrameScrollingNode::setFixedElementsLayoutRelativeToFrame):
+        * page/scrolling/ScrollingStateFrameScrollingNode.h:
+        * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
+        (WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
+        (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
+        * page/scrolling/ScrollingTreeFrameScrollingNode.h:
+        (WebCore::ScrollingTreeFrameScrollingNode::fixedElementsLayoutRelativeToFrame):
+        (WebCore::ScrollingTreeFrameScrollingNode::shouldUpdateScrollLayerPositionSynchronously): Deleted.
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
+
</ins><span class="cx"> 2015-04-30  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove invalid assertion from MouseEvent::create()
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (183654 => 183655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2015-04-30 23:35:26 UTC (rev 183654)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2015-04-30 23:44:49 UTC (rev 183655)
</span><span class="lines">@@ -136,6 +136,7 @@
</span><span class="cx">     node-&gt;setScrollableAreaSize(frameView.visibleContentRect().size());
</span><span class="cx">     node-&gt;setTotalContentsSize(frameView.totalContentsSize());
</span><span class="cx">     node-&gt;setReachableContentsSize(frameView.totalContentsSize());
</span><ins>+    node-&gt;setFixedElementsLayoutRelativeToFrame(frameView.fixedElementsLayoutRelativeToFrame());
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx">     frameView.updateSnapOffsets();
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp (183654 => 183655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp        2015-04-30 23:35:26 UTC (rev 183654)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp        2015-04-30 23:44:49 UTC (rev 183655)
</span><span class="lines">@@ -40,17 +40,6 @@
</span><span class="cx"> 
</span><span class="cx"> ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(ScrollingStateTree&amp; stateTree, ScrollingNodeID nodeID)
</span><span class="cx">     : ScrollingStateScrollingNode(stateTree, FrameScrollingNode, nodeID)
</span><del>-#if PLATFORM(MAC)
-    , m_verticalScrollbarPainter(0)
-    , m_horizontalScrollbarPainter(0)
-#endif
-    , m_frameScaleFactor(1)
-    , m_synchronousScrollingReasons(0)
-    , m_behaviorForFixed(StickToDocumentBounds)
-    , m_headerHeight(0)
-    , m_footerHeight(0)
-    , m_requestedScrollPositionRepresentsProgrammaticScroll(false)
-    , m_topContentInset(0)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -61,14 +50,15 @@
</span><span class="cx">     , m_horizontalScrollbarPainter(stateNode.horizontalScrollbarPainter())
</span><span class="cx"> #endif
</span><span class="cx">     , m_nonFastScrollableRegion(stateNode.nonFastScrollableRegion())
</span><ins>+    , m_requestedScrollPosition(stateNode.requestedScrollPosition())
</ins><span class="cx">     , m_frameScaleFactor(stateNode.frameScaleFactor())
</span><del>-    , m_synchronousScrollingReasons(stateNode.synchronousScrollingReasons())
-    , m_behaviorForFixed(stateNode.scrollBehaviorForFixedElements())
</del><ins>+    , m_topContentInset(stateNode.topContentInset())
</ins><span class="cx">     , m_headerHeight(stateNode.headerHeight())
</span><span class="cx">     , m_footerHeight(stateNode.footerHeight())
</span><del>-    , m_requestedScrollPosition(stateNode.requestedScrollPosition())
</del><ins>+    , m_synchronousScrollingReasons(stateNode.synchronousScrollingReasons())
+    , m_behaviorForFixed(stateNode.scrollBehaviorForFixedElements())
</ins><span class="cx">     , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
</span><del>-    , m_topContentInset(stateNode.topContentInset())
</del><ins>+    , m_fixedElementsLayoutRelativeToFrame(stateNode.fixedElementsLayoutRelativeToFrame())
</ins><span class="cx"> {
</span><span class="cx">     if (hasChangedProperty(ScrolledContentsLayer))
</span><span class="cx">         setScrolledContentsLayer(stateNode.scrolledContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
</span><span class="lines">@@ -216,6 +206,15 @@
</span><span class="cx">     setPropertyChanged(FooterLayer);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ScrollingStateFrameScrollingNode::setFixedElementsLayoutRelativeToFrame(bool fixedElementsLayoutRelativeToFrame)
+{
+    if (fixedElementsLayoutRelativeToFrame == m_fixedElementsLayoutRelativeToFrame)
+        return;
+    
+    m_fixedElementsLayoutRelativeToFrame = fixedElementsLayoutRelativeToFrame;
+    setPropertyChanged(FixedElementsLayoutRelativeToFrame);
+}
+
</ins><span class="cx"> #if !PLATFORM(MAC)
</span><span class="cx"> void ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars(Scrollbar*, Scrollbar*)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h (183654 => 183655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h        2015-04-30 23:35:26 UTC (rev 183654)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h        2015-04-30 23:44:49 UTC (rev 183655)
</span><span class="lines">@@ -60,7 +60,8 @@
</span><span class="cx">         FooterLayer,
</span><span class="cx">         PainterForScrollbar,
</span><span class="cx">         BehaviorForFixedElements,
</span><del>-        TopContentInset
</del><ins>+        TopContentInset,
+        FixedElementsLayoutRelativeToFrame,
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     float frameScaleFactor() const { return m_frameScaleFactor; }
</span><span class="lines">@@ -109,6 +110,9 @@
</span><span class="cx">     const LayerRepresentation&amp; footerLayer() const { return m_footerLayer; }
</span><span class="cx">     WEBCORE_EXPORT void setFooterLayer(const LayerRepresentation&amp;);
</span><span class="cx"> 
</span><ins>+    bool fixedElementsLayoutRelativeToFrame() const { return m_fixedElementsLayoutRelativeToFrame; }
+    WEBCORE_EXPORT void setFixedElementsLayoutRelativeToFrame(bool);
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     ScrollbarPainter verticalScrollbarPainter() const { return m_verticalScrollbarPainter.get(); }
</span><span class="cx">     ScrollbarPainter horizontalScrollbarPainter() const { return m_horizontalScrollbarPainter.get(); }
</span><span class="lines">@@ -134,14 +138,15 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     Region m_nonFastScrollableRegion;
</span><del>-    float m_frameScaleFactor;
-    SynchronousScrollingReasons m_synchronousScrollingReasons;
-    ScrollBehaviorForFixedElements m_behaviorForFixed;
-    int m_headerHeight;
-    int m_footerHeight;
</del><span class="cx">     FloatPoint m_requestedScrollPosition;
</span><del>-    bool m_requestedScrollPositionRepresentsProgrammaticScroll;
-    float m_topContentInset;
</del><ins>+    float m_frameScaleFactor { 1 };
+    float m_topContentInset { 0 };
+    int m_headerHeight { 0 };
+    int m_footerHeight { 0 };
+    SynchronousScrollingReasons m_synchronousScrollingReasons { 0 };
+    ScrollBehaviorForFixedElements m_behaviorForFixed { StickToDocumentBounds };
+    bool m_requestedScrollPositionRepresentsProgrammaticScroll { false };
+    bool m_fixedElementsLayoutRelativeToFrame { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeFrameScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp (183654 => 183655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp        2015-04-30 23:35:26 UTC (rev 183654)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp        2015-04-30 23:44:49 UTC (rev 183655)
</span><span class="lines">@@ -35,12 +35,6 @@
</span><span class="cx"> 
</span><span class="cx"> ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode(ScrollingTree&amp; scrollingTree, ScrollingNodeID nodeID)
</span><span class="cx">     : ScrollingTreeScrollingNode(scrollingTree, FrameScrollingNode, nodeID)
</span><del>-    , m_frameScaleFactor(1)
-    , m_headerHeight(0)
-    , m_footerHeight(0)
-    , m_topContentInset(0)
-    , m_synchronousScrollingReasons(0)
-    , m_behaviorForFixed(StickToDocumentBounds)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -71,6 +65,9 @@
</span><span class="cx"> 
</span><span class="cx">     if (state.hasChangedProperty(ScrollingStateFrameScrollingNode::TopContentInset))
</span><span class="cx">         m_topContentInset = state.topContentInset();
</span><ins>+
+    if (state.hasChangedProperty(ScrollingStateFrameScrollingNode::FixedElementsLayoutRelativeToFrame))
+        m_fixedElementsLayoutRelativeToFrame = state.fixedElementsLayoutRelativeToFrame();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingTreeFrameScrollingNode::scrollBy(const FloatSize&amp; offset)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeFrameScrollingNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h (183654 => 183655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h        2015-04-30 23:35:26 UTC (rev 183654)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h        2015-04-30 23:44:49 UTC (rev 183655)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> 
</span><span class="cx">     SynchronousScrollingReasons synchronousScrollingReasons() const { return m_synchronousScrollingReasons; }
</span><span class="cx">     bool shouldUpdateScrollLayerPositionSynchronously() const { return m_synchronousScrollingReasons; }
</span><ins>+    bool fixedElementsLayoutRelativeToFrame() const { return m_fixedElementsLayoutRelativeToFrame; }
</ins><span class="cx"> 
</span><span class="cx">     FloatSize viewToContentsOffset(const FloatPoint&amp; scrollOffset) const;
</span><span class="cx"> 
</span><span class="lines">@@ -71,14 +72,16 @@
</span><span class="cx">     ScrollBehaviorForFixedElements scrollBehaviorForFixedElements() const { return m_behaviorForFixed; }
</span><span class="cx">     
</span><span class="cx"> private:
</span><del>-    float m_frameScaleFactor;
</del><ins>+    float m_frameScaleFactor { 1 };
+    float m_topContentInset { 0 };
</ins><span class="cx"> 
</span><del>-    int m_headerHeight;
-    int m_footerHeight;
-    float m_topContentInset;
</del><ins>+    int m_headerHeight { 0 };
+    int m_footerHeight { 0 };
</ins><span class="cx">     
</span><del>-    SynchronousScrollingReasons m_synchronousScrollingReasons;
-    ScrollBehaviorForFixedElements m_behaviorForFixed;
</del><ins>+    SynchronousScrollingReasons m_synchronousScrollingReasons { 0 };
+    ScrollBehaviorForFixedElements m_behaviorForFixed { StickToDocumentBounds };
+    
+    bool m_fixedElementsLayoutRelativeToFrame { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingiosScrollingTreeFrameScrollingNodeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm (183654 => 183655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm        2015-04-30 23:35:26 UTC (rev 183654)
+++ trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm        2015-04-30 23:44:49 UTC (rev 183655)
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">     ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();
</span><span class="cx">     FloatPoint scrollOffset = scrollPosition - toIntSize(scrollOrigin());
</span><span class="cx">     FloatRect viewportRect(FloatPoint(), scrollableAreaSize());
</span><del>-    FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), LayoutSize(totalContentsSize()), LayoutPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
</del><ins>+    FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), LayoutSize(totalContentsSize()), LayoutPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), fixedElementsLayoutRelativeToFrame(), behaviorForFixed, headerHeight(), footerHeight());
</ins><span class="cx"> 
</span><span class="cx">     [m_counterScrollingLayer setPosition:FloatPoint(scrollOffsetForFixedChildren)];
</span><span class="cx"> 
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">         // then we should recompute scrollOffsetForFixedChildren for the banner with a scale factor of 1.
</span><span class="cx">         float horizontalScrollOffsetForBanner = scrollOffsetForFixedChildren.width();
</span><span class="cx">         if (frameScaleFactor() != 1)
</span><del>-            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), LayoutSize(totalContentsSize()), LayoutPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
</del><ins>+            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), LayoutSize(totalContentsSize()), LayoutPoint(scrollOffset), scrollOrigin(), 1, fixedElementsLayoutRelativeToFrame(), behaviorForFixed, headerHeight(), footerHeight()).width();
</ins><span class="cx"> 
</span><span class="cx">         if (m_headerLayer)
</span><span class="cx">             [m_headerLayer setPosition:FloatPoint(horizontalScrollOffsetForBanner, 0)];
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (183654 => 183655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm        2015-04-30 23:35:26 UTC (rev 183654)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm        2015-04-30 23:44:49 UTC (rev 183655)
</span><span class="lines">@@ -381,7 +381,7 @@
</span><span class="cx">     FloatRect viewportRect(FloatPoint(), scrollableAreaSize());
</span><span class="cx">     
</span><span class="cx">     FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), LayoutSize(totalContentsSize()), scrollOffset, scrollOrigin(), frameScaleFactor(),
</span><del>-        false, behaviorForFixed, headerHeight(), footerHeight());
</del><ins>+        fixedElementsLayoutRelativeToFrame(), behaviorForFixed, headerHeight(), footerHeight());
</ins><span class="cx">     
</span><span class="cx">     if (m_counterScrollingLayer)
</span><span class="cx">         m_counterScrollingLayer.get().position = FloatPoint(scrollOffsetForFixedChildren);
</span><span class="lines">@@ -401,7 +401,7 @@
</span><span class="cx">         // then we should recompute scrollOffsetForFixedChildren for the banner with a scale factor of 1.
</span><span class="cx">         float horizontalScrollOffsetForBanner = scrollOffsetForFixedChildren.width();
</span><span class="cx">         if (frameScaleFactor() != 1)
</span><del>-            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), LayoutSize(totalContentsSize()), scrollOffset, scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
</del><ins>+            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), LayoutSize(totalContentsSize()), scrollOffset, scrollOrigin(), 1, fixedElementsLayoutRelativeToFrame(), behaviorForFixed, headerHeight(), footerHeight()).width();
</ins><span class="cx"> 
</span><span class="cx">         if (m_headerLayer)
</span><span class="cx">             m_headerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner, FrameView::yPositionForHeaderLayer(position, topContentInset));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacWebLayermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm (183654 => 183655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm        2015-04-30 23:35:26 UTC (rev 183654)
+++ trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm        2015-04-30 23:44:49 UTC (rev 183655)
</span><span class="lines">@@ -134,8 +134,6 @@
</span><span class="cx"> 
</span><span class="cx"> @end // implementation WebSimpleLayer
</span><span class="cx"> 
</span><del>-// MARK: -
-
</del><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> 
</span><span class="cx"> @implementation CALayer(ExtendedDescription)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (183654 => 183655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-04-30 23:35:26 UTC (rev 183654)
+++ trunk/Source/WebKit2/ChangeLog        2015-04-30 23:44:49 UTC (rev 183655)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-04-30  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Fixed elements end up in the middle of the view with pageScale &lt; 1
+        https://bugs.webkit.org/show_bug.cgi?id=144428
+        rdar://problem/20404982
+
+        Reviewed by Tim Horton.
+
+        Encode/decode fixedElementsLayoutRelativeToFrame.
+
+        * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
+        (ArgumentCoder&lt;ScrollingStateFrameScrollingNode&gt;::encode):
+        (ArgumentCoder&lt;ScrollingStateFrameScrollingNode&gt;::decode):
+
</ins><span class="cx"> 2015-04-30  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Asynchronous (or timed-out synchronous) resize flashes white instead of page background color
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedScrollingRemoteScrollingCoordinatorTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp (183654 => 183655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp        2015-04-30 23:35:26 UTC (rev 183654)
+++ trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp        2015-04-30 23:44:49 UTC (rev 183655)
</span><span class="lines">@@ -148,6 +148,7 @@
</span><span class="cx">     SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::HeaderHeight, headerHeight)
</span><span class="cx">     SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::FooterHeight, footerHeight)
</span><span class="cx">     SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::TopContentInset, topContentInset)
</span><ins>+    SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::FixedElementsLayoutRelativeToFrame, fixedElementsLayoutRelativeToFrame)
</ins><span class="cx"> 
</span><span class="cx">     if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))
</span><span class="cx">         encoder &lt;&lt; static_cast&lt;GraphicsLayer::PlatformLayerID&gt;(node.scrolledContentsLayer());
</span><span class="lines">@@ -230,6 +231,7 @@
</span><span class="cx">     SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::HeaderHeight, int, setHeaderHeight);
</span><span class="cx">     SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::FooterHeight, int, setFooterHeight);
</span><span class="cx">     SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::TopContentInset, float, setTopContentInset);
</span><ins>+    SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::FixedElementsLayoutRelativeToFrame, bool, setFixedElementsLayoutRelativeToFrame);
</ins><span class="cx"> 
</span><span class="cx">     if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer)) {
</span><span class="cx">         GraphicsLayer::PlatformLayerID layerID;
</span></span></pre>
</div>
</div>

</body>
</html>