зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 126368a5c3ec (bug 1465388) for causing topcrash bug 1487004 a=backout
This commit is contained in:
Родитель
d716a04e20
Коммит
65e947cc68
|
@ -10042,7 +10042,6 @@ public:
|
|||
parser->BlockParser();
|
||||
mParser = do_GetWeakReference(parser);
|
||||
mDocument = aDocument;
|
||||
mDocument->BlockOnload();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10081,7 +10080,6 @@ private:
|
|||
if (parser == docParser) {
|
||||
parser->UnblockParser();
|
||||
parser->ContinueInterruptedParsingAsync();
|
||||
mDocument->UnblockOnload(false);
|
||||
}
|
||||
}
|
||||
mParser = nullptr;
|
||||
|
|
|
@ -131,7 +131,6 @@ public:
|
|||
virtual void SetDocumentCharset(NotNull<const Encoding*> aEncoding) override;
|
||||
virtual nsISupports *GetTarget() override;
|
||||
virtual bool IsScriptExecuting() override;
|
||||
virtual void ContinueInterruptedParsingAsync() override;
|
||||
|
||||
// nsIHTMLContentSink
|
||||
NS_IMETHOD OpenContainer(ElementType aNodeType) override;
|
||||
|
@ -176,9 +175,6 @@ protected:
|
|||
void NotifyInsert(nsIContent* aContent,
|
||||
nsIContent* aChildContent);
|
||||
void NotifyRootInsertion();
|
||||
|
||||
private:
|
||||
void ContinueInterruptedParsingIfEnabled();
|
||||
};
|
||||
|
||||
class SinkContext
|
||||
|
@ -1051,23 +1047,3 @@ HTMLContentSink::IsScriptExecuting()
|
|||
{
|
||||
return IsScriptExecutingImpl();
|
||||
}
|
||||
|
||||
void
|
||||
HTMLContentSink::ContinueInterruptedParsingIfEnabled()
|
||||
{
|
||||
if (mParser->IsParserEnabled()) {
|
||||
static_cast<nsIParser*>(mParser.get())->ContinueInterruptedParsing();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
HTMLContentSink::ContinueInterruptedParsingAsync()
|
||||
{
|
||||
nsCOMPtr<nsIRunnable> ev =
|
||||
NewRunnableMethod("HTMLContentSink::ContinueInterruptedParsingIfEnabled",
|
||||
this,
|
||||
&HTMLContentSink::ContinueInterruptedParsingIfEnabled);
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(mHTMLDocument);
|
||||
doc->Dispatch(mozilla::TaskCategory::Other, ev.forget());
|
||||
}
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
const server = createHttpServer({hosts: ["example.com"]});
|
||||
|
||||
server.registerPathHandler("/blank-iframe.html", (request, response) => {
|
||||
response.setStatusLine(request.httpVersion, 200, "OK");
|
||||
response.setHeader("Content-Type", "text/html; charset=utf-8", false);
|
||||
response.write("<iframe></iframe>");
|
||||
});
|
||||
|
||||
add_task(async function content_script_at_document_start() {
|
||||
let extensionData = {
|
||||
manifest: {
|
||||
content_scripts: [{
|
||||
"matches": ["<all_urls>"],
|
||||
"js": ["start.js"],
|
||||
"run_at": "document_start",
|
||||
"match_about_blank": true,
|
||||
}],
|
||||
},
|
||||
|
||||
files: {
|
||||
"start.js": function() {
|
||||
browser.test.sendMessage("content-script-done");
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
let extension = ExtensionTestUtils.loadExtension(extensionData);
|
||||
await extension.startup();
|
||||
let contentPage = await ExtensionTestUtils.loadContentPage(`about:blank`);
|
||||
await extension.awaitMessage("content-script-done");
|
||||
await contentPage.close();
|
||||
await extension.unload();
|
||||
});
|
||||
|
||||
add_task(async function content_style_at_document_start() {
|
||||
let extensionData = {
|
||||
manifest: {
|
||||
content_scripts: [{
|
||||
"matches": ["<all_urls>"],
|
||||
"css": ["start.css"],
|
||||
"run_at": "document_start",
|
||||
"match_about_blank": true,
|
||||
}, {
|
||||
"matches": ["<all_urls>"],
|
||||
"js": ["end.js"],
|
||||
"run_at": "document_end",
|
||||
"match_about_blank": true,
|
||||
}],
|
||||
},
|
||||
|
||||
files: {
|
||||
"start.css": "body { background: red; }",
|
||||
"end.js": function() {
|
||||
let style = window.getComputedStyle(document.body);
|
||||
browser.test.assertEq("rgb(255, 0, 0)", style.backgroundColor, "document_start style should have been applied");
|
||||
browser.test.sendMessage("content-script-done");
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
let extension = ExtensionTestUtils.loadExtension(extensionData);
|
||||
await extension.startup();
|
||||
let contentPage = await ExtensionTestUtils.loadContentPage(`about:blank`);
|
||||
await extension.awaitMessage("content-script-done");
|
||||
await contentPage.close();
|
||||
await extension.unload();
|
||||
});
|
|
@ -2,8 +2,8 @@
|
|||
skip-if = os == "android" || (os == "win" && debug) || (os == "linux")
|
||||
[test_ext_i18n_css.js]
|
||||
[test_ext_contentscript.js]
|
||||
[test_ext_contentscript_about_blank_start.js]
|
||||
[test_ext_contentscript_scriptCreated.js]
|
||||
skip-if = debug # Bug 1407501
|
||||
[test_ext_contentscript_triggeringPrincipal.js]
|
||||
skip-if = (os == "android" && debug) || (os == "win" && debug) # Windows: Bug 1438796
|
||||
[test_ext_contentscript_xrays.js]
|
||||
|
|
Загрузка…
Ссылка в новой задаче