mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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
This commit is contained in:
parent
d08c4fff15
commit
1b2464b4b6
13 changed files with 89 additions and 24 deletions
|
@ -93,12 +93,15 @@ impl HTMLSelectElement {
|
|||
prefix: Option<Prefix>,
|
||||
document: &Document,
|
||||
) -> DomRoot<HTMLSelectElement> {
|
||||
Node::reflect_node(
|
||||
let n = Node::reflect_node(
|
||||
Box::new(HTMLSelectElement::new_inherited(
|
||||
local_name, prefix, document,
|
||||
)),
|
||||
document,
|
||||
)
|
||||
);
|
||||
|
||||
n.upcast::<Node>().set_weird_parser_insertion_mode();
|
||||
n
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#concept-select-option-list
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue