diff --git a/docshell/base/nsIContentViewer.idl b/docshell/base/nsIContentViewer.idl index d7d58ad69cc1..8541454f3039 100644 --- a/docshell/base/nsIContentViewer.idl +++ b/docshell/base/nsIContentViewer.idl @@ -200,6 +200,9 @@ interface nsIContentViewer : nsISupports /** The amount by which to scale all text. Default is 1.0. */ attribute float textZoom; + /** The actual text zoom in effect, as modified by the system font scale. */ + readonly attribute float effectiveTextZoom; + /** The amount by which to scale all lengths. Default is 1.0. */ attribute float fullZoom; diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 2abdeaa14a35..dd72d3b6e406 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -3016,6 +3016,15 @@ nsDocumentViewer::GetTextZoom(float* aTextZoom) return NS_OK; } +NS_IMETHODIMP +nsDocumentViewer::GetEffectiveTextZoom(float* aEffectiveTextZoom) +{ + NS_ENSURE_ARG_POINTER(aEffectiveTextZoom); + nsPresContext* pc = GetPresContext(); + *aEffectiveTextZoom = pc ? pc->EffectiveTextZoom() : 1.0f; + return NS_OK; +} + NS_IMETHODIMP nsDocumentViewer::SetMinFontSize(int32_t aMinFontSize) { diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml index 3043e88022a7..4f0388ace5a9 100644 --- a/toolkit/content/widgets/browser.xml +++ b/toolkit/content/widgets/browser.xml @@ -552,6 +552,13 @@ ]]> + + + +