mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Auto merge of #14210 - GuillaumeGomez:fragment_node, r=nox
Add missing action in CreateContextualFragment method r? @nox <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14210) <!-- Reviewable:end -->
This commit is contained in:
commit
d562d10180
13 changed files with 14 additions and 22 deletions
|
@ -595,6 +595,10 @@ impl HTMLScriptElement {
|
||||||
is_js
|
is_js
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_parser_inserted(&self, parser_inserted: bool) {
|
||||||
|
self.parser_inserted.set(parser_inserted);
|
||||||
|
}
|
||||||
|
|
||||||
pub fn set_already_started(&self, already_started: bool) {
|
pub fn set_already_started(&self, already_started: bool) {
|
||||||
self.already_started.set(already_started);
|
self.already_started.set(already_started);
|
||||||
}
|
}
|
||||||
|
|
|
@ -903,9 +903,9 @@ impl RangeMethods for Range {
|
||||||
let node = self.StartContainer();
|
let node = self.StartContainer();
|
||||||
let element = match node.type_id() {
|
let element = match node.type_id() {
|
||||||
NodeTypeId::Document(_) | NodeTypeId::DocumentFragment => None,
|
NodeTypeId::Document(_) | NodeTypeId::DocumentFragment => None,
|
||||||
NodeTypeId::Element(_) => Some(node),
|
NodeTypeId::Element(_) => Some(Root::downcast::<Element>(node).unwrap()),
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::Comment) |
|
NodeTypeId::CharacterData(CharacterDataTypeId::Comment) |
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => node.GetParentNode(),
|
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => node.GetParentElement(),
|
||||||
NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) |
|
NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) |
|
||||||
NodeTypeId::DocumentType => unreachable!(),
|
NodeTypeId::DocumentType => unreachable!(),
|
||||||
};
|
};
|
||||||
|
@ -928,6 +928,7 @@ impl RangeMethods for Range {
|
||||||
for node in fragment_node.upcast::<Node>().traverse_preorder() {
|
for node in fragment_node.upcast::<Node>().traverse_preorder() {
|
||||||
if let Some(script) = node.downcast::<HTMLScriptElement>() {
|
if let Some(script) = node.downcast::<HTMLScriptElement>() {
|
||||||
script.set_already_started(false);
|
script.set_already_started(false);
|
||||||
|
script.set_parser_inserted(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
[createContextualFragment.html]
|
[createContextualFragment.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
[<script>s should be run when appended to the document (but not before)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Namespace generally shouldn't matter]
|
[Namespace generally shouldn't matter]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
[cors-redirect-worker.html]
|
[cors-redirect-worker.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
disabled: https://github.com/servo/servo/issues/13441
|
disabled: https://github.com/servo/servo/issues/13441
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
[cors-redirect.html]
|
[cors-redirect.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
disabled: https://github.com/servo/servo/issues/13441
|
disabled: https://github.com/servo/servo/issues/13441
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
[redirect-count-worker.html]
|
[redirect-count-worker.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
disabled: https://github.com/servo/servo/issues/13441
|
disabled: https://github.com/servo/servo/issues/13441
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
[redirect-count.html]
|
[redirect-count.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
disabled: https://github.com/servo/servo/issues/13441
|
disabled: https://github.com/servo/servo/issues/13441
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
[redirect-origin-worker.html]
|
[redirect-origin-worker.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
disabled: https://github.com/servo/servo/issues/13441
|
disabled: https://github.com/servo/servo/issues/13441
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
[redirect-origin.html]
|
[redirect-origin.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
disabled: https://github.com/servo/servo/issues/13441
|
disabled: https://github.com/servo/servo/issues/13441
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
[request-cache-default-conditional.html]
|
[request-cache-default-conditional.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
disabled: https://github.com/servo/servo/issues/13441
|
disabled: https://github.com/servo/servo/issues/13441
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[117.html]
|
|
||||||
type: testharness
|
|
||||||
[scheduler: inline script created with createContextualFragment]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[118.html]
|
|
||||||
type: testharness
|
|
||||||
[scheduler: external script created with createContextualFragment]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -109,6 +109,10 @@ function testEquivalence(element1, fragment1, element2, fragment2) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var doc_fragment = document.createDocumentFragment();
|
||||||
|
var comment = document.createComment("~o~");
|
||||||
|
doc_fragment.appendChild(comment);
|
||||||
|
|
||||||
var tests = [
|
var tests = [
|
||||||
["<html> and <body> must work the same, 1", document.documentElement, "<span>Hello world</span>", document.body, "<span>Hello world</span>"],
|
["<html> and <body> must work the same, 1", document.documentElement, "<span>Hello world</span>", document.body, "<span>Hello world</span>"],
|
||||||
["<html> and <body> must work the same, 2", document.documentElement, "<body><p>Hello world", document.body, "<body><p>Hello world"],
|
["<html> and <body> must work the same, 2", document.documentElement, "<body><p>Hello world", document.body, "<body><p>Hello world"],
|
||||||
|
@ -126,6 +130,9 @@ var tests = [
|
||||||
["undefined should be stringified", document.createElement("span"), undefined, document.createElement("span"), "undefined"],
|
["undefined should be stringified", document.createElement("span"), undefined, document.createElement("span"), "undefined"],
|
||||||
["Text nodes shouldn't be special",
|
["Text nodes shouldn't be special",
|
||||||
document.createTextNode("?"), "<body><p>",
|
document.createTextNode("?"), "<body><p>",
|
||||||
|
document.createElement("div"), "<body><p>"],
|
||||||
|
["Non-Element parent should not be special",
|
||||||
|
comment, "<body><p>",
|
||||||
document.createElement("div"), "<body><p>"]
|
document.createElement("div"), "<body><p>"]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue