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)
A DataTransferItem is associated with a DataTransfer, and points to an
item in the drag data store. We don't yet support removing items from
the store, but when we do, we will clear the index stored here to set
the DataTransferItem's mode to "disabled".
(cherry picked from commit c82fec0a8cc871aa331de5a557db1adddca7711c)
The IDL constructor has to take separate steps than a DataTransfer that
is internally constructed. Notably, an IDL-created object has its own
drag data store, and that store is placed in a read-write mode.
(cherry picked from commit 5c9287aa99e52886a3d144c26de6a54980a53db6)
Ownership of the drag data store is a bit weird. In a normal drag-and-
drop operation, the DragAndDropEventHandler owns the store. When events
are fired for the operation, the DataTransfer object assigned to those
events are "associated" with the store. We currently represent that with
an Optional<DragDataStore&>.
However, it's also possible to create DataTransfer objects from scripts.
Those objects create their own drag data store. This puts DataTransfer
in a weird situation where it may own a store or just reference one.
Rather than coming up with something like Variant<DDS, DDS&> or using
MaybeOwned<DDS> here, we can get by with just making the store reference
counted.
(cherry picked from commit f7c4165dde9cc1f3c84fbc49c8496dea3a898491)
This is used by Google Lens. It will always return the empty string when
dragging an image onto the Google Lens search field.
(cherry picked from commit 535f03b6cf664071e03b7f3c95116fa89c33122b)
The popover property now reflects the attribute.
It cannot currently use the Reflect IDL concept because the empty string
value is special cased.
(cherry picked from commit a9669639cee27e81640fe7a37d9d1f319db6b666;
amended to undo unintentional -- and conflicting -- change to
Tests/LibWeb/rebaseline-libweb-test)
This factory forced callers to make a list of GC-allocated FileAPI::File
objects. This isn't safe - this opens a window for these files to be
garbage collected before the FileList object stores / visits the list.
Instead, only allow creating an empty FileList and incrementally adding
files to that list.
(cherry picked from commit 8b4d28b5fd7857e3ee47a8d50aa9c01920dcfb4b)