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

Unified Diff: Source/core/testing/Internals.cpp

Issue 14408004: Fix incorrect evaluation of resolution media queries (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index c319dc49665ba2123471b5712739d1446c2fc588..043474911598678637f0ea456329c72ea248c43b 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -211,6 +211,7 @@ void Internals::resetToConsistentState(Page* page)
{
ASSERT(page);
+ page->setDeviceScaleFactor(1);
page->setPageScaleFactor(1, IntPoint(0, 0));
page->setPagination(Pagination());
TextRun::setAllowsRoundingHacks(false);
@@ -1709,6 +1710,17 @@ String Internals::pageSizeAndMarginsInPixels(int pageNumber, int width, int heig
return PrintContext::pageSizeAndMarginsInPixels(frame(), pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft);
}
+void Internals::setDeviceScaleFactor(float scaleFactor, ExceptionCode& ec)
+{
+ Document* document = contextDocument();
+ if (!document || !document->page()) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+ Page* page = document->page();
+ page->setDeviceScaleFactor(scaleFactor);
+}
+
void Internals::setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode& ec)
{
Document* document = contextDocument();
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698