mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Rewrite NodeChildrenIterator to return Temporary.
This commit is contained in:
parent
bc8ed81dc1
commit
c8106da277
11 changed files with 208 additions and 129 deletions
|
@ -64,12 +64,11 @@ impl<'a> HTMLTableElementMethods for JSRef<'a, HTMLTableElement> {
|
|||
fn GetCaption(self) -> Option<Temporary<HTMLTableCaptionElement>> {
|
||||
let node: JSRef<Node> = NodeCast::from_ref(self);
|
||||
node.children()
|
||||
.filter_map(|n| {
|
||||
let t: Option<JSRef<HTMLTableCaptionElement>> = HTMLTableCaptionElementCast::to_ref(n);
|
||||
t
|
||||
.map(|c| c.root())
|
||||
.filter_map(|c| {
|
||||
HTMLTableCaptionElementCast::to_ref(c.r()).map(Temporary::from_rooted)
|
||||
})
|
||||
.next()
|
||||
.map(Temporary::from_rooted)
|
||||
}
|
||||
|
||||
// http://www.whatwg.org/html/#dom-table-caption
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue