Matthew Olsson
e2cb25e35c
LibWeb: Support interpolation of mixed percentage dimension units
2024-06-02 15:12:17 +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
Shannon Booth
97bf9e7953
LibWeb: Stub out Window-Management proposal extensions to Screen API
...
As defined in https://w3c.github.io/window-management
2024-05-27 17:24:51 -06:00
MacDue
517379ff80
LibWeb: Resolve basic-shape
clip-paths
...
These will be ignored within SVGs (for now SVGs only support <clipPath>
elements), but will allow clipping standard HTML elements.
2024-05-26 07:55:50 +02:00
MacDue
0135af6e60
Meta: Add basic-shape
as a CSS property value type
2024-05-26 07:55:50 +02:00
MacDue
120915048c
LibWeb: Parse the polygon()
basic shape function
2024-05-26 07:55:50 +02:00
MacDue
5f17d9b34a
LibWeb: Add BasicShapeStyleValue
to represent CSS basic shapes
...
See: https://www.w3.org/TR/css-shapes-1/#basic-shape-functions
This patch only implements the `polygon()` basic shape (with the rest
left as FIXMEs).
2024-05-26 07:55:50 +02:00
Matthew Olsson
a8ef84f8c3
LibWeb: Use LengthPercentage for calc values in Transformation matrix
2024-05-25 22:19:47 +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
Matthew Olsson
a98ad191c7
Userland: Add ESCAPING annotations to a bunch of places
...
This isn't comprehensive; just a result of a simple grep search.
2024-05-22 21:55:34 -06:00
Tim Ledbetter
68a1a78a1a
LibWeb: Use FIXME extended attribute where possible
2024-05-19 17:35:25 +02:00
Shannon Booth
4fe0cbcf85
LibWeb: Use 'FIXME' extended attribute where possible
...
This improves the debuggability of many live web pages :^)
2024-05-19 16:24:11 +02:00
Andrew Kaster
28f728dfdb
LibWeb: Implement FontFace.load() for url() based font sources
2024-05-16 08:02:43 +02:00
Andrew Kaster
b7526a39b0
LibWeb: Expose StyleComputer's FontLoader class publicly
...
We'll want to explicitly load fonts from FontFace and other Web APIs
in the future. A future refactor should also move this completely away
from StyleComputer and call it something like 'FontCache'.
2024-05-16 08:02:43 +02:00
Andrew Kaster
d76167b8a4
LibWeb: Add CSS ParsingContext constructor with a realm and URL
...
This is useful for when we want to parse paths relative to the current
ESO's api base url when there isn't a document, such as in a Worker
context.
2024-05-16 08:02:43 +02:00
MacDue
99579f1f5e
LibWeb: Use "valid-types" to define fill-rule
in Properties.json
...
No behaviour change.
2024-05-14 23:01:18 +01: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
Andrew Kaster
bd4f516e64
LibWeb: Stub out FontFaceSet.status and .ready attributes
...
WPT wants to check these properties before running ref tests.
This fixes a ton of crashes in our CI WPT runs.
2024-05-13 20:20:39 +00:00
Andrew Kaster
2bc51f08d9
LibWeb: Implement or stub FontFace interface's attribute getters/setters
...
We only support parsing half of these, so the ones we don't recognize
get a friendly exception thrown.
2024-05-11 07:30:29 +01:00
Andrew Kaster
de98c122d1
LibWeb: Move CSS unicode-ranges parsing code into a common helper
2024-05-11 07:30:29 +01:00
Andrew Kaster
e10721f1b5
LibWeb: Add stub implementation of FontFaceSet and Document.fonts
...
This is now enough for duolingo to load and use its fallback fonts.
2024-05-08 10:39:16 +02:00
Andrew Kaster
2c31d7dddc
LibWeb: Add stub implementation of CSS FontFace Web API
2024-05-08 10:39:16 +02:00
Andrew Kaster
3a5eabc43b
LibWeb: Rename CSS::FontFace to CSS::ParsedFontFace
...
This implementation detail of CSSFontFaceRule is hogging the name of a
Web API from CSS Font Loading Module Level 3.
2024-05-08 10:39:16 +02:00
Timothy Flynn
464d7d5858
LibGfx+LibWeb: Allow inexact size lookups when requesting scaled fonts
...
For bitmap fonts, we will often not have an exact match for requested
sizes. Return the closest match instead of a nullptr.
LibWeb is currently the only user of this API. If it needs to be
configurable in the future to only allow exact matches, we can add a
parameter or another method at that time.
2024-05-06 23:26:42 +00:00
Andreas Kling
493a04d5fe
LibJS: Add PropertyLookupPhase enum to distinguish Object [[Get]] calls
...
We can now tell the difference between an own property access and a
subsequent (automatic) prototype chain access.
This will be used to implement caching of prototype chain accesses.
2024-05-04 21:42:59 +02:00
Andreas Kling
3945e1a82a
LibJS: Make JS::Cell a Weakable
...
This makes things easier downstream of Cell, and is preparation for
using weak pointers in prototype chain property caches.
2024-05-04 21:42:59 +02:00
Tim Ledbetter
02a8966b61
LibWeb: Serialize empty media rules with a single newline
...
This deviates from the CSSOM specification but all modern browsers do
this.
2024-05-01 07:21:21 +02:00
Tim Ledbetter
a2cccf9420
LibWeb: Use correct spacing when serializing media features
...
Previously, there was no space between the media feature name and value.
2024-05-01 07:21:21 +02:00
Tim Ledbetter
84193f2746
LibWeb: Align StyleSheet title getter with the specification
...
The CSSOM specification says that StyleSheet.title should return null
if the title field is empty.
2024-04-29 08:10:38 +02:00
Shannon Booth
bad44f8fc9
LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h
...
This was resulting in a whole lot of rebuilding whenever a new IDL
interface was added.
Instead, just directly include the prototype in every C++ file which
needs it. While we only really need a forward declaration in each cpp
file; including the full prototype header (which itself only includes
LibJS/Object.h, which is already transitively brought in by
PlatformObject) - it seems like a small price to pay compared to what
feels like a full rebuild of LibWeb whenever a new IDL file is added.
Given all of these includes are only needed for the ::initialize
method, there is probably a smart way of avoiding this problem
altogether. I've considered both using some macro trickery or generating
these functions somehow instead.
2024-04-27 18:29:35 -04:00
Sam Atkins
59c79e848c
LibWeb: Parse dimension values using TokenStream
2024-04-22 06:47:05 +02:00
Sam Atkins
efce563abd
LibWeb: Parse identifier values using TokenStream
2024-04-22 06:47:05 +02:00
Sam Atkins
e8115d6a56
LibWeb: Parse transform values using the existing comma-parsing code
...
Also add a spec link and grammar comment.
2024-04-22 06:47:05 +02:00
Sam Atkins
e4e048f278
LibWeb: Parse color values using TokenStream
2024-04-22 06:47:05 +02:00
Sam Atkins
710e5c24d3
LibWeb: Parse string values using TokenStream
2024-04-22 06:47:05 +02:00
Sam Atkins
e42f052b00
LibWeb: Parse rect() values using TokenStream
2024-04-22 06:47:05 +02:00
Sam Atkins
e00f41a274
LibWeb: Parse URL values using TokenStream
2024-04-22 06:47:05 +02:00
Sam Atkins
cfa221944c
LibWeb: Parse image values using TokenStream
2024-04-22 06:47:05 +02:00
Sam Atkins
384b18b271
LibWeb: Make parse_color_stop_list() a CSS Parser method
...
This lets us remove the color/dimension-parsing lambdas, since these
always forwarded to the same methods. This will make it easier to later
convert those methods to take a TokenStream.
2024-04-22 06:47:05 +02:00
Andreas Kling
819f2c1df6
LibWeb: Don't redundantly re-sort StyleSheetList on sheet removal
...
The list is already kept sorted. Removing one sheet anywhere from the
list will not make it unsorted.
2024-04-21 19:32:49 +02:00
PGHales
ded344aa2c
LibWeb/DOM: Rename link_color to normal_link_color
2024-04-19 10:58:45 +02:00
Timothy Flynn
bf1c82724f
LibWeb: Default to an empty string when a string attr substitution fails
...
When a string-type attr() substitution produces no value and no fallback
had been specified, the spec mandates we default to the empty string.
2024-04-17 07:13:26 +02:00
Tim Ledbetter
25f8c26624
LibWeb: Flesh out StyleSheetList::add_a_css_style_sheet()
steps
...
This is required to support loading alternative style sheets.
2024-04-17 07:12:44 +02:00
Tim Ledbetter
d5cddd4696
LibWeb: Unset stylesheet properties when removing from a StyleSheetList
...
Previously, the parent CSS stylesheet, owner node and owner CSS rule
properties were not unset when removing a sheet from a StyleSheetList.
This change moves the methods for adding and removing sheets to and
from a StyleSheetList, directly into the StyleSheetList class and
ensures they are called as required by the CSSOM specification.
2024-04-16 07:41:33 +02:00
Andreas Kling
53d0dd4a2e
LibJS+LibWeb: Use new Cell::Visitor helpers to avoid manual iteration
2024-04-16 07:40:01 +02:00
Tim Ledbetter
99b2eff988
LibWeb: Invalidate style when CSSStyleRule selectorText changes
...
Previously, any change to the selectorText of a CSSStyleRule was not
reflected in the document style.
2024-04-15 22:12:49 +02:00
Andreas Kling
037b395b5d
LibWeb: Try to parse WOFF and WOFF2 even if MIME type says otherwise
...
As it turns out, websites can lie about this, and it doesn't really cost
us much to try decoding as other formats before giving up.
2024-04-15 10:01:05 +02:00
Timothy Flynn
4b1abcf61d
LibWeb: Generalize support for dimension attributes
...
Rather than each element which supports dimension attributes needing to
implement parsing the attributes and setting the appropriate style, we
can generalize this functionality. This will also make each element more
closely resemble the spec text, as we will be effectively declaring, for
example, "The img element supports dimension attributes" in code.
2024-04-11 18:41:57 +02:00
Matthew Olsson
31341b280a
LibWeb: Add calls to JS_{DECLARE,DEFINE}_ALLOCATOR()
2024-04-09 09:13:06 +02:00