Commit graph

1335 commits

Author SHA1 Message Date
MacDue f7bf14605c LibWeb: Remove PaintBorders recording painter command
`Painting::paint_all_borders()` only uses `.draw_line()` for simple
borders and `.fill_path()` for more complex cases. These are both
already supported by the `RecordingPainter` so removing this command
simplifies the painting API.

Two test changes:

css-background-clip-text: Borders are now drawn via the AA painter
(which makes them closer to how they appear in other browsers).

corner-clip-inside-scrollable: Borders removed (does not change test)
due to imperceptible sub-pixel changes.
2024-05-29 08:17:01 +02:00
Tim Ledbetter d6297ec074 LibWeb: Cast to the correct type in Element::auto_directionality()
Previously, we always cast to a HTMLInputElement when getting the value
of an auto directionality form associated element. This caused
undefined behavior when determining the directionality of an element
that wasn't a HTMLInputElement.
2024-05-28 09:51:07 +02:00
Tim Ledbetter 0b0ad5c9db LibWeb: Calculate width property resolved value correctly
This means that relative width values are now correctly resolved when
calling `getComputedStyle()`.
2024-05-28 08:08:31 +02:00
Tim Ledbetter 7d192ed8c1 LibWeb: Don't crash on clicking a label with an associated text input
Previously, we assumed that all label control paintables were of type
`LabelablePaintable`. This caused a crash when clicking on a label with
a text input control.
2024-05-28 08:07:05 +02:00
Shannon Booth 6466fca20a LibWeb: Implement BaseAudioContext.createGain 2024-05-28 08:06:09 +02:00
Kenneth Myhra dacba5e610 Tests/LibWeb: Initialize 'arrayBuffer' to an UInt8Array
This initializes 'arrayBuffer' to an UInt8Array so that we can
manipulate the contents of 'arrayBuffer'. The test verifies that the
internal buffer is an ArrayBuffer.

Also:
* Correct comparison in test so that we compare arrayBuffer to
  arrayClone, not to itself.
* Remove FIXME, this outputs [object ArrayBuffer] in Firefox and Chrome
  too.
2024-05-27 17:37:27 +02:00
Jamie Mansfield 600daea544 LibWeb: Implement HTMLIFrameElement.loading 2024-05-27 17:34:59 +02:00
Jamie Mansfield 9ee061ea14 LibWeb: Implement HTMLImageElement.loading
Removes some console noise while loading mmu.ac.uk :)
2024-05-27 17:34:59 +02:00
Andreas Kling 802af5ad9d LibWeb: Allow Element.insertAdjacentHTML on the document element
This fixes wpt/domparsing/insert_adjacent_html.html
2024-05-27 17:33:29 +02:00
Andreas Kling e7febd347b LibWeb: Don't advertise the empty string as HTMLCollection property name
This fixes wpt/dom/collections/HTMLCollection-empty-name.html
2024-05-27 17:33:29 +02:00
Aliaksandr Kalenik 663cc753a7 LibWeb: Fix clip box calculation in PaintableWithLines
All painting commands except SetClipRect are shifted by scroll offset
before command list execution. This change removes scroll offset
translation for sample/blit corner commands in
`PaintableWithLines::paint` so it is only applied once in
`CommandList::apply_scroll_offsets()`.
2024-05-26 16:11:53 +01:00
MacDue 18d39deefe Tests/LibWeb: Add ref test for clip-path: polygon(...) 2024-05-26 07:55:50 +02:00
Shannon Booth 17ae65cedc LibWeb: Implement AudioBuffer.copyToChannel 2024-05-26 07:48:37 +02:00
Shannon Booth 67b1f4af55 LibWeb: Implement HTMLFormElement.encoding 2024-05-26 07:47:59 +02:00
Shannon Booth aeb815cc66 LibWeb: Implement HTMLFormElement.enctype 2024-05-26 07:47:59 +02:00
Matthew Olsson a8ef84f8c3 LibWeb: Use LengthPercentage for calc values in Transformation matrix 2024-05-25 22:19:47 +02:00
Aliaksandr Kalenik e2b2b2439c LibWeb: Apply corner clip before scroll offset for PaintableWithLines
Fixes bug when corner clip mask moves along with the scrolled text.
2024-05-25 22:19:40 +02:00
Matthew Olsson 15a8baee03 LibWeb: Save time for animationcancel event before transitioning to idle
The if statement in the dispatch implies we are in the idle state, so of
course the active time will always be undefined. If this was cancelled
via a call to cancel(), we can save the time at that point. Otherwise,
just send 0.
2024-05-24 07:25:10 +02:00
Andreas Kling f4636a0cf5 LibWeb: Stop spamming animation events on the wrong event target
This patch fixes two issues:

- Animation events that should go to the target element now do
  (some were previously being dispatched on the animation itself.)
- We update the "previous phase" and "previous iteration" fields of
  animation effects, so that we can actually detect phase changes.
  This means we stop thinking animations always just started,
  something that caused each animation to send 60 animationstart
  events every second (to the wrong target!)
2024-05-23 12:10:06 +02:00
Andrew Kaster bab546472e LibWeb: Mark FontFaceSet as a setlike IDL interface
And implement more of the constructor logic.
2024-05-23 10:57:34 +02:00
Tim Ledbetter d2b3007248 IDLGenerators: Use spec-compliant algorithm to parse integer values 2024-05-23 04:15:46 +02:00
Tim Ledbetter 2a7cf1c588 LibWeb: Implement the width and height attributes where missing
This change adds the `width` and `height` properties to
`HTMLVideoElement` and `HTMLSourceElement`. These properties reflect
their respective content attribute values.
2024-05-21 19:28:43 +02:00
Tim Ledbetter 9f9aa62128 LibWeb: Implement the hspace and vspace attributes
These properties reflect their respective content attributes.
2024-05-21 19:28:43 +02:00
Kenneth Myhra e2c4019bfc LibWeb: Close acquired writer in AO readable_stream_pipe_to()
Also adds a test to prove that the WritableStream's close callback is
called.
2024-05-20 16:57:52 -04:00
Tim Ledbetter a6d6729034 LibWeb: Implement the MouseEvent.relatedTarget attribute
This returns the secondary target of a mouse event. For `onmouseenter`
and `onmouseover` events, this is the EventTarget the mouse exited
from. For `onmouseleave` and `onmouseout` events, this is the
EventTarget the mouse entered to.
2024-05-20 08:21:41 +02:00
Jamie Mansfield 08a3904309 LibWeb/MimeSniff: Implement "minimize a supported MIME type"
See:
- https://github.com/whatwg/mimesniff/commit/227a469
2024-05-19 16:25:50 +02:00
Shannon Booth 3ccbc83168 LibWeb: Add a stubbed slot for DynamicsCompressorNode.reduction
For now, this slot is always 0 - (the default value per spec). But
once we start actually processing audio streams this internal slot
should be changed correspondingly.
2024-05-19 09:26:20 +02:00
Shannon Booth cf615cbd1c LibWeb: Add AudioParams for DynamicsCompressorNode 2024-05-19 09:26:20 +02:00
Shannon Booth ccdf82c9be LibWeb: Implement scrollIntoView with 'center' block position
This fixes a crash on:

