To check whether a NavigationParams is null, we have to check whether
it's `Empty` or `NullWithError`. Instead, we can merge both of these
possible variants into an optional error. If `NullOrError` has no
value it's null, otherwise it contains an error message.
If `HTMLMarqueeElemnt.scrollAmount` or `HTMLMarqueeElemnt.scrollDelay`
is set to a value larger than 2147483647, then it should be set to its
default value.
According to the HTML specification, the `size` attribute of an input
element must be a valid non-negative integer greater than zero. If the
value is invalid or set to `0`, the default size of `20` should be used.
This small change fixes one issue identified in
https://wpt.live/html/rendering/widgets/input-text-size.html
The WPT test suite was also automatically imported.
Before this change, skipping a word to the left in a non empty text
input element would crash when near the end of the text as the
offset + length of the substring would exceed the length of the string.
This was removed from the ShadowRealm HTML spec integration PR after my
suggestion as it is not used anywhere, and I don't believe it would ever
need to be used in the future or by other specs.
An environment settings object will return a copy to the URL. From a
quick glance, we could probably make an environment settings object
return a reference to one, but let's just change this code to make
a copy since its not safe to rely on that.
Instead of collecting all documents in a big vector and then filtering
the vector (twice!) with remove_all_matching(), we now pass a filter
callback to documents_in_this_event_loop_matching() and avoid all the
extra shuffling work.
Saw this stuff hogging ~20% of CPU time when profiling a WebContent
process in the middle of a WPT run.
In particular, input character lookahead now knows how to stop at the
insertion point marker if needed.
This makes it possible to do amazing things like having document.write()
insert doctypes one character at a time.
This is necessary to avoid a circular reference when including
Serializable.h in DOMException.h.
This moves the definition of SerializationRecord, SerializationMemory,
and DeserializationMemory into LibWeb/Forward.h so that Serializable.h
only needs to include LibWeb/Forward.h.
If we reach the insertion point at the same time as we switch to another
tokenizer state, we have to bail immediately without proceeding with the
next code point. Otherwise we'd fetch the next token, get an EOF marker,
and then proceed as if we're at the end of the input stream, even though
more data may be coming (with more calls to document.write()..)
The repository being in static storage is a bit of a hodgepodge, but in
line with how our current storage partitioning is done. We should
eventually move this, along with other across browsing context APIs to a
proper location at a later stage. But for now, this makes progress on
the meat of the BroadcastChannel API.
This one is particularly weird as there's a priority order, and we even
have to look at attributes from the container element if we're inside a
subframe.
This is an ad-hoc hack papering over the fact that we can apparently
end up in these places without an active window, and proceeding without
one leads to assertions on WPT.