[tor-commits] [torbrowser/master] Tweak + merge Shondoit's font fix patch.
mikeperry at torproject.org
mikeperry at torproject.org
Thu Jun 28 20:44:29 UTC 2012
commit 5765014053b2af4e76786a43ce3e0f8d5b6ff5d3
Author: Mike Perry <mikeperry-git at fscked.org>
Date: Wed Jun 13 15:15:26 2012 -0700
Tweak + merge Shondoit's font fix patch.
---
...ice-and-system-specific-CSS-Media-Queries.patch | 116 ++++++++++++++++++++
...e-client-values-only-to-CSS-Media-Queries.patch | 72 ------------
.../alpha/0010-Rebrand-Firefox-to-TorBrowser.patch | 2 +-
.../0011-Make-Download-manager-memory-only.patch | 2 +-
.../0012-Add-DDG-and-StartPage-to-Omnibox.patch | 2 +-
...-nsICacheService.EvictEntries-synchronous.patch | 2 +-
.../alpha/0014-Prevent-WebSocket-DNS-leak.patch | 2 +-
...owser-exit-when-not-launched-from-Vidalia.patch | 2 +-
...16-Limit-the-number-of-fonts-per-document.patch | 2 +-
...ize-HTTP-request-order-and-pipeline-depth.patch | 2 +-
...Adapt-Steven-Michaud-s-Mac-crashfix-patch.patch | 2 +-
.../alpha/0019-Fix-Firefox-13-build-process.patch | 2 +-
12 files changed, 126 insertions(+), 82 deletions(-)
diff --git a/src/current-patches/firefox/alpha/0009-Limit-device-and-system-specific-CSS-Media-Queries.patch b/src/current-patches/firefox/alpha/0009-Limit-device-and-system-specific-CSS-Media-Queries.patch
new file mode 100644
index 0000000..5772728
--- /dev/null
+++ b/src/current-patches/firefox/alpha/0009-Limit-device-and-system-specific-CSS-Media-Queries.patch
@@ -0,0 +1,116 @@
+From 6c09a21d1db29dc28b359294ededc047ba5b463e Mon Sep 17 00:00:00 2001
+From: Shondoit Walker <shondoit at gmail.com>
+Date: Mon, 4 Jun 2012 19:15:31 +0200
+Subject: [PATCH 09/19] Limit device- and system-specific CSS Media Queries
+
+This is done to address
+https://www.torproject.org/projects/torbrowser/design/#fingerprinting-linkability
+
+This also fixes bug #4795 by making queries still available for chrome windows,
+whilst returning nothing or non-device-specific values for web pages or extensions.
+---
+ layout/style/nsMediaFeatures.cpp | 42 ++++++++++++++++++++++++-------------
+ 1 files changed, 27 insertions(+), 15 deletions(-)
+
+diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp
+index 6eca06e..25735e8 100644
+--- a/layout/style/nsMediaFeatures.cpp
++++ b/layout/style/nsMediaFeatures.cpp
+@@ -130,6 +130,9 @@ GetDeviceContextFor(nsPresContext* aPresContext)
+ static nsSize
+ GetDeviceSize(nsPresContext* aPresContext)
+ {
++ if (!aPresContext->IsChrome()) {
++ return GetSize(aPresContext);
++ } else {
+ nsSize size;
+ if (aPresContext->IsRootPaginatedDocument())
+ // We want the page size, including unprintable areas and margins.
+@@ -140,6 +143,7 @@ GetDeviceSize(nsPresContext* aPresContext)
+ GetDeviceContextFor(aPresContext)->
+ GetDeviceSurfaceDimensions(size.width, size.height);
+ return size;
++ }
+ }
+
+ static nsresult
+@@ -183,17 +187,17 @@ static nsresult
+ GetDeviceOrientation(nsPresContext* aPresContext, const nsMediaFeature*,
+ nsCSSValue& aResult)
+ {
+- nsSize size = GetDeviceSize(aPresContext);
+- PRInt32 orientation;
+- if (size.width > size.height) {
+- orientation = NS_STYLE_ORIENTATION_LANDSCAPE;
+- } else {
+- // Per spec, square viewports should be 'portrait'
+- orientation = NS_STYLE_ORIENTATION_PORTRAIT;
+- }
+-
+- aResult.SetIntValue(orientation, eCSSUnit_Enumerated);
+- return NS_OK;
++ nsSize size = GetDeviceSize(aPresContext);
++ PRInt32 orientation;
++ if (size.width > size.height) {
++ orientation = NS_STYLE_ORIENTATION_LANDSCAPE;
++ } else {
++ // Per spec, square viewports should be 'portrait'
++ orientation = NS_STYLE_ORIENTATION_PORTRAIT;
++ }
++
++ aResult.SetIntValue(orientation, eCSSUnit_Enumerated);
++ return NS_OK;
+ }
+
+ static nsresult
+@@ -311,8 +315,12 @@ static nsresult
+ GetDevicePixelRatio(nsPresContext* aPresContext, const nsMediaFeature*,
+ nsCSSValue& aResult)
+ {
+- float ratio = aPresContext->CSSPixelsToDevPixels(1.0f);
+- aResult.SetFloatValue(ratio, eCSSUnit_Number);
++ if (aPresContext->IsChrome()) {
++ float ratio = aPresContext->CSSPixelsToDevPixels(1.0f);
++ aResult.SetFloatValue(ratio, eCSSUnit_Number);
++ } else {
++ aResult.SetFloatValue(1.0, eCSSUnit_Number);
++ }
+ return NS_OK;
+ }
+
+@@ -320,18 +328,21 @@ static nsresult
+ GetSystemMetric(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
+ nsCSSValue& aResult)
+ {
++ if (aPresContext->IsChrome()) {
+ NS_ABORT_IF_FALSE(aFeature->mValueType == nsMediaFeature::eBoolInteger,
+ "unexpected type");
+ nsIAtom *metricAtom = *aFeature->mData.mMetric;
+ bool hasMetric = nsCSSRuleProcessor::HasSystemMetric(metricAtom);
+ aResult.SetIntValue(hasMetric ? 1 : 0, eCSSUnit_Integer);
+- return NS_OK;
++ }
++ return NS_OK;
+ }
+
+ static nsresult
+ GetWindowsTheme(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
+ nsCSSValue& aResult)
+ {
++ if (aPresContext->IsChrome()) {
+ aResult.Reset();
+ #ifdef XP_WIN
+ PRUint8 windowsThemeId =
+@@ -350,7 +361,8 @@ GetWindowsTheme(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
+ }
+ }
+ #endif
+- return NS_OK;
++ }
++ return NS_OK;
+ }
+
+ /*
+--
+1.7.5.4
+
diff --git a/src/current-patches/firefox/alpha/0009-Provide-client-values-only-to-CSS-Media-Queries.patch b/src/current-patches/firefox/alpha/0009-Provide-client-values-only-to-CSS-Media-Queries.patch
deleted file mode 100644
index a520df9..0000000
--- a/src/current-patches/firefox/alpha/0009-Provide-client-values-only-to-CSS-Media-Queries.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 4c247867a8aa7401fb91e332cfd1dce10ab5a972 Mon Sep 17 00:00:00 2001
-From: Mike Perry <mikeperry-git at fscked.org>
-Date: Tue, 20 Dec 2011 21:02:49 -0800
-Subject: [PATCH 09/19] Provide client values only to CSS Media Queries
-
-Also disable a bunch of Mozilla extensions that smell like they are
-fingerprintable.
-
-This is done to address
-https://www.torproject.org/projects/torbrowser/design/#fingerprinting-linkability
----
- layout/style/nsMediaFeatures.cpp | 10 ++++++----
- 1 files changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp
-index 6eca06e..c68f191 100644
---- a/layout/style/nsMediaFeatures.cpp
-+++ b/layout/style/nsMediaFeatures.cpp
-@@ -383,14 +383,14 @@ nsMediaFeatures::features[] = {
- nsMediaFeature::eMinMaxAllowed,
- nsMediaFeature::eLength,
- { nsnull },
-- GetDeviceWidth
-+ GetWidth
- },
- {
- &nsGkAtoms::deviceHeight,
- nsMediaFeature::eMinMaxAllowed,
- nsMediaFeature::eLength,
- { nsnull },
-- GetDeviceHeight
-+ GetHeight
- },
- {
- &nsGkAtoms::orientation,
-@@ -411,7 +411,7 @@ nsMediaFeatures::features[] = {
- nsMediaFeature::eMinMaxAllowed,
- nsMediaFeature::eIntRatio,
- { nsnull },
-- GetDeviceAspectRatio
-+ GetAspectRatio
- },
- {
- &nsGkAtoms::color,
-@@ -457,6 +457,7 @@ nsMediaFeatures::features[] = {
- },
-
- // Mozilla extensions
-+/*
- {
- &nsGkAtoms::_moz_device_pixel_ratio,
- nsMediaFeature::eMinMaxAllowed,
-@@ -469,7 +470,7 @@ nsMediaFeatures::features[] = {
- nsMediaFeature::eMinMaxNotAllowed,
- nsMediaFeature::eEnumerated,
- { kOrientationKeywords },
-- GetDeviceOrientation
-+ GetOrientation
- },
- {
- &nsGkAtoms::_moz_is_resource_document,
-@@ -590,6 +591,7 @@ nsMediaFeatures::features[] = {
- { nsnull },
- GetWindowsTheme
- },
-+*/
- // Null-mName terminator:
- {
- nsnull,
---
-1.7.5.4
-
diff --git a/src/current-patches/firefox/alpha/0010-Rebrand-Firefox-to-TorBrowser.patch b/src/current-patches/firefox/alpha/0010-Rebrand-Firefox-to-TorBrowser.patch
index 3df8c83..0127277 100644
--- a/src/current-patches/firefox/alpha/0010-Rebrand-Firefox-to-TorBrowser.patch
+++ b/src/current-patches/firefox/alpha/0010-Rebrand-Firefox-to-TorBrowser.patch
@@ -1,4 +1,4 @@
-From 8a4f6f4a67a7f2fce746aaaeb9b80ce18da88d73 Mon Sep 17 00:00:00 2001
+From 622437f3baf410f14610b21bcca7f9a0fcc8c6d9 Mon Sep 17 00:00:00 2001
From: Erinn Clark <erinn at torproject.org>
Date: Wed, 25 Apr 2012 09:14:00 -0300
Subject: [PATCH 10/19] Rebrand Firefox to TorBrowser
diff --git a/src/current-patches/firefox/alpha/0011-Make-Download-manager-memory-only.patch b/src/current-patches/firefox/alpha/0011-Make-Download-manager-memory-only.patch
index d9e1b3e..5e0bcc2 100644
--- a/src/current-patches/firefox/alpha/0011-Make-Download-manager-memory-only.patch
+++ b/src/current-patches/firefox/alpha/0011-Make-Download-manager-memory-only.patch
@@ -1,4 +1,4 @@
-From 5cffe3a9aaadfc2e86779d9e050153ad747c5548 Mon Sep 17 00:00:00 2001
+From 8992ae1cb7e1545413e649027ab7827799c53300 Mon Sep 17 00:00:00 2001
From: Mike Perry <mikeperry-git at torproject.org>
Date: Wed, 25 Apr 2012 13:39:35 -0700
Subject: [PATCH 11/19] Make Download manager memory only.
diff --git a/src/current-patches/firefox/alpha/0012-Add-DDG-and-StartPage-to-Omnibox.patch b/src/current-patches/firefox/alpha/0012-Add-DDG-and-StartPage-to-Omnibox.patch
index f3ebe5b..b55c950 100644
--- a/src/current-patches/firefox/alpha/0012-Add-DDG-and-StartPage-to-Omnibox.patch
+++ b/src/current-patches/firefox/alpha/0012-Add-DDG-and-StartPage-to-Omnibox.patch
@@ -1,4 +1,4 @@
-From 96a520c56fd58f4ffaf89f26094de35425fa0ad4 Mon Sep 17 00:00:00 2001
+From 59b8b663b93248db34ad741ccb9972ecb6814c1f Mon Sep 17 00:00:00 2001
From: Mike Perry <mikeperry-git at torproject.org>
Date: Wed, 25 Apr 2012 15:03:46 -0700
Subject: [PATCH 12/19] Add DDG and StartPage to Omnibox.
diff --git a/src/current-patches/firefox/alpha/0013-Make-nsICacheService.EvictEntries-synchronous.patch b/src/current-patches/firefox/alpha/0013-Make-nsICacheService.EvictEntries-synchronous.patch
index cbc5bc7..0bda09f 100644
--- a/src/current-patches/firefox/alpha/0013-Make-nsICacheService.EvictEntries-synchronous.patch
+++ b/src/current-patches/firefox/alpha/0013-Make-nsICacheService.EvictEntries-synchronous.patch
@@ -1,4 +1,4 @@
-From 1cf939b8ba9e04b33969546436633d263c939000 Mon Sep 17 00:00:00 2001
+From 3b6137594c9f25725b3dd0fd46cfc8c86d6a772e Mon Sep 17 00:00:00 2001
From: Mike Perry <mikeperry-git at torproject.org>
Date: Tue, 1 May 2012 15:02:03 -0700
Subject: [PATCH 13/19] Make nsICacheService.EvictEntries synchronous
diff --git a/src/current-patches/firefox/alpha/0014-Prevent-WebSocket-DNS-leak.patch b/src/current-patches/firefox/alpha/0014-Prevent-WebSocket-DNS-leak.patch
index 667d9c8..7006bfb 100644
--- a/src/current-patches/firefox/alpha/0014-Prevent-WebSocket-DNS-leak.patch
+++ b/src/current-patches/firefox/alpha/0014-Prevent-WebSocket-DNS-leak.patch
@@ -1,4 +1,4 @@
-From b2f620bbb866f556dc3791bca5478f47a2255376 Mon Sep 17 00:00:00 2001
+From 0607517f87c2a0060f4f1e437f0ac37a889047a9 Mon Sep 17 00:00:00 2001
From: Mike Perry <mikeperry-git at torproject.org>
Date: Wed, 2 May 2012 17:44:39 -0700
Subject: [PATCH 14/19] Prevent WebSocket DNS leak.
diff --git a/src/current-patches/firefox/alpha/0015-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch b/src/current-patches/firefox/alpha/0015-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
index bc27267..93d576d 100644
--- a/src/current-patches/firefox/alpha/0015-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
+++ b/src/current-patches/firefox/alpha/0015-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
@@ -1,4 +1,4 @@
-From 57c38c109e0dd06eff36104570c40feefb03bb39 Mon Sep 17 00:00:00 2001
+From c482a4bd10c58099f7bab0c5990c6e5a29b6c59d Mon Sep 17 00:00:00 2001
From: Mike Perry <mikeperry-git at torproject.org>
Date: Thu, 7 Jun 2012 14:45:26 -0700
Subject: [PATCH 15/19] Make Tor Browser exit when not launched from Vidalia
diff --git a/src/current-patches/firefox/alpha/0016-Limit-the-number-of-fonts-per-document.patch b/src/current-patches/firefox/alpha/0016-Limit-the-number-of-fonts-per-document.patch
index 5053dea..8aa5485 100644
--- a/src/current-patches/firefox/alpha/0016-Limit-the-number-of-fonts-per-document.patch
+++ b/src/current-patches/firefox/alpha/0016-Limit-the-number-of-fonts-per-document.patch
@@ -1,4 +1,4 @@
-From 1fda7ee08947f2df08709afed325a14e6a82f64d Mon Sep 17 00:00:00 2001
+From 649b237e95315e9858cfb038f9f7f95199584cbd Mon Sep 17 00:00:00 2001
From: Mike Perry <mikeperry-git at torproject.org>
Date: Thu, 7 Jun 2012 15:09:59 -0700
Subject: [PATCH 16/19] Limit the number of fonts per document.
diff --git a/src/current-patches/firefox/alpha/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch b/src/current-patches/firefox/alpha/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch
index 67c40df..916afd0 100644
--- a/src/current-patches/firefox/alpha/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch
+++ b/src/current-patches/firefox/alpha/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch
@@ -1,4 +1,4 @@
-From a14811fde3ebdf0073daafb570a733f601411e21 Mon Sep 17 00:00:00 2001
+From 09c27d0aee130959ee1aae211e9400600c26ade6 Mon Sep 17 00:00:00 2001
From: Mike Perry <mikeperry-git at torproject.org>
Date: Thu, 7 Jun 2012 15:13:45 -0700
Subject: [PATCH 17/19] Randomize HTTP request order and pipeline depth.
diff --git a/src/current-patches/firefox/alpha/0018-Adapt-Steven-Michaud-s-Mac-crashfix-patch.patch b/src/current-patches/firefox/alpha/0018-Adapt-Steven-Michaud-s-Mac-crashfix-patch.patch
index 311b44c..16b57cf 100644
--- a/src/current-patches/firefox/alpha/0018-Adapt-Steven-Michaud-s-Mac-crashfix-patch.patch
+++ b/src/current-patches/firefox/alpha/0018-Adapt-Steven-Michaud-s-Mac-crashfix-patch.patch
@@ -1,4 +1,4 @@
-From f427cb05b95348ed98ece917d8578e69e291b0f1 Mon Sep 17 00:00:00 2001
+From e4cb4ddd38033c3a5779b61bfc5d33427ff92d14 Mon Sep 17 00:00:00 2001
From: Mike Perry <mikeperry-git at torproject.org>
Date: Thu, 7 Jun 2012 15:26:13 -0700
Subject: [PATCH 18/19] Adapt Steven Michaud's Mac crashfix patch
diff --git a/src/current-patches/firefox/alpha/0019-Fix-Firefox-13-build-process.patch b/src/current-patches/firefox/alpha/0019-Fix-Firefox-13-build-process.patch
index 52e245c..196f6a4 100644
--- a/src/current-patches/firefox/alpha/0019-Fix-Firefox-13-build-process.patch
+++ b/src/current-patches/firefox/alpha/0019-Fix-Firefox-13-build-process.patch
@@ -1,4 +1,4 @@
-From ec9c5da3fe2cfbd488e143e635b59f6e72c85c90 Mon Sep 17 00:00:00 2001
+From 9a3ebc94f8b48a89f2b9c3365eaea8bdb8043b2e Mon Sep 17 00:00:00 2001
From: Mike Perry <mikeperry-git at torproject.org>
Date: Fri, 8 Jun 2012 12:42:25 -0700
Subject: [PATCH 19/19] Fix Firefox 13 build process.
More information about the tor-commits
mailing list