diff options
author | Bastien Orivel <eijebong@bananium.fr> | 2020-05-03 15:12:58 +0200 |
---|---|---|
committer | Bastien Orivel <eijebong@bananium.fr> | 2020-05-04 18:11:49 +0200 |
commit | 1b2464b4b686019211248ea7f4b51aa360b808b2 (patch) | |
tree | a2d122044fa7b07951a8213aa4aa2107c695a7f2 /components/script/dom/htmltablerowelement.rs | |
parent | d08c4fff15cb5f6a8840621e848c9de22fcc3439 (diff) | |
download | servo-1b2464b4b686019211248ea7f4b51aa360b808b2.tar.gz servo-1b2464b4b686019211248ea7f4b51aa360b808b2.zip |
Add a fast path in Element::SetInnerHTML when the value is small and trivial text
Inspired from gecko which has a similar fast path. This makes innerHTML
more than 10 times faster for this case.
Fixes #25892
Diffstat (limited to 'components/script/dom/htmltablerowelement.rs')
-rw-r--r-- | components/script/dom/htmltablerowelement.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/components/script/dom/htmltablerowelement.rs b/components/script/dom/htmltablerowelement.rs index 1bece55857b..5da05be4019 100644 --- a/components/script/dom/htmltablerowelement.rs +++ b/components/script/dom/htmltablerowelement.rs @@ -57,12 +57,15 @@ impl HTMLTableRowElement { prefix: Option<Prefix>, document: &Document, ) -> DomRoot<HTMLTableRowElement> { - Node::reflect_node( + let n = Node::reflect_node( Box::new(HTMLTableRowElement::new_inherited( local_name, prefix, document, )), document, - ) + ); + + n.upcast::<Node>().set_weird_parser_insertion_mode(); + n } /// Determine the index for this `HTMLTableRowElement` within the given |