mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Refine crown annotations for HTML parser. (#32956)
* Refine crown annotations for HTML parser. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Add missing annotation. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
1379cd5779
commit
a5df51ea56
1 changed files with 9 additions and 1 deletions
|
@ -1083,19 +1083,21 @@ impl Sink {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(crown::unrooted_must_root)] // FIXME: really?
|
|
||||||
impl TreeSink for Sink {
|
impl TreeSink for Sink {
|
||||||
type Output = Self;
|
type Output = Self;
|
||||||
|
#[allow(crown::unrooted_must_root)]
|
||||||
fn finish(self) -> Self {
|
fn finish(self) -> Self {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
type Handle = Dom<Node>;
|
type Handle = Dom<Node>;
|
||||||
|
|
||||||
|
#[allow(crown::unrooted_must_root)]
|
||||||
fn get_document(&mut self) -> Dom<Node> {
|
fn get_document(&mut self) -> Dom<Node> {
|
||||||
Dom::from_ref(self.document.upcast())
|
Dom::from_ref(self.document.upcast())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(crown::unrooted_must_root)]
|
||||||
fn get_template_contents(&mut self, target: &Dom<Node>) -> Dom<Node> {
|
fn get_template_contents(&mut self, target: &Dom<Node>) -> Dom<Node> {
|
||||||
let template = target
|
let template = target
|
||||||
.downcast::<HTMLTemplateElement>()
|
.downcast::<HTMLTemplateElement>()
|
||||||
|
@ -1117,6 +1119,7 @@ impl TreeSink for Sink {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(crown::unrooted_must_root)]
|
||||||
fn create_element(
|
fn create_element(
|
||||||
&mut self,
|
&mut self,
|
||||||
name: QualName,
|
name: QualName,
|
||||||
|
@ -1137,11 +1140,13 @@ impl TreeSink for Sink {
|
||||||
Dom::from_ref(element.upcast())
|
Dom::from_ref(element.upcast())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(crown::unrooted_must_root)]
|
||||||
fn create_comment(&mut self, text: StrTendril) -> Dom<Node> {
|
fn create_comment(&mut self, text: StrTendril) -> Dom<Node> {
|
||||||
let comment = Comment::new(DOMString::from(String::from(text)), &self.document, None);
|
let comment = Comment::new(DOMString::from(String::from(text)), &self.document, None);
|
||||||
Dom::from_ref(comment.upcast())
|
Dom::from_ref(comment.upcast())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(crown::unrooted_must_root)]
|
||||||
fn create_pi(&mut self, target: StrTendril, data: StrTendril) -> Dom<Node> {
|
fn create_pi(&mut self, target: StrTendril, data: StrTendril) -> Dom<Node> {
|
||||||
let doc = &*self.document;
|
let doc = &*self.document;
|
||||||
let pi = ProcessingInstruction::new(
|
let pi = ProcessingInstruction::new(
|
||||||
|
@ -1182,6 +1187,7 @@ impl TreeSink for Sink {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(crown::unrooted_must_root)]
|
||||||
fn append_before_sibling(&mut self, sibling: &Dom<Node>, new_node: NodeOrText<Dom<Node>>) {
|
fn append_before_sibling(&mut self, sibling: &Dom<Node>, new_node: NodeOrText<Dom<Node>>) {
|
||||||
let parent = sibling
|
let parent = sibling
|
||||||
.GetParentNode()
|
.GetParentNode()
|
||||||
|
@ -1203,10 +1209,12 @@ impl TreeSink for Sink {
|
||||||
self.document.set_quirks_mode(mode);
|
self.document.set_quirks_mode(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(crown::unrooted_must_root)]
|
||||||
fn append(&mut self, parent: &Dom<Node>, child: NodeOrText<Dom<Node>>) {
|
fn append(&mut self, parent: &Dom<Node>, child: NodeOrText<Dom<Node>>) {
|
||||||
insert(parent, None, child, self.parsing_algorithm);
|
insert(parent, None, child, self.parsing_algorithm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(crown::unrooted_must_root)]
|
||||||
fn append_based_on_parent_node(
|
fn append_based_on_parent_node(
|
||||||
&mut self,
|
&mut self,
|
||||||
elem: &Dom<Node>,
|
elem: &Dom<Node>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue