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(); |