mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Partial ShadowRoot implementation of DocumentOrShadowRoot
This commit is contained in:
parent
18ae0fcbd6
commit
4304ee28dc
9 changed files with 161 additions and 54 deletions
|
@ -764,8 +764,11 @@ impl RangeMethods for Range {
|
|||
|
||||
// Step 11
|
||||
let new_offset = new_offset +
|
||||
if node.type_id() == NodeTypeId::DocumentFragment(DocumentFragmentTypeId::DocumentFragment) ||
|
||||
node.type_id() == NodeTypeId::DocumentFragment(DocumentFragmentTypeId::ShadowRoot) {
|
||||
if node.type_id() ==
|
||||
NodeTypeId::DocumentFragment(DocumentFragmentTypeId::DocumentFragment) ||
|
||||
node.type_id() ==
|
||||
NodeTypeId::DocumentFragment(DocumentFragmentTypeId::ShadowRoot)
|
||||
{
|
||||
node.len()
|
||||
} else {
|
||||
1
|
||||
|
@ -880,7 +883,9 @@ impl RangeMethods for Range {
|
|||
|
||||
// Step 2.
|
||||
match new_parent.type_id() {
|
||||
NodeTypeId::Document(_) | NodeTypeId::DocumentType | NodeTypeId::DocumentFragment(_) => {
|
||||
NodeTypeId::Document(_) |
|
||||
NodeTypeId::DocumentType |
|
||||
NodeTypeId::DocumentFragment(_) => {
|
||||
return Err(Error::InvalidNodeType);
|
||||
},
|
||||
_ => (),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue