From b83cc03bd25908baa259b3f38b269849d81db1ca Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Tue, 10 Nov 2015 12:13:45 -0800 Subject: [PATCH] Bug 773429 - Remove dom.disable_image_src_set. r=khuey --- dom/base/nsContentUtils.cpp | 8 -------- dom/base/nsContentUtils.h | 2 -- dom/html/HTMLImageElement.cpp | 6 ------ dom/svg/SVGFEImageElement.cpp | 5 ----- dom/svg/SVGImageElement.cpp | 6 ------ dom/svg/SVGImageElement.h | 2 -- layout/svg/SVGFEImageFrame.cpp | 6 ------ layout/svg/nsSVGImageFrame.cpp | 5 ----- modules/libpref/init/all.js | 1 - 9 files changed, 41 deletions(-) diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 4a941aa70288..cce948c725df 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -2116,14 +2116,6 @@ nsContentUtils::IsCallerContentXBL() return xpc::IsContentXBLScope(c); } - -bool -nsContentUtils::IsImageSrcSetDisabled() -{ - return Preferences::GetBool("dom.disable_image_src_set") && - !IsCallerChrome(); -} - // static bool nsContentUtils::LookupBindingMember(JSContext* aCx, nsIContent *aContent, diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index 426fa1d2c328..18b79bcb23b7 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -236,8 +236,6 @@ public: return SubjectPrincipal(); } - static bool IsImageSrcSetDisabled(); - static bool LookupBindingMember(JSContext* aCx, nsIContent *aContent, JS::Handle aId, JS::MutableHandle aDesc); diff --git a/dom/html/HTMLImageElement.cpp b/dom/html/HTMLImageElement.cpp index f3505766a67c..b339eab749cc 100644 --- a/dom/html/HTMLImageElement.cpp +++ b/dom/html/HTMLImageElement.cpp @@ -535,12 +535,6 @@ HTMLImageElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aName, if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::src) { - // This is for dom.disable_image_src_set, which predates "srcset" - // as an attribute. See Bug 773429 - if (nsContentUtils::IsImageSrcSetDisabled()) { - return NS_OK; - } - if (InResponsiveMode()) { if (mResponsiveSelector && mResponsiveSelector->Content() == this) { diff --git a/dom/svg/SVGFEImageElement.cpp b/dom/svg/SVGFEImageElement.cpp index dbd0a68b1455..e085f00895ed 100644 --- a/dom/svg/SVGFEImageElement.cpp +++ b/dom/svg/SVGFEImageElement.cpp @@ -114,11 +114,6 @@ SVGFEImageElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, // If there is a frame then it should deal with loading as the image // url may be animated. if (!GetPrimaryFrame()) { - - // Prevent setting image.src by exiting early - if (nsContentUtils::IsImageSrcSetDisabled()) { - return NS_OK; - } if (aValue) { LoadSVGImage(true, aNotify); } else { diff --git a/dom/svg/SVGImageElement.cpp b/dom/svg/SVGImageElement.cpp index a2224e326d80..144e375f2dc8 100644 --- a/dom/svg/SVGImageElement.cpp +++ b/dom/svg/SVGImageElement.cpp @@ -143,12 +143,6 @@ SVGImageElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, // If there is a frame then it should deal with loading as the image // url may be animated if (!GetPrimaryFrame()) { - - // Prevent setting image.src by exiting early - if (nsContentUtils::IsImageSrcSetDisabled()) { - return NS_OK; - } - if (aValue) { LoadSVGImage(true, aNotify); } else { diff --git a/dom/svg/SVGImageElement.h b/dom/svg/SVGImageElement.h index 69ef9c7d2e10..7835b9b3538e 100644 --- a/dom/svg/SVGImageElement.h +++ b/dom/svg/SVGImageElement.h @@ -68,8 +68,6 @@ public: void MaybeLoadSVGImage(); - bool IsImageSrcSetDisabled() const; - // WebIDL already_AddRefed X(); already_AddRefed Y(); diff --git a/layout/svg/SVGFEImageFrame.cpp b/layout/svg/SVGFEImageFrame.cpp index 375042707fe0..9cdd1a6424ea 100644 --- a/layout/svg/SVGFEImageFrame.cpp +++ b/layout/svg/SVGFEImageFrame.cpp @@ -130,12 +130,6 @@ SVGFEImageFrame::AttributeChanged(int32_t aNameSpaceID, } if (aNameSpaceID == kNameSpaceID_XLink && aAttribute == nsGkAtoms::href) { - - // Prevent setting image.src by exiting early - if (nsContentUtils::IsImageSrcSetDisabled()) { - return NS_OK; - } - if (element->mStringAttributes[SVGFEImageElement::HREF].IsExplicitlySet()) { element->LoadSVGImage(true, true); } else { diff --git a/layout/svg/nsSVGImageFrame.cpp b/layout/svg/nsSVGImageFrame.cpp index 37dc53787ab1..b54e2ce8a4b8 100644 --- a/layout/svg/nsSVGImageFrame.cpp +++ b/layout/svg/nsSVGImageFrame.cpp @@ -208,11 +208,6 @@ nsSVGImageFrame::AttributeChanged(int32_t aNameSpaceID, } if (aNameSpaceID == kNameSpaceID_XLink && aAttribute == nsGkAtoms::href) { - - // Prevent setting image.src by exiting early - if (nsContentUtils::IsImageSrcSetDisabled()) { - return NS_OK; - } SVGImageElement *element = static_cast(mContent); if (element->mStringAttributes[SVGImageElement::HREF].IsExplicitlySet()) { diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 6b03f0558594..c3b286311065 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1036,7 +1036,6 @@ pref("editor.positioning.offset", 0); // Scripts & Windows prefs pref("dom.disable_beforeunload", false); -pref("dom.disable_image_src_set", false); pref("dom.disable_window_flip", false); pref("dom.disable_window_move_resize", false); pref("dom.disable_window_status_change", false);