This appears to have been a bug in the spec which was later corrected -
so to fix the crash we can simply remove this assertion.
Fixes: #868
(cherry picked from commit 07940a89cad5ecfa21c2d1d8e055941bdb097ef9)
This implements the `preload` reflected attribute. No actual preloading
is going on yet.
(cherry picked from commit fe933b2057eee8eb65d6e43a97b934bbe85d03bb)
`BrowsingContext::m_parent` has been removed from the spec,
and previously `m_parent` was always null.
`BrowsingContext::is_top_level` was already always returning
true before because of that, and the updated spec algorithm
causes assertions to fail.
This fixes the following example:
```html
<a href="about:blank" target="test">a
<iframe name="test">
```
clicking the link twice no longer causes it to open in a new tab.
(cherry picked from commit e6a668ad913f0755840954c188c255fc5fc66606)
None of HTML event loop processing steps are relevant for decoded SVGs,
so we can simply skip them while collecting documents for processing.
(cherry picked from commit c87214d79cf834ee9b7b4da65e902e5233c0a5cc)
Previously, 0 was returned if `HTMLProgressElement.max` was set to a
negative value.
(cherry picked from commit 353e3e75dcff05f05a65cfc3c70d1cff8db5d50c)
We completely missed this step, which made setters not actually do
anything!
Fixes 336 test failures on:
https://wpt.live/url/url-setters-a-area.window.html
(cherry picked from commit deff8df2c79af718f08f16bc47f5a22ac6add553)
`m_needs_repaint = true` is not enough because it doesn't schedule
repaint of a parent navigable.
Fixes the bug when an iframe is not repainted after scrolling.
(cherry picked from commit 40742d95e66c98857fa43ea1c6632dbe75ecb3b3)
This also changes fetch to use the preferred languages for the
Accept-Language header.
(cherry picked from commit 2ca8fd1832462c05fdec16a1de73494820597140)
If a key is pressed when the media player is in focus, which causes the
media player to perform some action, that key event is no longer
propagated further.
(cherry picked from commit 63231fd2763e3db094be926f599486122265243f)
This will log a debug message when calls are made to the
NavigatorIDMixin that make decisions based on the compatibility mode.
(cherry picked from commit 1128375dff8a2b8183f33e6cee59adf6b2c84210)
Calling `.setSelectionRange()` or `.select()` now updates the document
selection as well, visualizing the text selection.
(cherry picked from commit 732e3fa82f216a6f4114eb0e6bb89e167e95ab42)
For both types of elements, `.selectionStart`, `.selectionEnd`,
`.selectionDirection`, `.setSelectionRange()`, `.select()` and the
`select` event are now implemented.
(cherry picked from commit 814ca3267ed73d7ad8492ef69ff87f95240cf922)
The spec indicates we should append attributes to the top element of the
stack of open elements. We were appending the attribute to the bottom.
(cherry picked from commit 657bbd1542ce8fcd3357e5b4dada895229faf834)
In the HTML parser spec, there are 2 instances of the following text:
add the attribute and its corresponding value to that element
The "add the attribute" text does not have a corresponding spec link to
actually specify what to do. We currently use `set_attribute`, which can
throw an exception if the attribute name contains an invalid character
(such as '<'). Instead, switch to `append_attribute`, which allows such
attribute names. This behavior matches Firefox.
Note we cannot yet make the unclosed-html-element.html test match the
expectations of the unclosed-body-element.html due to another bug that
would prevent checking if the expected element has the right attribute.
That will be fixed in an upcoming commit.
(cherry picked from commit 9fe35ddddf895b0835a347eab7b45b33d1638ce7)
I believe this is slightly less confusing, since what the function does
is trigger a full layout tree *rebuild*, not just a relayout.
(cherry picked from commit aa8f17aea4d1aa1950a66969fc8b5c431fbc1b7c)
Previously, we were searching for other radio buttons from the document
root, rather than the element root.
(cherry picked from commit 67981af276cf55d69d51a872ec83e5b59d793b6c)
When the user clicks on a text node, the event handler sets the cursor
position to the location that was clicked. But it would then be set back
to 0 in the DOM node's focus handler. Leave the cursor alone, unless the
the DOM node was never set as the cursor position node (which will occur
when the user clicks on the DOM node, but outside the shadow text node).
In that case, move the cursor to the end of the text node.
The end result here is that the cursor is placed where the user clicked,
or set to the end of node if the user clicked outside of the shadow text
node.
(cherry picked from commit fc37c4ad40beba249a7ea5452f11014d43da68f6)
Per css-ui-4, setting `appearance: none` is supposed to suppress the
creation of a native-looking widget for stuff like checkboxes, radio
buttons, etc.
This patch implements this behavior by simply falling back to creating
a layout node based on the CSS `display` property in such cases.
This fixes an issue on the hey.com imbox page where we were rendering
checkboxes on top of sender profile photos.
(cherry picked from commit 58c523ae46af90ab17d6b98966d97fa776ae2bf4)
In particular, there was an assertion failure due to the temporary
parser document's "about base URL" being empty when trying to "parse a
URL" during parsing.
We fix this by copying the context element's document's about base URL
to the temporary parsing document while parsing a fragment.
This fixes a crash when loading search results on https://amazon.com/
(cherry picked from commit b64df59cc61f31b8a0aab91abb4630b3ecb1dcee)
The spec requires that "multipart/form-data" Content-Type headers also
include a boundary directive. This allows the content server to validate
the submitted form data.
Google Lens, for example, rejects forms missing this directive.
(cherry picked from commit b16b9709b99c51d288d1e514c3c0012c79ea16d2)
When scripts receive a DataTransferItem from any IDL method, the spec
requires we return the same DataTransferItem for a particular item in
the drag data store. Meaning, we cannot just create these on the fly as
needed.
To do this, we store a list of DataTransferItem on the DataTransfer
object. We will return one of these objects any time one is requested by
a script.
It feels a bit weird to have the DataTransfer object store: the drag
data store, a DataTransferItemList, and a list of DataTransferItem. But
this is how other engines implement this as well. It basically has to be
this way as DataTransferItemList is just a proxy to the DataTransfer -
meaning, DataTransfer is the source of truth for all IDL access.
(cherry picked from commit b3bfd02e64b4e5a0754c157b18dd42427c931923)