commit 4ce99eee684fb3d8b92ee51861b4bdc82bfb6599 Author: Alex Catarineu acat@torproject.org Date: Fri Apr 3 21:34:55 2020 +0200
fixup! Bug 23104: Add a default line height compensation --- layout/generic/test/test_tor_bug23104.html | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/layout/generic/test/test_tor_bug23104.html b/layout/generic/test/test_tor_bug23104.html index ae73a3446037..8ff1d2190c45 100644 --- a/layout/generic/test/test_tor_bug23104.html +++ b/layout/generic/test/test_tor_bug23104.html @@ -17,12 +17,10 @@ <span id="test1">Test1</span> <span id="test2">كلمة</span> <span id="test3">ação</span> -<script type="application/javascript;version=1.7"> +<script>
-let setPref = function* (key, value) { - return new Promise(function(resolve, reject) { - SpecialPowers.pushPrefEnv({"set": [[key, value]]}, resolve); - }); +let setPref = async function (key, value) { + await SpecialPowers.pushPrefEnv({"set": [[key, value]]}); }
function getStyle(el, styleprop) { @@ -34,12 +32,13 @@ function validateElement(elementName, isFingerprintResistent) { var fontSize = getStyle(elementName, 'font-size'); var lineHeight = getStyle(elementName, 'line-height'); var validationCb = isFingerprintResistent ? is : isnot; - validationCb(parseFloat(lineHeight), parseFloat(fontSize) * 1.2, 'Line Height validation'); + validationCb(parseFloat(lineHeight), Math.round(parseFloat(fontSize)) * 1.2, 'Line Height validation'); }
-add_task(function* () { +add_task(async function() { + await setPref("layout.css.line-height.normal-as-resolved-value.enabled", false); for (let resistFingerprintingValue of [true, false]) { - yield setPref("privacy.resistFingerprinting", resistFingerprintingValue); + await setPref("privacy.resistFingerprinting", resistFingerprintingValue); for (let elementId of ['test1', 'test2', 'test3']) { validateElement(elementId, resistFingerprintingValue); }