<!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>[212658] branches/safari-603-branch/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/212658">212658</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2017-02-20 10:30:27 -0800 (Mon, 20 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/212652">r212652</a>. rdar://problem/30435303</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari603branchSourceWebCoreChangeLog">branches/safari-603-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformgraphicscawinCACFLayerTreeHosth">branches/safari-603-branch/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformgraphicscawinWKCACFViewLayerTreeHostcpp">branches/safari-603-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformgraphicscawinWKCACFViewLayerTreeHosth">branches/safari-603-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformwinGDIUtilitiesh">branches/safari-603-branch/Source/WebCore/platform/win/GDIUtilities.h</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformwinPlatformMouseEventWincpp">branches/safari-603-branch/Source/WebCore/platform/win/PlatformMouseEventWin.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformwinPopupMenuWincpp">branches/safari-603-branch/Source/WebCore/platform/win/PopupMenuWin.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformwinPopupMenuWinh">branches/safari-603-branch/Source/WebCore/platform/win/PopupMenuWin.h</a></li>
<li><a href="#branchessafari603branchSourceWebKitwinChangeLog">branches/safari-603-branch/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebKitwinWebViewcpp">branches/safari-603-branch/Source/WebKit/win/WebView.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari603branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (212657 => 212658)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/ChangeLog        2017-02-20 18:22:56 UTC (rev 212657)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog        2017-02-20 18:30:27 UTC (rev 212658)
</span><span class="lines">@@ -1,5 +1,34 @@
</span><span class="cx"> 2017-02-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r212652. rdar://problem/30435303
+
+    2017-02-20  Per Arne Vollan  &lt;pvollan@apple.com&gt;
+
+            [Win] Custom scale factor is not applied in all cases.
+            https://bugs.webkit.org/show_bug.cgi?id=168117
+
+            Reviewed by Brent Fulgham.
+
+            We should not call the function deviceScaleFactorForWindow directly, since this
+            will return the system scale factor, and ignore the custom scale factor.
+
+            * platform/graphics/ca/win/CACFLayerTreeHost.h:
+            * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
+            (WebCore::WKCACFViewLayerTreeHost::initializeContext):
+            (WebCore::WKCACFViewLayerTreeHost::resize):
+            (WebCore::WKCACFViewLayerTreeHost::setScaleFactor):
+            * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
+            * platform/win/GDIUtilities.h:
+            (WebCore::makeScaledPoint):
+            * platform/win/PlatformMouseEventWin.cpp:
+            (WebCore::positionForEvent):
+            * platform/win/PopupMenuWin.cpp:
+            (WebCore::PopupMenuWin::show):
+            (WebCore::PopupMenuWin::wndProc):
+            * platform/win/PopupMenuWin.h:
+
+2017-02-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r212621. rdar://problem/30563318
</span><span class="cx"> 
</span><span class="cx">     2017-02-18  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformgraphicscawinCACFLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h (212657 => 212658)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h        2017-02-20 18:22:56 UTC (rev 212657)
+++ branches/safari-603-branch/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h        2017-02-20 18:30:27 UTC (rev 212658)
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx">     void setPage(Page*);
</span><span class="cx">     virtual void paint(HDC = nullptr);
</span><span class="cx">     virtual void resize() = 0;
</span><ins>+    virtual void setScaleFactor(float) = 0;
</ins><span class="cx">     void flushPendingGraphicsLayerChangesSoon();
</span><span class="cx">     virtual void setShouldInvertColors(bool);
</span><span class="cx"> #if USE(AVFOUNDATION)
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformgraphicscawinWKCACFViewLayerTreeHostcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp (212657 => 212658)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp        2017-02-20 18:22:56 UTC (rev 212657)
+++ branches/safari-603-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp        2017-02-20 18:30:27 UTC (rev 212658)
</span><span class="lines">@@ -124,12 +124,6 @@
</span><span class="cx"> 
</span><span class="cx"> void WKCACFViewLayerTreeHost::initializeContext(void* userData, PlatformCALayer* layer)
</span><span class="cx"> {
</span><del>-#if HAVE(CACFLAYER_SETCONTENTSSCALE)
-    float scaleFactor = deviceScaleFactorForWindow(nullptr);
-    CACFLayerSetTransform(layer-&gt;platformLayer(), CATransform3DMakeScale(scaleFactor, scaleFactor, 1));
-    CACFLayerSetContentsScale(layer-&gt;platformLayer(), scaleFactor);
-#endif
-
</del><span class="cx">     WKCACFViewSetContextUserData(m_view.get(), userData);
</span><span class="cx">     WKCACFViewSetLayer(m_view.get(), layer-&gt;platformLayer());
</span><span class="cx">     WKCACFViewSetContextDidChangeCallback(m_view.get(), contextDidChangeCallback, this);
</span><span class="lines">@@ -140,6 +134,14 @@
</span><span class="cx">     m_viewNeedsUpdate = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WKCACFViewLayerTreeHost::setScaleFactor(float scaleFactor)
+{
+#if HAVE(CACFLAYER_SETCONTENTSSCALE)
+    CACFLayerSetTransform(rootLayer()-&gt;platformLayer(), CATransform3DMakeScale(scaleFactor, scaleFactor, 1));
+    CACFLayerSetContentsScale(rootLayer()-&gt;platformLayer(), scaleFactor);
+#endif
+}
+
</ins><span class="cx"> bool WKCACFViewLayerTreeHost::createRenderer()
</span><span class="cx"> {
</span><span class="cx">     updateViewIfNeeded();
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformgraphicscawinWKCACFViewLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h (212657 => 212658)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h        2017-02-20 18:22:56 UTC (rev 212657)
+++ branches/safari-603-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h        2017-02-20 18:30:27 UTC (rev 212658)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void initializeContext(void* userData, PlatformCALayer*);
</span><span class="cx">     virtual void resize();
</span><ins>+    virtual void setScaleFactor(float);
</ins><span class="cx">     virtual void destroyRenderer();
</span><span class="cx">     virtual void flushContext();
</span><span class="cx">     virtual void contextDidChange();
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformwinGDIUtilitiesh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/win/GDIUtilities.h (212657 => 212658)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/win/GDIUtilities.h        2017-02-20 18:22:56 UTC (rev 212657)
+++ branches/safari-603-branch/Source/WebCore/platform/win/GDIUtilities.h        2017-02-20 18:30:27 UTC (rev 212658)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #ifndef GDIUtilties_h
</span><span class="cx"> #define GDIUtilties_h
</span><span class="cx"> 
</span><ins>+#include &lt;IntPoint.h&gt;
+
</ins><span class="cx"> #include &lt;windows.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -32,6 +34,13 @@
</span><span class="cx"> 
</span><span class="cx"> WEBCORE_EXPORT float deviceScaleFactorForWindow(HWND);
</span><span class="cx"> 
</span><ins>+inline LPARAM makeScaledPoint(IntPoint point, float scaleFactor)
+{
+    float inverseScaleFactor = 1.0f / scaleFactor;
+    point.scale(inverseScaleFactor, inverseScaleFactor);
+    return MAKELPARAM(point.x(), point.y());
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // GDIUtilties_h
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformwinPlatformMouseEventWincpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/win/PlatformMouseEventWin.cpp (212657 => 212658)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/win/PlatformMouseEventWin.cpp        2017-02-20 18:22:56 UTC (rev 212657)
+++ branches/safari-603-branch/Source/WebCore/platform/win/PlatformMouseEventWin.cpp        2017-02-20 18:30:27 UTC (rev 212658)
</span><span class="lines">@@ -42,8 +42,6 @@
</span><span class="cx"> static IntPoint positionForEvent(HWND hWnd, LPARAM lParam)
</span><span class="cx"> {
</span><span class="cx">     IntPoint point(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
</span><del>-    float inverseScaleFactor = 1.0f / deviceScaleFactorForWindow(hWnd);
-    point.scale(inverseScaleFactor, inverseScaleFactor);
</del><span class="cx">     return point;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformwinPopupMenuWincpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/win/PopupMenuWin.cpp (212657 => 212658)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/win/PopupMenuWin.cpp        2017-02-20 18:22:56 UTC (rev 212657)
+++ branches/safari-603-branch/Source/WebCore/platform/win/PopupMenuWin.cpp        2017-02-20 18:30:27 UTC (rev 212658)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;FontSelector.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameView.h&quot;
</span><ins>+#include &quot;GDIUtilities.h&quot;
</ins><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;HWndDC.h&quot;
</span><span class="lines">@@ -131,6 +132,9 @@
</span><span class="cx">     if (clientRect().isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    if (view &amp;&amp; view-&gt;frame().page())
+        m_scaleFactor = view-&gt;frame().page()-&gt;deviceScaleFactor();
+
</ins><span class="cx">     HWND hostWindow = view-&gt;hostWindow()-&gt;platformPageClient();
</span><span class="cx"> 
</span><span class="cx">     if (!m_scrollbar &amp;&amp; visibleItems() &lt; client()-&gt;listSize()) {
</span><span class="lines">@@ -958,7 +962,7 @@
</span><span class="cx">                 if (scrollbarCapturingMouse() || scrollBarRect.contains(mousePoint)) {
</span><span class="cx">                     // Put the point into coordinates relative to the scroll bar
</span><span class="cx">                     mousePoint.move(-scrollBarRect.x(), -scrollBarRect.y());
</span><del>-                    PlatformMouseEvent event(hWnd, message, wParam, MAKELPARAM(mousePoint.x(), mousePoint.y()));
</del><ins>+                    PlatformMouseEvent event(hWnd, message, wParam, makeScaledPoint(mousePoint, m_scaleFactor));
</ins><span class="cx">                     scrollbar()-&gt;mouseMoved(event);
</span><span class="cx">                     break;
</span><span class="cx">                 }
</span><span class="lines">@@ -995,7 +999,7 @@
</span><span class="cx">                 if (scrollBarRect.contains(mousePoint)) {
</span><span class="cx">                     // Put the point into coordinates relative to the scroll bar
</span><span class="cx">                     mousePoint.move(-scrollBarRect.x(), -scrollBarRect.y());
</span><del>-                    PlatformMouseEvent event(hWnd, message, wParam, MAKELPARAM(mousePoint.x(), mousePoint.y()));
</del><ins>+                    PlatformMouseEvent event(hWnd, message, wParam, makeScaledPoint(mousePoint, m_scaleFactor));
</ins><span class="cx">                     scrollbar()-&gt;mouseDown(event);
</span><span class="cx">                     setScrollbarCapturingMouse(true);
</span><span class="cx">                     break;
</span><span class="lines">@@ -1022,7 +1026,7 @@
</span><span class="cx">                     setScrollbarCapturingMouse(false);
</span><span class="cx">                     // Put the point into coordinates relative to the scroll bar
</span><span class="cx">                     mousePoint.move(-scrollBarRect.x(), -scrollBarRect.y());
</span><del>-                    PlatformMouseEvent event(hWnd, message, wParam, MAKELPARAM(mousePoint.x(), mousePoint.y()));
</del><ins>+                    PlatformMouseEvent event(hWnd, message, wParam, makeScaledPoint(mousePoint, m_scaleFactor));
</ins><span class="cx">                     scrollbar()-&gt;mouseUp(event);
</span><span class="cx">                     // FIXME: This is a hack to work around Scrollbar not invalidating correctly when it doesn't have a parent widget
</span><span class="cx">                     RECT r = scrollBarRect;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformwinPopupMenuWinh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/win/PopupMenuWin.h (212657 => 212658)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/win/PopupMenuWin.h        2017-02-20 18:22:56 UTC (rev 212657)
+++ branches/safari-603-branch/Source/WebCore/platform/win/PopupMenuWin.h        2017-02-20 18:30:27 UTC (rev 212658)
</span><span class="lines">@@ -134,6 +134,7 @@
</span><span class="cx">     bool m_wasClicked { false };
</span><span class="cx">     bool m_scrollbarCapturingMouse { false };
</span><span class="cx">     bool m_showPopup { false };
</span><ins>+    float m_scaleFactor { 1 };
</ins><span class="cx"> 
</span><span class="cx">     friend class AccessiblePopupMenu;
</span><span class="cx"> };
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/win/ChangeLog (212657 => 212658)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/win/ChangeLog        2017-02-20 18:22:56 UTC (rev 212657)
+++ branches/safari-603-branch/Source/WebKit/win/ChangeLog        2017-02-20 18:30:27 UTC (rev 212658)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2017-02-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
+        Merge r212652. rdar://problem/30435303
+
+    2017-02-20  Per Arne Vollan  &lt;pvollan@apple.com&gt;
+
+            [Win] Custom scale factor is not applied in all cases.
+            https://bugs.webkit.org/show_bug.cgi?id=168117
+
+            Reviewed by Brent Fulgham.
+
+            We should not call the function deviceScaleFactorForWindow directly, since this
+            will return the system scale factor, and ignore the custom scale factor.
+
+            * WebView.cpp:
+            (WebView::handleContextMenuEvent):
+            (WebView::handleMouseEvent):
+            (WebView::setAcceleratedCompositing):
+
</ins><span class="cx"> 2017-02-17  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rollout r212500. rdar://problem/29904368
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/win/WebView.cpp (212657 => 212658)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/win/WebView.cpp        2017-02-20 18:22:56 UTC (rev 212657)
+++ branches/safari-603-branch/Source/WebKit/win/WebView.cpp        2017-02-20 18:30:27 UTC (rev 212658)
</span><span class="lines">@@ -1658,7 +1658,7 @@
</span><span class="cx">     Frame* targetFrame = result.innerNonSharedNode() ? result.innerNonSharedNode()-&gt;document().frame() : &amp;m_page-&gt;focusController().focusedOrMainFrame();
</span><span class="cx"> 
</span><span class="cx">     targetFrame-&gt;view()-&gt;setCursor(pointerCursor());
</span><del>-    PlatformMouseEvent mouseEvent(m_viewWindow, WM_RBUTTONUP, wParam, lParam);
</del><ins>+    PlatformMouseEvent mouseEvent(m_viewWindow, WM_RBUTTONUP, wParam, makeScaledPoint(IntPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)), deviceScaleFactor()));
</ins><span class="cx">     bool handledEvent = targetFrame-&gt;eventHandler().sendContextMenuEvent(mouseEvent);
</span><span class="cx">     if (!handledEvent)
</span><span class="cx">         return false;
</span><span class="lines">@@ -1826,7 +1826,7 @@
</span><span class="cx">     // Create our event.
</span><span class="cx">     // On WM_MOUSELEAVE we need to create a mouseout event, so we force the position
</span><span class="cx">     // of the event to be at (MINSHORT, MINSHORT).
</span><del>-    LPARAM position = (message == WM_MOUSELEAVE) ? ((MINSHORT &lt;&lt; 16) | MINSHORT) : lParam;
</del><ins>+    LPARAM position = (message == WM_MOUSELEAVE) ? ((MINSHORT &lt;&lt; 16) | MINSHORT) : makeScaledPoint(IntPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)), deviceScaleFactor());
</ins><span class="cx">     PlatformMouseEvent mouseEvent(m_viewWindow, message, wParam, position, m_mouseActivated);
</span><span class="cx"> 
</span><span class="cx">     setMouseActivated(false);
</span><span class="lines">@@ -7152,6 +7152,7 @@
</span><span class="cx">             ASSERT(m_viewWindow);
</span><span class="cx">             m_layerTreeHost-&gt;setWindow(m_viewWindow);
</span><span class="cx">             m_layerTreeHost-&gt;setPage(page());
</span><ins>+            m_layerTreeHost-&gt;setScaleFactor(deviceScaleFactor());
</ins><span class="cx"> 
</span><span class="cx">             // FIXME: We could perhaps get better performance by never allowing this layer to
</span><span class="cx">             // become tiled (or choosing a higher-than-normal tiling threshold).
</span></span></pre>
</div>
</div>

</body>
</html>