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

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

Issue 23192002: Let page zoom affect resolution and -webkit-device-pixel-ratio MQs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review issue: renamed variable 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
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.cpp ('k') | Source/core/page/Frame.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 FloatPoint nodePoint(p->x(), p->y()); 1247 FloatPoint nodePoint(p->x(), p->y());
1248 nodePoint = node->convertFromPage(nodePoint); 1248 nodePoint = node->convertFromPage(nodePoint);
1249 return DOMPoint::create(nodePoint.x(), nodePoint.y()); 1249 return DOMPoint::create(nodePoint.x(), nodePoint.y());
1250 } 1250 }
1251 1251
1252 double DOMWindow::devicePixelRatio() const 1252 double DOMWindow::devicePixelRatio() const
1253 { 1253 {
1254 if (!m_frame) 1254 if (!m_frame)
1255 return 0.0; 1255 return 0.0;
1256 1256
1257 Page* page = m_frame->page(); 1257 return m_frame->devicePixelRatio();
1258 if (!page)
1259 return 0.0;
1260
1261 if (RuntimeEnabledFeatures::devicePixelRatioIncludesZoomEnabled())
1262 return page->deviceScaleFactor() * m_frame->pageZoomFactor();
1263
1264 return page->deviceScaleFactor();
1265 } 1258 }
1266 1259
1267 void DOMWindow::scrollBy(int x, int y) const 1260 void DOMWindow::scrollBy(int x, int y) const
1268 { 1261 {
1269 if (!isCurrentlyDisplayedInFrame()) 1262 if (!isCurrentlyDisplayedInFrame())
1270 return; 1263 return;
1271 1264
1272 document()->updateLayoutIgnorePendingStylesheets(); 1265 document()->updateLayoutIgnorePendingStylesheets();
1273 1266
1274 FrameView* view = m_frame->view(); 1267 FrameView* view = m_frame->view();
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 return static_cast<DOMWindowLifecycleNotifier*>(LifecycleContext::lifecycleN otifier()); 1743 return static_cast<DOMWindowLifecycleNotifier*>(LifecycleContext::lifecycleN otifier());
1751 } 1744 }
1752 1745
1753 PassOwnPtr<LifecycleNotifier> DOMWindow::createLifecycleNotifier() 1746 PassOwnPtr<LifecycleNotifier> DOMWindow::createLifecycleNotifier()
1754 { 1747 {
1755 return DOMWindowLifecycleNotifier::create(this); 1748 return DOMWindowLifecycleNotifier::create(this);
1756 } 1749 }
1757 1750
1758 1751
1759 } // namespace WebCore 1752 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.cpp ('k') | Source/core/page/Frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698