Bug 1364505 - Add a rule to favor plugin fallback content when no srcURI has been specified. r=qDot
authorFelipe Gomes <felipc@gmail.com>
Tue, 16 May 2017 22:56:22 -0300
changeset 579414 f35b966ff0247b8adccde22222aee3814ad38919
parent 579413 8aae91ffd0749753651c88419f869a6749ffa591
child 579415 e30e7ee30b7c7672ae4bf6265e63db5ae8829d53
push id59244
push usergsquelart@mozilla.com
push dateWed, 17 May 2017 09:45:34 +0000
reviewersqDot
bugs1364505
milestone55.0a1
Bug 1364505 - Add a rule to favor plugin fallback content when no srcURI has been specified. r=qDot MozReview-Commit-ID: 18VcbxHmi0c
dom/base/nsObjectLoadingContent.cpp
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -3428,16 +3428,24 @@ nsObjectLoadingContent::HasGoodFallback(
            child;
            child = child->GetNextNode(thisContent)) {
         if (child->IsHTMLElement(nsGkAtoms::video)) {
           return true;
         }
       }
     }
 
+    // RULE "nosrc":
+    // Use fallback content if the object has not specified an 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")) {
       nsTArray<nsINodeList*> childNodes;
       for (nsIContent* child = thisContent->GetFirstChild();
            child;
            child = child->GetNextNode(thisContent)) {
         if (child->IsHTMLElement(nsGkAtoms::a)) {