mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Reformat
This commit is contained in:
parent
7bb7c9a1e3
commit
4464354e2e
10 changed files with 42 additions and 21 deletions
|
@ -93,7 +93,9 @@ where
|
|||
|
||||
let property = match T::from_jsval(cx, property.handle(), config.clone())? {
|
||||
ConversionResult::Success(property) => property,
|
||||
ConversionResult::Failure(message) => return Ok(ConversionResult::Failure(message)),
|
||||
ConversionResult::Failure(message) => {
|
||||
return Ok(ConversionResult::Failure(message))
|
||||
},
|
||||
};
|
||||
|
||||
// TODO: Is this guaranteed to succeed?
|
||||
|
|
|
@ -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