Andreas Kling
ff7b949061
LibWeb: Make HTMLScript private members private once again
...
These were accidentally made public a while ago. Thankfully nobody
started poking into script element internals since then. :^)
2023-03-10 14:59:46 +01:00
Andreas Kling
e8f5085669
LibWeb: Implement Range.createContextualFragment()
2023-03-10 14:58:55 +01:00
Andreas Kling
fb6d6a985f
LibWeb: Implement Element.setAttributeNode{,NS}()
2023-03-10 14:56:29 +01:00
Andreas Kling
8c5c78f1f1
LibWeb: Implement Document.createAttribute{,NS}()
2023-03-10 14:56:03 +01:00
Andreas Kling
109ed27423
LibWeb: Rewrite FFC "resolve flexible lengths" algorithm from draft spec
...
The draft CSS-FLEXBOX-1 spec had a more detailed description of this
algorithm, so let's use that as our basis for the implementation.
Test by Aliaksandr. :^)
2023-03-10 13:38:34 +01:00
Andreas Kling
0ef07383e5
LibWeb: Fix bogus min/max-height for box-sizing:border-box flex items
...
When resolving these constraints to CSS pixel sizes, we have to resolve
padding-top and padding-bottom against the flex container's *width*,
not its height.
2023-03-10 13:38:34 +01:00
Andreas Kling
24d5a9d7df
LibWeb: Fix bogus percentage vertical padding with box-sizing:border-box
...
The padding-top and padding-bottom properties are relative to the
*width* of the containing block, not the height.
It's funny how we keep making this same mistake again and again. :^)
2023-03-10 13:38:34 +01:00
Andreas Kling
07f6ee9e73
LibWeb: Simplify FFC get_pixel_{width,height} internal helper API
...
These took an Optional<CSS::Size> for some reason, but that was not
necessary. Just take a CSS::Size.
2023-03-10 13:15:45 +01:00
Andreas Kling
6b19397452
LibWeb: Avoid unnecessary work for box-sizing: content-box
flex items
2023-03-10 13:15:45 +01:00
Andreas Kling
64bda6de2a
LibWeb: Use equals_ignoring_ascii_case() in infra helper
2023-03-10 13:15:44 +01:00
Andreas Kling
a504ac3e2a
Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_case
...
Let's make it clear that these functions deal with ASCII case only.
2023-03-10 13:15:44 +01:00
Andreas Kling
806d32c88f
LibWeb: Use shadow_root_internal() when building <input> UA shadow DOM
2023-03-09 21:54:59 +01:00
Andreas Kling
e6448f137e
LibWeb: Avoid an unnecessary vector copy when generating flex items
2023-03-09 21:54:59 +01:00
Andreas Kling
8929c7b474
LibWeb: Remove FFC hack where we assign flex item box dimensions twice
...
This was necessary in the past, because IFC would set the height of its
containing block after inline layout.
Now that IFC can properly communicate the automatic size to its parent
formatting context, this hack is no longer necessary.
2023-03-09 21:54:59 +01:00
Andreas Kling
4bfdc4db17
LibWeb: Make CSS rule cache smarter about pseudo elements
...
Instead of putting every rule that matches a pseudo element in the
same bucket, let them go in the best ID/class/tag name bucket instead.
Then, add a flag to MatchingRule that says whether it contains a
pseudo element in the rightmost compound selector.
When deciding which selectors to run for an element, we can now simply
filter in/out pseudo element selectors as appropriate depending on what
we're trying to match.
This fixes an issue where pages using Font Awesome had 1700+ rules in the
pseudo-element rule cache. (This meant all those rules had to run
against every element twice or more while instantiating pseudo elements.)
2023-03-09 21:54:59 +01:00
Andreas Kling
2a607e9ebc
LibWeb: Rename FFC::specified_axis_size() to inner_axis_size()
...
"Specified" means something else in CSS, so let's not use this
overloaded word here. These helpers return the inner main/cross size of
a given box, so let's say "inner" instead.
2023-03-09 21:54:59 +01:00
Andreas Kling
0315ba5e06
LibWeb: Use FlexItem& item
consistenly in FlexFormattingContext
...
There was a pointless mix of `FlexItem*` vs `FlexItem&` as well as
`flex_item` vs `item`. Let's pick one and be consistent.
2023-03-09 21:54:59 +01:00
Andreas Kling
9eb8025463
LibWeb: Always include shadow roots in DOM debug dumps
2023-03-09 21:54:59 +01:00
Linus Groh
e76394d96c
AK: Remove infallible version of StringBuilder::to_byte_buffer
...
Also drop the try_ prefix from the fallible function, as it is no longer
needed to distinguish the two.
2023-03-09 15:51:00 +00:00
Karol Baraniecki
cd4804ed1c
LibWeb: Use fallible version of StringBuilder::to_byte_buffer
2023-03-09 12:59:57 +00:00
Kenneth Myhra
be52e7171a
LibWeb: Add FormDataIterator implementation
...
This adds the FormDataIterator implementation so we can iterate over
FormData.{keys(),values(),entries()}.
2023-03-08 18:57:36 +00:00
Aliaksandr Kalenik
9d03b57c96
LibWeb: Add readiness()
getter in Document
...
This getter returns the same readiness state of document as
`ready_state()` getter that is already present returns but without
allocating string.
2023-03-08 13:08:04 -05:00
Andreas Kling
72569bca1c
LibWeb: Implement the CSS rule cache optimization for UA style as well
...
We were already sorting the author style selectors into buckets.
Now we do it for the built-in UA style as well.
This means less work for the selector engine everywhere :^)
2023-03-08 13:19:15 +01:00
Andreas Kling
2042993997
LibWeb: Convert DOM::Element::m_classes to the new AK::FlyString
...
This makes selector matching significantly faster by not forcing us to
convert from FlyString to DeprecatedFlyString when matching class
selectors. :^)
2023-03-08 13:19:15 +01:00
Kenneth Myhra
b78ee64415
LibWeb: Do not discard String returned from url_encode() to avoid UAF
...
This caused UAF since the string returned from url_encode() was
immediately discarded.
Co-authored-by: Luke Wilde <lukew@serenityos.org>
2023-03-08 09:26:08 +00:00
Linus Groh
d4d49e00a2
LibWeb/Bindings: Remove now unused REPLACEABLE_PROPERTY_SETTER() macro
2023-03-07 23:33:34 +00:00
Linus Groh
351e5ca917
LibWeb/HTML: Port Window.queueMicrotask() to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
129ab02470
LibWeb/HTML: Port Window.structuredClone() to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
a31c561a5a
LibWeb/HTML: Port Window.sessionStorage to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
37e9302dd9
LibWeb/HTML: Port Window.localStorage to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
5cc6b1c4db
LibWeb/HTML: Port Window.fetch() to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
a2fb3a1653
LibWeb/HTML: Port Window.cancelAnimationFrame() to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
211e6c1fbc
LibWeb/HTML: Port Window.requestAnimationFrame() to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
86589f09dc
LibWeb/HTML: Port Window.cancelIdleCallback() to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
b410804f54
LibWeb/HTML: Port Window.requestIdleCallback() to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
606b9ff6f3
LibWeb/HTML: Port Window.getSelection() to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
56550b6ec0
LibWeb/HTML: Port Window.focus() to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
b59505aba5
LibWeb/HTML: Port Window.getComputedStyle() to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
8454eb874f
LibWeb/HTML: Port Window.devicePixelRatio to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
46e547d774
LibWeb/HTML: Port Window.outer{Width,Height} to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
80acf03278
LibWeb/HTML: Port Window.screen{X,Y} / Window.screen{Left,Top} to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
3d075e55f5
LibWeb/HTML: Port Window.scrollBy() to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
2b6d9cca1a
LibWeb/HTML: Port Window.scroll() to IDL
...
...with various changes required due to ScrollBehavior / ScrollOptions
moving from Element.idl to Window.idl.
2023-03-07 23:33:34 +00:00
Linus Groh
40b4ee88de
LibWeb/HTML: Port Window.scroll{X,Y} / Window.page{X,Y}Offset to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
25f53a577d
LibWeb/HTML: Port Window.inner{Width,Height} to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
0c691087ca
LibWeb/HTML: Port Window.screen to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
2beb99b76e
LibWeb/HTML: Port Window.matchMedia() to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
198db2ebd9
LibWeb/HTML: Port Window.crypto to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
7de9179a6d
LibWeb/HTML: Port Window.performance to IDL
2023-03-07 23:33:34 +00:00
Linus Groh
95ce5735ce
LibWeb/HTML: Port Window.event to IDL
2023-03-07 23:33:34 +00:00