Seems to be a 38% layout win on a site I tested with a lot of text.
Other browser engines typically do not duplicate the information in the font style struct. `FontStyle` actually predates @SimonSapin's CSS selector matching library. It's time to get rid of it!
r? @glennw
r? @Ms2ger, @jdm
The parser is now a JS-managed object and we use hooks in html5ever to trace its internal state. This should be memory-safe even if arbitrary JavaScript can run during a parse. Please let me know if you think of a reason it wouldn't be!
I think the likely outcome of a garbage collection during parsing is a dynamic `RefCell` borrow failure, but I'm going to look into that after this lands. It should be safe to trace the parser while it's mutably borrowed, as long as it's not shared between threads, so we can probably switch to `UnsafeCell`.
The hubbub bindings set document.characterSet but we don't use it for anything.
html5ever doesn't parse charsets from <meta> tags yet, and I'd rather add that
as part of adding actual support for other encodings (which Servo never had
with hubbub).
Switching to html5ever also changes attribute parsing slightly (bringing it in
line with the current spec) and this breaks some of the <img srcset> tests. We
don't support this feature at all.
Some other things change due to bugs in hubbub not present in html5ever.
`Node.unsafe_get_flags()` returns `*const NodeFlags`, but `NodeFlags` has only `u8` length.
So We should just returns a raw value instead of any pointers.
This fixes#3248.
r? @jdm. Please review for mistakes mercilessly! Also, I got a host of test failures when running the worker tests, not sure if these tests are expected to pass locally or not.
This implements fragment merging, in order to incrementally reflow linebroken
text. This makes the `whitespace_pre.html` reftest pass with incremental reflow
turned on with `-i`.
`Node.unsafe_get_flags()` returns `*const NodeFlags`,
but `NodeFlags` has only `u8` length.
We should just returns a raw value instead of any pointers.
This implements fragment merging, in order to incrementally reflow linebroken
text. This makes the `whitespace_pre.html` reftest pass with incremental reflow
turned on with `-i`.
This type simply wraps `RefCell<T>` to add the special method,
and introduce the method to return the pointer of the value contained in
itself, for used in layout task.