mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Bug 1459309 - currentScript should be null when evaluating scripts from shadow DOM, r=peterv
--HG-- extra : rebase_source : 53979237d9d94438966ef470cc9ff80d612ef4ee
This commit is contained in:
parent
21590be8b8
commit
ae2b960685
@ -57,7 +57,9 @@ class ScriptLoader final : public nsISupports
|
||||
: mOldScript(aScriptLoader->mCurrentScript)
|
||||
, mScriptLoader(aScriptLoader)
|
||||
{
|
||||
mScriptLoader->mCurrentScript = aCurrentScript;
|
||||
nsCOMPtr<nsINode> node = do_QueryInterface(aCurrentScript);
|
||||
mScriptLoader->mCurrentScript =
|
||||
node && !node->IsInShadowTree() ? aCurrentScript : nullptr;
|
||||
}
|
||||
|
||||
~AutoCurrentScriptUpdater()
|
||||
|
@ -1,8 +0,0 @@
|
||||
[Document-prototype-currentScript.html]
|
||||
expected: ERROR
|
||||
[document.currentScript must not be set to a script element that loads an external script in an open shadow tree]
|
||||
expected: FAIL
|
||||
|
||||
[document.currentScript must not be set to a script element that loads an external script in a closed shadow tree]
|
||||
expected: FAIL
|
||||
|
@ -40,10 +40,11 @@ var testedScriptElement = null;
|
||||
function executeNextTest()
|
||||
{
|
||||
var testCase = asyncScriptTests.shift();
|
||||
var mode = testCase.mode;
|
||||
if (!testCase)
|
||||
return;
|
||||
|
||||
var mode = testCase.mode;
|
||||
|
||||
testCase.test.step(function () {
|
||||
testedScriptElement = document.createElement('script');
|
||||
testedScriptElement.src = 'resources/Document-prototype-currentScript-helper.js';
|
||||
@ -75,7 +76,7 @@ var asyncScriptTests = [
|
||||
test: async_test('document.currentScript must be set to a script element that loads an external script in a document tree'),
|
||||
mode: null, remove: false, expected: function () { return testedScriptElement; }},
|
||||
{
|
||||
test: async_test('document.currentScript must be set to a script element that loads an external script in a document tree'),
|
||||
test: async_test('document.currentScript must be set to a script element that loads an external script in a document tree (2)'),
|
||||
mode: null, remove: true, expected: function () { return testedScriptElement; }},
|
||||
{
|
||||
test: async_test('document.currentScript must not be set to a script element that loads an external script in an open shadow tree'),
|
||||
|
Loading…
Reference in New Issue
Block a user