[tor-commits] [tor-browser/tor-browser-52.4.0esr-7.5-1] Revert "bug 23104 - Add a default line height compensation"
gk at torproject.org
gk at torproject.org
Thu Oct 5 12:10:34 UTC 2017
commit 5117adf6b06bd2901144d15847b4cc902a94741a
Author: Georg Koppen <gk at torproject.org>
Date: Thu Oct 5 12:08:28 2017 +0000
Revert "bug 23104 - Add a default line height compensation"
This reverts commit 722fd293451de0859106949d64dc2cb16c22a780.
Backing out due to #23701: We should make sure this defense only applies
to content and not the browser chrome.
---
layout/generic/ReflowInput.cpp | 6 -----
tbb-tests/mochitest.ini | 1 -
tbb-tests/test_tor_bug23104.html | 51 ----------------------------------------
3 files changed, 58 deletions(-)
diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp
index e219ae032cc6..42f4a24b5314 100644
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -30,7 +30,6 @@
#include "CounterStyleManager.h"
#include <algorithm>
#include "mozilla/dom/HTMLInputElement.h"
-#include "nsContentUtils.h"
#ifdef DEBUG
#undef NOISY_VERTICAL_ALIGN
@@ -2769,11 +2768,6 @@ GetNormalLineHeight(nsFontMetrics* aFontMetrics)
nscoord externalLeading = aFontMetrics->ExternalLeading();
nscoord internalLeading = aFontMetrics->InternalLeading();
nscoord emHeight = aFontMetrics->EmHeight();
-
- if (nsContentUtils::ShouldResistFingerprinting()) {
- return NSToCoordRound(emHeight * NORMAL_LINE_HEIGHT_FACTOR);
- }
-
switch (GetNormalLineHeightCalcControl()) {
case eIncludeExternalLeading:
normalLineHeight = emHeight+ internalLeading + externalLeading;
diff --git a/tbb-tests/mochitest.ini b/tbb-tests/mochitest.ini
index fca972a51211..3d2e7c9db803 100644
--- a/tbb-tests/mochitest.ini
+++ b/tbb-tests/mochitest.ini
@@ -10,4 +10,3 @@ support-files =
[test_tor_bug2875.html]
[test_tor_bug4755.html]
[test_tor_bug5856.html]
-[test_tor_bug23104.html]
diff --git a/tbb-tests/test_tor_bug23104.html b/tbb-tests/test_tor_bug23104.html
deleted file mode 100644
index 77d7d190d7c8..000000000000
--- a/tbb-tests/test_tor_bug23104.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE HTML>
-<meta charset="UTF-8">
-<html>
-<head>
- <title>Test for Tor Bug #23104: CSS line-height reveals the platform Tor browser is running</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <style type="text/css">
- span {
- background-color: #000;
- color: #fff;
- font-size: 16.5px;
- }
- </style>
-</head>
-<body>
-<span id="test1">Test1</span>
-<span id="test2">كلمة</span>
-<span id="test3">ação</span>
-<script type="application/javascript;version=1.7">
-
-let setPref = function* (key, value) {
- return new Promise(function(resolve, reject) {
- SpecialPowers.pushPrefEnv({"set": [[key, value]]}, resolve);
- });
-}
-
-function getStyle(el, styleprop) {
- el = document.getElementById(el);
- return document.defaultView.getComputedStyle(el, null).getPropertyValue(styleprop);
-}
-
-function validateElement(elementName, isFingerprintResistent) {
- var fontSize = getStyle(elementName, 'font-size');
- var lineHeight = getStyle(elementName, 'line-height');
- var validationCb = isFingerprintResistent ? is : isnot;
- validationCb(parseFloat(lineHeight), Math.ceil(parseFloat(fontSize)) * 1.2, 'Line Height validation');
-}
-
-add_task(function* () {
- for (let resistFingerprintingValue of [true, false]) {
- yield setPref("privacy.resistFingerprinting", resistFingerprintingValue);
- for (let elementId of ['test1', 'test2', 'test3']) {
- validateElement(elementId, resistFingerprintingValue);
- }
- }
-});
-
-</script>
-</body>
-</html>
More information about the tor-commits
mailing list