mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Reformat
This commit is contained in:
parent
7bb7c9a1e3
commit
4464354e2e
10 changed files with 42 additions and 21 deletions
|
@ -2533,13 +2533,14 @@ impl ElementMethods for Element {
|
|||
let position = position.parse::<AdjacentPosition>()?;
|
||||
|
||||
let context = match position {
|
||||
AdjacentPosition::BeforeBegin | AdjacentPosition::AfterEnd => match self
|
||||
.upcast::<Node>()
|
||||
.GetParentNode()
|
||||
{
|
||||
Some(ref node) if node.is::<Document>() => return Err(Error::NoModificationAllowed),
|
||||
None => return Err(Error::NoModificationAllowed),
|
||||
Some(node) => node,
|
||||
AdjacentPosition::BeforeBegin | AdjacentPosition::AfterEnd => {
|
||||
match self.upcast::<Node>().GetParentNode() {
|
||||
Some(ref node) if node.is::<Document>() => {
|
||||
return Err(Error::NoModificationAllowed)
|
||||
},
|
||||
None => return Err(Error::NoModificationAllowed),
|
||||
Some(node) => node,
|
||||
}
|
||||
},
|
||||
AdjacentPosition::AfterBegin | AdjacentPosition::BeforeEnd => {
|
||||
DomRoot::from_ref(self.upcast::<Node>())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue