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

Unified Diff: Source/core/rendering/TextAutosizer.cpp

Issue 146683003: Settings should not call into inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 years, 11 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/rendering/FastTextAutosizer.cpp ('k') | Source/core/testing/InternalSettings.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/TextAutosizer.cpp
diff --git a/Source/core/rendering/TextAutosizer.cpp b/Source/core/rendering/TextAutosizer.cpp
index 7c5a1ffc3d622a34c700293932e5c7242939a520..8fc39eea1448081f91e9575ac72ec47200ed577a 100644
--- a/Source/core/rendering/TextAutosizer.cpp
+++ b/Source/core/rendering/TextAutosizer.cpp
@@ -25,8 +25,8 @@
#include "core/dom/Document.h"
#include "core/html/HTMLElement.h"
-#include "core/inspector/InspectorInstrumentation.h"
#include "core/frame/Settings.h"
+#include "core/inspector/InspectorInstrumentation.h"
#include "core/rendering/RenderListItem.h"
#include "core/rendering/RenderObject.h"
#include "core/rendering/RenderText.h"
@@ -182,7 +182,11 @@ bool TextAutosizer::processSubtree(RenderObject* layoutRoot)
{
TRACE_EVENT0("webkit", "TextAutosizer::processSubtree");
- if (!m_document->settings() || !m_document->settings()->textAutosizingEnabled() || layoutRoot->view()->document().printing() || !m_document->page())
+ if (!m_document->settings() || layoutRoot->view()->document().printing() || !m_document->page())
+ return false;
+
+ bool textAutosizingEnabled = InspectorInstrumentation::overrideTextAutosizing(m_document->page(), m_document->settings()->textAutosizingEnabled());
+ if (!textAutosizingEnabled)
return false;
Frame* mainFrame = m_document->page()->mainFrame();
@@ -244,7 +248,8 @@ float TextAutosizer::clusterMultiplier(WritingMode writingMode, const TextAutosi
// If the page has a meta viewport or @viewport, don't apply the device scale adjustment.
const ViewportDescription& viewportDescription = m_document->page()->mainFrame()->document()->viewportDescription();
if (!viewportDescription.isSpecifiedByAuthor()) {
- multiplier *= m_document->settings()->deviceScaleAdjustment();
+ float deviceScaleAdjustment = InspectorInstrumentation::overrideFontScaleFactor(m_document->page(), m_document->settings()->deviceScaleAdjustment());
+ multiplier *= deviceScaleAdjustment;
}
return std::max(1.0f, multiplier);
}
« no previous file with comments | « Source/core/rendering/FastTextAutosizer.cpp ('k') | Source/core/testing/InternalSettings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698