diff options
author | bors-servo <servo-ops@mozilla.com> | 2020-05-04 12:43:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 12:43:49 -0400 |
commit | 271ff16028a8aa3ab5fa6acf0590ddfbb0624eb8 (patch) | |
tree | 2c1b9fadfa7057f27bc6d1ba0ce7b883a66f4f2e /components/script/dom/htmltableelement.rs | |
parent | d33a784c665ec7233b8825bb87d9edc97df33d0b (diff) | |
parent | 1b2464b4b686019211248ea7f4b51aa360b808b2 (diff) | |
download | servo-271ff16028a8aa3ab5fa6acf0590ddfbb0624eb8.tar.gz servo-271ff16028a8aa3ab5fa6acf0590ddfbb0624eb8.zip |
Auto merge of #26398 - Eijebong:fast-path-set-inner-html, r=jdm
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/htmltableelement.rs')
-rw-r--r-- | components/script/dom/htmltableelement.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs index f42e72b5247..2fa44f3ad37 100644 --- a/components/script/dom/htmltableelement.rs +++ b/components/script/dom/htmltableelement.rs @@ -70,12 +70,15 @@ impl HTMLTableElement { prefix: Option<Prefix>, document: &Document, ) -> DomRoot<HTMLTableElement> { - Node::reflect_node( + let n = Node::reflect_node( Box::new(HTMLTableElement::new_inherited( local_name, prefix, document, )), document, - ) + ); + + n.upcast::<Node>().set_weird_parser_insertion_mode(); + n } pub fn get_border(&self) -> Option<u32> { |