Bug 1283526 followup - Restore some removed code to fix bustage. a=bustage
authorXidorn Quan <me@upsuper.org>
Mon, 18 Jul 2016 15:41:05 +1000
changeset 339972 25b896fe818d3fb6da7f9699c173adcc62c817ec
parent 339971 18f1606b05b4c5e69f09a9caf4a4d88a3a47ce69
child 339973 0eda20ce81496c7d64fc9bb9851bcfaa3e764a50
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1283526
milestone49.0a2
Bug 1283526 followup - Restore some removed code to fix bustage. a=bustage MozReview-Commit-ID: 5YwowCJjDj
dom/html/HTMLIFrameElement.cpp
--- a/dom/html/HTMLIFrameElement.cpp
+++ b/dom/html/HTMLIFrameElement.cpp
@@ -235,17 +235,32 @@ HTMLIFrameElement::UnsetAttr(int32_t aNa
 uint32_t
 HTMLIFrameElement::GetSandboxFlags()
 {
   const nsAttrValue* sandboxAttr = GetParsedAttr(nsGkAtoms::sandbox);
   // No sandbox attribute, no sandbox flags.
   if (!sandboxAttr) {
     return 0;
   }
-  return nsContentUtils::ParseSandboxAttributeToFlags(sandboxAttr);
+
+  //  Start off by setting all the restriction flags.
+  uint32_t out = SANDBOX_ALL_FLAGS;
+
+// Macro for updating the flag according to the keywords
+#define SANDBOX_KEYWORD(string, atom, flags)                             \
+  if (sandboxAttr->Contains(nsGkAtoms::atom, eIgnoreCase)) { out &= ~(flags); }
+#include "IframeSandboxKeywordList.h"
+#undef SANDBOX_KEYWORD
+
+  if (GetParsedAttr(nsGkAtoms::allowfullscreen) ||
+      GetParsedAttr(nsGkAtoms::mozallowfullscreen)) {
+    out &= ~SANDBOXED_FULLSCREEN;
+  }
+
+  return out;
 }
 
 JSObject*
 HTMLIFrameElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return HTMLIFrameElementBinding::Wrap(aCx, this, aGivenProto);
 }