Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: Source/core/page/DOMWindow.cpp

Issue 23000005: Update window.devicePixelRatio on browser zoom (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 1238
1239 double DOMWindow::devicePixelRatio() const 1239 double DOMWindow::devicePixelRatio() const
1240 { 1240 {
1241 if (!m_frame) 1241 if (!m_frame)
1242 return 0.0; 1242 return 0.0;
1243 1243
1244 Page* page = m_frame->page(); 1244 Page* page = m_frame->page();
1245 if (!page) 1245 if (!page)
1246 return 0.0; 1246 return 0.0;
1247 1247
1248 if (RuntimeEnabledFeatures::devicePixelRatioIncludesZoomEnabled())
1249 return page->deviceScaleFactor() * m_frame->pageZoomFactor();
1250
1248 return page->deviceScaleFactor(); 1251 return page->deviceScaleFactor();
1249 } 1252 }
1250 1253
1251 void DOMWindow::scrollBy(int x, int y) const 1254 void DOMWindow::scrollBy(int x, int y) const
1252 { 1255 {
1253 if (!isCurrentlyDisplayedInFrame()) 1256 if (!isCurrentlyDisplayedInFrame())
1254 return; 1257 return;
1255 1258
1256 document()->updateLayoutIgnorePendingStylesheets(); 1259 document()->updateLayoutIgnorePendingStylesheets();
1257 1260
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1725 1728
1726 Frame* child = frame->tree()->scopedChild(index); 1729 Frame* child = frame->tree()->scopedChild(index);
1727 if (child) 1730 if (child)
1728 return child->domWindow(); 1731 return child->domWindow();
1729 1732
1730 return 0; 1733 return 0;
1731 } 1734 }
1732 1735
1733 1736
1734 } // namespace WebCore 1737 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/Window/device-pixel-ratio-on-zoom-expected.txt ('k') | Source/core/page/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698