Bug 1364505 - Add a rule to favor plugin fallback content when no srcURI has been specified. r=qDot draft
authorFelipe Gomes <felipc@gmail.com>
Mon, 15 May 2017 16:56:17 -0300
changeset 578039 f0d9df61e10763740803e9ba45d89134a8ed6bbb
parent 577862 0f4df67c5f162e00d6f52825badf468aefbfba19
child 578040 800ea03a3d53b04b16675f61bb600d211e143de8
child 578976 02b5b8832e095b93aa6003461446589e6d3157ea
push id58868
push userfelipc@gmail.com
push dateMon, 15 May 2017 19:56:46 +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: 3nrfFXqrWLJ
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)) {