代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/firefox 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# HG changeset patch
# User Henri Sivonen <hsivonen@hsivonen.fi>
# Date 1603457336 0
# Fri Oct 23 12:48:56 2020 +0000
# Node ID 9143f95d5ab3896f5461fa1666500f6fc1f9e73b
# Parent b067b0d3670b37daad95505b87bddca6bb113d11
Bug 1667113. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D93482
diff -r b067b0d3670b -r 9143f95d5ab3 browser/base/content/test/static/browser_parsable_css.js
--- a/browser/base/content/test/static/browser_parsable_css.js Fri Oct 23 12:48:52 2020 +0000
+++ b/browser/base/content/test/static/browser_parsable_css.js Fri Oct 23 12:48:56 2020 +0000
@@ -496,9 +496,9 @@
checkWhitelist(propNameWhitelist);
// Clean up to avoid leaks:
- iframe.remove();
doc.head.innerHTML = "";
doc = null;
+ iframe.remove();
iframe = null;
win = null;
hiddenFrame.destroy();
diff -r b067b0d3670b -r 9143f95d5ab3 dom/base/nsContentUtils.cpp
--- a/dom/base/nsContentUtils.cpp Fri Oct 23 12:48:52 2020 +0000
+++ b/dom/base/nsContentUtils.cpp Fri Oct 23 12:48:56 2020 +0000
@@ -4817,6 +4817,7 @@
nsIContent* target = aTargetNode;
+ RefPtr<Document> inert;
RefPtr<DocumentFragment> fragment;
// We sanitize if the fragment occurs in a system privileged
// context, an about: page, or if there are explicit sanitization flags.
@@ -4828,8 +4828,12 @@
nodePrincipal->SchemeIs("about") || aFlags >= 0;
if (shouldSanitize) {
if (!AllowsUnsanitizedContentForAboutNewTab(nodePrincipal)) {
- fragment = new (aTargetNode->OwnerDoc()->NodeInfoManager())
- DocumentFragment(aTargetNode->OwnerDoc()->NodeInfoManager());
+ inert = nsContentUtils::CreateInertHTMLDocument(aTargetNode->OwnerDoc());
+ if (!inert) {
+ return NS_ERROR_FAILURE;
+ }
+ fragment = new (inert->NodeInfoManager())
+ DocumentFragment(inert->NodeInfoManager());
target = fragment;
}
}
@@ -4908,22 +4908,7 @@
MOZ_ASSERT(contentsink, "Sink doesn't QI to nsIContentSink!");
sXMLFragmentParser->SetContentSink(contentsink);
- sXMLFragmentSink->SetTargetDocument(aDocument);
- sXMLFragmentSink->SetPreventScriptExecution(aPreventScriptExecution);
-
- nsresult rv = sXMLFragmentParser->ParseFragment(aSourceBuffer, aTagStack);
- if (NS_FAILED(rv)) {
- // Drop the fragment parser and sink that might be in an inconsistent state
- NS_IF_RELEASE(sXMLFragmentParser);
- NS_IF_RELEASE(sXMLFragmentSink);
- return rv;
- }
-
- rv = sXMLFragmentSink->FinishFragmentParsing(aReturn);
-
- sXMLFragmentParser->Reset();
- NS_ENSURE_SUCCESS(rv, rv);
-
+ RefPtr<Document> doc;
nsCOMPtr<nsIPrincipal> nodePrincipal = aDocument->NodePrincipal();
#ifdef DEBUG
@@ -4929,6 +4929,27 @@
// an about: scheme principal.
bool shouldSanitize = nodePrincipal->IsSystemPrincipal() ||
nodePrincipal->SchemeIs("about") || aFlags >= 0;
+ if (shouldSanitize) {
+ doc = nsContentUtils::CreateInertXMLDocument(aDocument);
+ } else {
+ doc = aDocument;
+ }
+
+ sXMLFragmentSink->SetTargetDocument(doc);
+ sXMLFragmentSink->SetPreventScriptExecution(aPreventScriptExecution);
+
+ nsresult rv = sXMLFragmentParser->ParseFragment(aSourceBuffer, aTagStack);
+ if (NS_FAILED(rv)) {
+ // Drop the fragment parser and sink that might be in an inconsistent state
+ NS_IF_RELEASE(sXMLFragmentParser);
+ NS_IF_RELEASE(sXMLFragmentSink);
+ return rv;
+ }
+
+ rv = sXMLFragmentSink->FinishFragmentParsing(aReturn);
+
+ sXMLFragmentParser->Reset();
+ NS_ENSURE_SUCCESS(rv, rv);
if (shouldSanitize) {
uint32_t sanitizationFlags =
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。