https://docs.github.com/en/get-started/learning-about-github/githubs-plans
2024-05-19 07:22:17 +02:00
Shannon Booth dd20156010 LibWeb: Fix division by zero on a zero-height viewport SVG image 2024-05-19 07:19:42 +02:00
Shannon Booth d48316ce15 LibWeb: Fix division by zero on a zero-width viewport SVG image
We were previously crashing by a division by zero due to an aspect ratio
of zero on https://comicbookshop.co.nz/
2024-05-19 07:19:42 +02:00
Tim Ledbetter c36ba450be LibWeb: Generate binding for HTMLObjectElement.contentWindow attribute
This only required adding the appropriate definition to the IDL file,
as `NavigableContainer` already implements the logic that we need.
2024-05-18 18:12:08 +02:00
Tim Ledbetter 2447a25753 LibWeb: Implement the labels attribute for all labelable elements
This returns a `NodeList` of all the labels associated with the given
element.
2024-05-18 18:09:18 +02:00
Tim Ledbetter 3dc86747f0 LibWeb: Implement the HTMLOutputElement.htmlFor attribute
This returns a DOMTokenList that reflects the `for` attribute.
2024-05-18 11:23:20 +02:00
Tim Ledbetter acc1fa3c62 LibWeb: Generate binding for the HTMLObjectElement.form attribute
This only required adding the appropriate definition to the IDL file,
as `FormAssociatedElement` already implements the logic that we need.
2024-05-18 11:04:04 +02:00
Tim Ledbetter 6bf22075ed LibWeb: Implement the HTMLLabelElement.form attribute
This returns the form element associated with the given label element's
control or null if the label has no control.
2024-05-18 11:04:04 +02:00
Tim Ledbetter d0555f3176 LibWeb: Flesh out DOMTokenList::supports() implementation
This change makes `DOMTokenList::supports()` work as expected for
`relList` attributes.
2024-05-16 20:31:23 +02:00
Tim Ledbetter 51fc30a191 LibWeb: Implement the HTMLLinkElement.relList attribute
This returns a DOMTokenList that reflects the `rel` attribute.
2024-05-16 08:06:26 +02:00
Tim Ledbetter fc4e0cf10e LibWeb: Implement the HTMLFormElement.relList attribute
This returns a DOMTokenList that reflects the `rel` attribute.
2024-05-16 08:06:26 +02:00
Tim Ledbetter 0a3e1846f0 LibWeb: Implement the HTMLAreaElement.relList attribute
This returns a DOMTokenList that reflects the `rel` attribute.
2024-05-16 08:06:26 +02:00
Tim Ledbetter b7fd39c2e6 LibWeb: Implement the HTMLAnchorElement.relList attribute
This returns a DOMTokenList that reflects the `rel` attribute.
2024-05-16 08:06:26 +02:00
Tim Ledbetter 763b7f0e0c LibWeb: Implement the HTMLOptionElement.form attribute
This returns the parent form of a HTMLOptionElement or null if the
element has no parent form.
2024-05-16 08:03:13 +02:00
Andrew Kaster 28f728dfdb LibWeb: Implement FontFace.load() for url() based font sources 2024-05-16 08:02:43 +02:00
MacDue 6c9069fa5d LibWeb: Implement the SVG clip-rule attribute
This controls the fill rule used when rasterizing `<clipPath>` elements.
2024-05-14 23:01:18 +01:00
Andrew Kaster 60b3436ea3 LibWeb: Support loading FontFaces constructed with binary data 2024-05-14 12:31:10 -06:00
Shannon Booth 452ffa56dc LibWeb: Implement BaseAudioContext.createDynamicsCompressor 2024-05-14 13:45:43 -04:00
Shannon Booth 27242c6be6 LibWeb: Implement Document.dir
This was seen getting called on stuff.co.nz (before it crashes due to an
unrelated navigation bug)
2024-05-14 13:35:36 -04:00
Shannon Booth 9b6a1de777 LibWeb: Implement URL.parse
This was an addition to the URL spec, see:

https://github.com/whatwg/url/commit/58acb0
2024-05-13 09:21:12 +02:00
Shannon Booth 5a0f7c5f63 LibWeb/Tests: Add a basic test for a blob URL given to a Worker 2024-05-12 15:46:29 -06:00
Shannon Booth 5e7678d1c6 LibWeb: Implement AudioBuffer.copyFromChannel 2024-05-12 19:11:37 +02:00