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

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
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index eaf3613f436be187734886d573ff0d0319511098..0649a0a01d74d70de4afb4d8980a5aab5451aed2 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -212,6 +212,7 @@ void Internals::resetToConsistentState(Page* page)
{
ASSERT(page);
+ page->setDeviceScaleFactor(1);
page->setPageScaleFactor(1, IntPoint(0, 0));
page->setPagination(Pagination());
TextRun::setAllowsRoundingHacks(false);
@@ -1765,6 +1766,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();

Powered by Google App Engine
This is Rietveld 408576698