Loading dom/base/nsObjectLoadingContent.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ #include "mozilla/PresShell.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/StaticPrefs_browser.h" #include "mozilla/StaticPrefs_dom.h" #include "nsChannelClassifier.h" #include "nsFocusManager.h" #include "ReferrerInfo.h" Loading Loading @@ -720,11 +721,12 @@ nsObjectLoadingContent::UpdateObjectParameters() { /// Codebase /// nsAutoString codebaseStr; nsIURI* docBaseURI = el->GetBaseURI(); el->GetAttr(nsGkAtoms::codebase, codebaseStr); if (!codebaseStr.IsEmpty()) { nsAutoString codebaseStr; el->GetAttr(nsGkAtoms::codebase, codebaseStr); if (StaticPrefs::dom_object_embed_codebase_enabled() && !codebaseStr.IsEmpty()) { rv = nsContentUtils::NewURIWithDocumentCharset( getter_AddRefs(newBaseURI), codebaseStr, el->OwnerDoc(), docBaseURI); if (NS_FAILED(rv)) { Loading modules/libpref/init/StaticPrefList.yaml +6 −0 Original line number Diff line number Diff line Loading @@ -3206,6 +3206,12 @@ value: true mirror: always # Whether the codebase attribute in an <object> is used as the base URI. - name: dom.object_embed.codebase.enabled type: bool value: false mirror: always # Whether origin trials are enabled. - name: dom.origin-trials.enabled type: bool Loading testing/web-platform/tests/html/semantics/embedded-content/the-object-element/historical.html +13 −0 Original line number Diff line number Diff line Loading @@ -30,4 +30,17 @@ async_test(t => { obj.onerror = t.unreached_func(); document.body.appendChild(obj); }, "object's typemustmatch content attribute should not be supported"); async_test(t => { const obj = document.createElement("object"); t.add_cleanup(() => obj.remove()); obj.setAttribute("data", "/common/blank.html"); obj.setAttribute("codebase", "https://test.invalid/"); obj.onload = t.step_func_done(() => { assert_not_equals(obj.contentDocument, null, "/common/blank.html should be loaded"); assert_equals(obj.contentDocument.location.origin, location.origin, "document should be loaded with current origin as base"); }); obj.onerror = t.unreached_func(); document.body.appendChild(obj); }, "object's codebase content attribute should not be supported"); </script> Loading
dom/base/nsObjectLoadingContent.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ #include "mozilla/PresShell.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/StaticPrefs_browser.h" #include "mozilla/StaticPrefs_dom.h" #include "nsChannelClassifier.h" #include "nsFocusManager.h" #include "ReferrerInfo.h" Loading Loading @@ -720,11 +721,12 @@ nsObjectLoadingContent::UpdateObjectParameters() { /// Codebase /// nsAutoString codebaseStr; nsIURI* docBaseURI = el->GetBaseURI(); el->GetAttr(nsGkAtoms::codebase, codebaseStr); if (!codebaseStr.IsEmpty()) { nsAutoString codebaseStr; el->GetAttr(nsGkAtoms::codebase, codebaseStr); if (StaticPrefs::dom_object_embed_codebase_enabled() && !codebaseStr.IsEmpty()) { rv = nsContentUtils::NewURIWithDocumentCharset( getter_AddRefs(newBaseURI), codebaseStr, el->OwnerDoc(), docBaseURI); if (NS_FAILED(rv)) { Loading
modules/libpref/init/StaticPrefList.yaml +6 −0 Original line number Diff line number Diff line Loading @@ -3206,6 +3206,12 @@ value: true mirror: always # Whether the codebase attribute in an <object> is used as the base URI. - name: dom.object_embed.codebase.enabled type: bool value: false mirror: always # Whether origin trials are enabled. - name: dom.origin-trials.enabled type: bool Loading
testing/web-platform/tests/html/semantics/embedded-content/the-object-element/historical.html +13 −0 Original line number Diff line number Diff line Loading @@ -30,4 +30,17 @@ async_test(t => { obj.onerror = t.unreached_func(); document.body.appendChild(obj); }, "object's typemustmatch content attribute should not be supported"); async_test(t => { const obj = document.createElement("object"); t.add_cleanup(() => obj.remove()); obj.setAttribute("data", "/common/blank.html"); obj.setAttribute("codebase", "https://test.invalid/"); obj.onload = t.step_func_done(() => { assert_not_equals(obj.contentDocument, null, "/common/blank.html should be loaded"); assert_equals(obj.contentDocument.location.origin, location.origin, "document should be loaded with current origin as base"); }); obj.onerror = t.unreached_func(); document.body.appendChild(obj); }, "object's codebase content attribute should not be supported"); </script>