From 3a1354f5ba5f9fd3e0c9bae43e3de2f8a76494a6 Mon Sep 17 00:00:00 2001 From: John Schoenick Date: Wed, 5 Sep 2012 14:52:20 -0700 Subject: [PATCH] Backout a6f040934c99 (Bug 548133) for reftest orange --- content/base/src/nsObjectLoadingContent.cpp | 29 +++++++++++++++---- content/base/test/chrome/file_bug391728.html | 16 ++++++++-- .../base/test/chrome/file_bug391728_2.html | 16 ++++++++-- content/base/test/chrome/test_bug391728.html | 2 +- content/base/test/test_bug368972.html | 11 +++++++ dom/plugins/base/nsPluginInstanceOwner.cpp | 3 +- layout/style/nsCSSPseudoClassList.h | 2 ++ layout/style/nsCSSRuleProcessor.cpp | 21 ++++++++++++++ layout/style/test/test_selectors.html | 1 + .../plugins/content/pluginFinderBinding.css | 4 +-- .../plugins/content/pluginProblemBinding.css | 4 +-- 11 files changed, 91 insertions(+), 18 deletions(-) diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp index 0ddb4e55df28..439f0801ee4d 100644 --- a/content/base/src/nsObjectLoadingContent.cpp +++ b/content/base/src/nsObjectLoadingContent.cpp @@ -2281,20 +2281,37 @@ nsObjectLoadingContent::LoadFallback(FallbackType aType, bool aNotify) { aType = eFallbackAlternate; } + /// XXX(johns): This block is just mimicing legacy behavior, not any spec + // Check if we have any significant content (excluding param tags) OR a + // param named 'pluginUrl' + bool hasAlternateContent = false; + bool hasPluginUrl = false; if (thisContent->Tag() == nsGkAtoms::object && (aType == eFallbackUnsupported || aType == eFallbackDisabled || aType == eFallbackBlocklisted)) { - // Show alternate content instead, if it exists for (nsIContent* child = thisContent->GetFirstChild(); - child; child = child->GetNextSibling()) { - if (!child->IsHTML(nsGkAtoms::param) && - nsStyleUtil::IsSignificantChild(child, true, false)) { - aType = eFallbackAlternate; - break; + child; child = child->GetNextSibling()) + { + if (child->IsHTML(nsGkAtoms::param)) { + if (child->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name, + NS_LITERAL_STRING("pluginurl"), eIgnoreCase)) { + hasPluginUrl = true; + } + } else if (nsStyleUtil::IsSignificantChild(child, true, false)) { + hasAlternateContent = true; } } + + // Show alternate content if it exists, unless we have a 'pluginurl' param, + // in which case the missing-plugin fallback handler will want to handle + // it + if (hasAlternateContent && !hasPluginUrl) { + LOG(("OBJLC [%p]: Unsupported/disabled/blocked plugin has alternate " + "content, showing instead of custom handler", this)); + aType = eFallbackAlternate; + } } mType = eType_Null; diff --git a/content/base/test/chrome/file_bug391728.html b/content/base/test/chrome/file_bug391728.html index 7d81a39b62bc..984734580166 100644 --- a/content/base/test/chrome/file_bug391728.html +++ b/content/base/test/chrome/file_bug391728.html @@ -43,7 +43,7 @@ document.addEventListener("PluginBlocklisted", blocked_plugin_detected, true);
- +
@@ -69,6 +69,16 @@ document.addEventListener("PluginBlocklisted", blocked_plugin_detected, true); + +
+ +

Fallback content

+
+
+ +

Fallback content

+
+

Fallback content

@@ -80,10 +90,10 @@ document.addEventListener("PluginBlocklisted", blocked_plugin_detected, true);
- +
- +
diff --git a/content/base/test/chrome/file_bug391728_2.html b/content/base/test/chrome/file_bug391728_2.html index ad08cbae1f9d..9af2621216f9 100644 --- a/content/base/test/chrome/file_bug391728_2.html +++ b/content/base/test/chrome/file_bug391728_2.html @@ -43,7 +43,7 @@ document.addEventListener("PluginBlocklisted", blocked_plugin_detected, true);
- +
@@ -69,6 +69,16 @@ document.addEventListener("PluginBlocklisted", blocked_plugin_detected, true);
+ +
+ +

Fallback content

+
+
+ +

Fallback content

+
+

Fallback content

@@ -80,10 +90,10 @@ document.addEventListener("PluginBlocklisted", blocked_plugin_detected, true);
- +
- +
diff --git a/content/base/test/chrome/test_bug391728.html b/content/base/test/chrome/test_bug391728.html index 70ace4fbf141..aa745105ed8c 100644 --- a/content/base/test/chrome/test_bug391728.html +++ b/content/base/test/chrome/test_bug391728.html @@ -19,7 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=391728