From f67e3f054fcdd04e78a7779ec7e7f44643ec47e5 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 1 Sep 2019 15:15:19 +0200 Subject: Issue #1179: fix indentation --- dom/base/nsObjectLoadingContent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index 3c850c4cd..590f236c0 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -718,9 +718,9 @@ nsObjectLoadingContent::UnbindFromTree(bool aDeep, bool aNullParent) if (mType == eType_Plugin) { nsIDocument* doc = thisContent->GetComposedDoc(); if (doc && doc->IsActive()) { - nsCOMPtr ev = new nsSimplePluginEvent(doc, - NS_LITERAL_STRING("PluginRemoved")); - NS_DispatchToCurrentThread(ev); + nsCOMPtr ev = new nsSimplePluginEvent(doc, + NS_LITERAL_STRING("PluginRemoved")); + NS_DispatchToCurrentThread(ev); } } } -- cgit v1.2.3 From 09a8b2f19689b679b1268a3004ec5e3f37b9732a Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 1 Sep 2019 16:39:40 +0200 Subject: Correctly return zero vertices if clipping plane 0 or 2 clip away the entire polygon. This fixes a regression caused by the fix for CVE-2016-5252 --- gfx/2d/Matrix.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/gfx/2d/Matrix.h b/gfx/2d/Matrix.h index 22a01ca10..84c9a5280 100644 --- a/gfx/2d/Matrix.h +++ b/gfx/2d/Matrix.h @@ -734,7 +734,8 @@ public: // Initialize a double-buffered array of points in homogenous space with // the input rectangle, aRect. Point4DTyped points[2][kTransformAndClipRectMaxVerts]; - Point4DTyped* dstPoint = points[0]; + Point4DTyped* dstPointStart = points[0]; + Point4DTyped* dstPoint = dstPointStart; *dstPoint++ = TransformPoint(Point4DTyped(aRect.x, aRect.y, 0, 1)); *dstPoint++ = TransformPoint(Point4DTyped(aRect.XMost(), aRect.y, 0, 1)); @@ -754,11 +755,11 @@ public: // points[1]. for (int plane=0; plane < 4; plane++) { planeNormals[plane].Normalize(); - Point4DTyped* srcPoint = points[plane & 1]; + Point4DTyped* srcPoint = dstPointStart; Point4DTyped* srcPointEnd = dstPoint; - dstPoint = points[~plane & 1]; - Point4DTyped* dstPointStart = dstPoint; + dstPointStart = points[~plane & 1]; + dstPoint = dstPointStart; Point4DTyped* prevPoint = srcPointEnd - 1; F prevDot = planeNormals[plane].DotProduct(*prevPoint); @@ -787,10 +788,10 @@ public: } } - size_t dstPointCount = 0; - size_t srcPointCount = dstPoint - points[0]; - for (Point4DTyped* srcPoint = points[0]; srcPoint < points[0] + srcPointCount; srcPoint++) { - + Point4DTyped* srcPoint = dstPointStart; + Point4DTyped* srcPointEnd = dstPoint; + size_t vertCount = 0; + while (srcPoint < srcPointEnd) { PointTyped p; if (srcPoint->w == 0.0) { // If a point lies on the intersection of the clipping planes at @@ -800,12 +801,13 @@ public: p = srcPoint->As2DPoint(); } // Emit only unique points - if (dstPointCount == 0 || p != aVerts[dstPointCount - 1]) { - aVerts[dstPointCount++] = p; + if (vertCount == 0 || p != aVerts[vertCount - 1]) { + aVerts[vertCount++] = p; } + srcPoint++; } - return dstPointCount; + return vertCount; } static const int kTransformAndClipRectMaxVerts = 32; -- cgit v1.2.3 From 8f7d40e854f2941c2ddd75fb6532407e07a72609 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 1 Sep 2019 16:44:47 +0200 Subject: Issue #1222: Don't load plugin instances when they have no `src` URI. Favor fallback content in that case (if present). Fallback is always considered "good" in this case so may end up doing nothing which is what we'd want for corner cases that hammer this routine with no content. --- application/palemoon/app/profile/palemoon.js | 9 +++++++++ dom/base/nsObjectLoadingContent.cpp | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js index ee71c4ea1..df46ea4b6 100644 --- a/application/palemoon/app/profile/palemoon.js +++ b/application/palemoon/app/profile/palemoon.js @@ -682,6 +682,15 @@ pref("plugins.update.notifyUser", false); //Enable tri-state option (Always/Never/Ask) pref("plugins.click_to_play", true); +// Platform pref is to enable all plugins by default. +// Uncomment this pref to default to click-to-play +// pref("plugin.default.state", 1); + +// Don't load plugin instances with no src declared. +// These prefs are documented in detail in all.js. +pref("plugins.favorfallback.mode", "follow-ctp"); +pref("plugins.favorfallback.rules", "nosrc"); + #ifdef XP_WIN pref("browser.preferences.instantApply", false); #else diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index 590f236c0..4978744e8 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -3628,6 +3628,14 @@ nsObjectLoadingContent::HasGoodFallback() { } } + // RULE "nosrc": + // Use fallback content if the object has not specified a src URI. + if (rulesList[i].EqualsLiteral("nosrc")) { + if (!mOriginalURI) { + return true; + } + } + // RULE "adobelink": // Don't use fallback content when it has a link to adobe's website. if (rulesList[i].EqualsLiteral("adobelink")) { -- cgit v1.2.3