Bug 1328868 - Part 3 - Make the effective text zoom retrievable from JS. r=tnikkel

We want to read this value during testing.

MozReview-Commit-ID: FVA7VdvSTEt

--HG--
extra : rebase_source : 7ae56480ad34a4b3b417b3593496619a55910ec6
This commit is contained in:
Jan Henning 2017-02-25 19:27:15 +01:00
parent 8a6b5c9c8a
commit c49f232ab2
3 changed files with 19 additions and 0 deletions

View File

@ -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;

View File

@ -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)
{

View File

@ -552,6 +552,13 @@
]]></setter>
</property>
<property name="effectiveTextZoom"
readonly="true">
<getter><![CDATA[
return this.markupDocumentViewer.effectiveTextZoom;
]]></getter>
</property>
<property name="isSyntheticDocument">
<getter><![CDATA[
return this.contentDocument.mozSyntheticDocument;