We were mistakenly executing the current node's script instead of the
document's pending parsing-blocking script.
This caused ~1000 WPT tests to time out, since we never ended up firing
a load event for XHTML pages that load multiple external scripts.
(cherry picked from commit 007c292af3202a85eb146b121720d988a66ed64b)
Checking that the string parsed for the `font` property is not enough,
the spec also wants to rule out CSS-wide keywords like `inherit`. The
simplest way to do so is to check if it's a ShorthandStyleValue, which
also rules out use of `var()`; this matches other browsers' behaviour.
The newly-added test would previously crash, and now doesn't. :^)
(cherry picked from commit 64d45afd8a650981d4dbab98aa49d47629568f5b)
Before this change, removing a style element from inside a shadow tree
would cause it to be unregistered with the document-level list of sheets
instead of the shadow-root-level list.
This would eventually lead to a verification failure if someone tried to
update the text contents of that style element, since it was still in
the shadow-root-level list, but now with a null owner element.
Fixes a crash on https://www.swedbank.se/
(cherry picked from commit 3b7534b3628641244b0998fd5061c6fa75a61cf5)
Add fetch group concept from the '2.4. Fetch groups' in
the fetch specs to the environment settings object.
(cherry picked from commit 9e223f6daeb3969d3997084a973b26daff6b4f7e)
This matches the behavior of other browsers. Previously, a click event
was used, so the value was only updated when the mouse was released.
(cherry picked from commit b4b947c60797328d930c8d3de466b8ef292d0ed4)
An input event is now fired when the step up or step down button of an
input element of type number is clicked.
This ensures that any associated <output> element is updated when these
buttons are clicked.
(cherry picked from commit 2a980816e756d727261d53450b4b3f48069d5d50)
Input elements without a defined user-interaction behavior need to fire
an input event when the user changes the element's value in some way.
This change moves the code to do this into its own function and adds
some spec text to explain what is being done.
(cherry picked from commit a3d12e569c88d0dae530657e5bddc18699fb9c9b)
The EntryType has three possible values: Fetching, Failed or
ModuleScript. It is possible that we transition from Fetching to Failed
as in #13.1. Change the assertion to include the failed scenario.
Fixes: https://github.com/LadybirdBrowser/ladybird/issues/661
(cherry picked from commit 319bb6353e0ba64fc5e54b32ddb2b38736cedef9)
Instead of allowing arbitrarily large values (which could eventually
overflow an i32), let's just cap them at the same limit as Firefox does.
Found by Domato.
(cherry picked from commit 4e0edd42b95abf8ad707c64414dbe618313ce89e)
We were incorrectly assuming that setAttribute() could never fail here,
even when passed an invalid name.
Found by Domato.
(cherry picked from commit 093f1dd805f699801079f55d0d490d80b463ccbb)
These were being immediately stored in JS::GCPtrs (and dutifully visited
by HTMLParser), so creating temporary handles for them was a complete
waste of time.
(cherry picked from commit f9f11dc51d50746ccb1a82cd304fe30901edc347)
When appending a single Unicode code point, we don't have to go through
the trouble of creating a Utf32View wrapper over it.
(cherry picked from commit 7892ee355df95f6414ab5334d8d997c2c0356a45)
This fixes wpt/html/webappapis/scripting/events/messageevent-constructor.https.html
(cherry picked from commit ffb3a28684b1b4c028af93aa6d7d9194f002d503)
Previously the input element was displayed with value 0, when no value
was set in the HTML. Now it uses `value_sanitization_algorithm()`, which
will calculate the default value.
In `value_sanitization_algorithm()` there was a logical mistake/typo.
The comment from the spec says "unless the maximum is less than the
minimum".
The added layout test would fail without the code changes.
Fixes#520
(cherry picked from commit 191531b7b18d2edf97dc7bf88a9c19903eeae2d5)
Now that we pass an `old_value` parameter to `attribute_changed` it is
no longer necessary to store the current attribute state in
`HTMLScriptElement`.
(cherry picked from commit aa4e18fca50b261eabd5672a3f1163b4ac7ef50b)
Previously, when `WindowOrWorkerGlobalScope.reportError()` was called
the `filename` property of the dispatched error event was blank. It is
now populated with the full path of the active script.
(cherry picked from commit 34b987366449313c96a73ec1d70e88e60f2c4510)
Previously, setting CSS `line-height: 0` on an `input` element would
result in no text being displayed.
Other browsers handle this by setting the minimum height to the
"normal" value for single line inputs.
(cherry picked from commit 629068c2a7eb02db37ffb4fe8d536306ee71e156)
Previously the entire slider track was colored.
Now only the lower part of the slider track (left side of the thumb) is
colored.
Chrome and Firefox do the same.
(cherry picked from commit 7766909415312b971252f8c7750b0a1873fd5ba0)