Sam Atkins
62a8cf2bb8
LibWeb: Let CSS::Size contain a CalculatedStyleValue
...
Technically this was already true, but now we explicitly allow it
instead of that calc value being hidden inside a Length or Percentage.
2023-03-30 21:29:50 +02:00
Sam Atkins
ac4350748e
LibWeb: Remove CalculatedStyleValue from Time
...
Time also isn't used anywhere yet, hooray!
2023-03-30 21:29:50 +02:00
Sam Atkins
bf915fdfd7
LibWeb: Remove CalculatedStyleValue from Frequency
...
Conveniently, we don't actually use Frequency for any properties.
2023-03-30 21:29:50 +02:00
Sam Atkins
7a1a97f153
LibWeb: Remove CalculatedStyleValue from Angle
...
...and replace it with AngleOrCalculated.
This has the nice bonus effect of actually handling `calc()` for angles
in a transform function. :^) (Previously we just would have asserted.)
2023-03-30 21:29:50 +02:00
Sam Atkins
fa90a3bb4f
LibWeb: Introduce CalculatedOr type
...
This is intended as a replacement for Length and friends each holding a
`RefPtr<CalculatedStyleValue>`. Instead, let's make the types explicit
about whether they are calculated or not. This then means a Length is
always a Length, and won't require including `StyleValue.h`.
As noted, it's probably nicer for LengthOrCalculated to live in
`Length.h`, but we can't do that until Length stops including
`StyleValue.h`.
2023-03-30 21:29:50 +02:00
Andreas Kling
45f8542965
LibWeb: Actually visit rules and media queries in imported style sheets
...
Due to CSSImportRule::has_import_result() being backwards, we never
actually entered imported style sheets when traversing style rules or
media queries.
With this fixed, we no longer need the "collect style sheets" step in
StyleComputer, as normal for_each_effective_style_rule() will now
actually find all the rules. :^)
2023-03-30 16:54:15 +02:00
Andreas Kling
1f166b3a15
LibWeb: Don't re-sort StyleSheetList on every new sheet insertion
...
This was causing a huge slowdown when loading some pages with weirdly
huge number of style sheets. For example, amazon.com has over 200 style
elements, which meant we had to resort the StyleSheetList 200 times.
(And sorting itself was slow because it has to compare DOM positions.)
Instead of sorting, we now look for the correct insertion point when
adding new style sheets, and we start the search from the end, which is
where style sheets are typically added in the vast majority of cases.
This removes a 600ms time sink when loading Amazon on my machine! :^)
2023-03-30 14:12:07 +02:00
Luke Wilde
14fb6372c3
LibWeb: Parse Element.style url functions relative to the document
...
Previously we used a parsing context with no access to the document, so
any URLs in url() functions would become invalid.
Fixes the images on Steam's store carousel, which sets
Element.style.backgroundImage to url() functions.
2023-03-29 07:10:53 +02:00
Andrew Kaster
4a70fa052f
LibWeb: Declare defaulted style value comparision operators inline
...
Some versions of clang, such as Apple clang-1400.0.29.202 error out on
the previous out of line operators. Explicitly defaulting comparison
operators out of line is allowed per P2085R0, but was checked in clang
before version 15 in C++20 mode.
2023-03-28 09:18:50 +01:00
Sam Atkins
ba30f298f9
LibWeb: Stop returning the left padding for resolved padding-bottom
...
I accidentally broke this 8 months ago and nobody noticed. 😅
2023-03-27 14:27:09 +01:00
Sam Atkins
7d08d5ad6f
LibWeb: Remove now-unused includes from StyleValue.cpp
...
And add them to all the places that relied on getting them transitively.
2023-03-25 16:56:04 +00:00
Sam Atkins
4c54c5d3dd
LibWeb: Split StyleValueList out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
3a2de67c7b
LibWeb: Split RectStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
4bf59c59bb
LibWeb: Split UnsetStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
1d948f7462
LibWeb: Split UnresolvedStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
87b7efa109
LibWeb: Split TimeStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
cd06b1341b
LibWeb: Split TransformationStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
66cb7edffb
LibWeb: Split TextDecorationStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
9b834058ee
LibWeb: Split StringStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
08fa513887
LibWeb: Split ShadowStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
6cedf5e05b
LibWeb: Split ResolutionStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
b1ccd30b02
LibWeb: Split PositionStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
4b711932cc
LibWeb: Split PercentageStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
f98634586e
LibWeb: Split OverflowStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
7f6add1c6e
LibWeb: Split NumericStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
fba2dacc7a
LibWeb: Split ListStyleStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
9a84151169
LibWeb: Split LengthStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
1591352531
LibWeb: Split InitialStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
44c9a5b648
LibWeb: Split InheritStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
e61a5ad180
LibWeb: Split AbstractImageStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
0f04fa2e6e
LibWeb: Split RadialGradientStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
c8ffd82cb7
LibWeb: Split LinearGradientStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
f30b042890
LibWeb: Split ConicGradientStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
35b240c87d
LibWeb: Split ImageStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
76de017a51
LibWeb: Split IdentifierStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
d39788556a
LibWeb: Split GridTrackSizeStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
486ef3df7f
LibWeb: Split GridTrackPlacementStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
402845fe00
LibWeb: Split GridTrackPlacementShorthandStyleValue out of StyleValue
2023-03-25 16:56:04 +00:00
Sam Atkins
675cb3b9da
LibWeb: Split GridAreaShorthandStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
4dc99e49a1
LibWeb: Split GridTemplateAreaStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
015885f068
LibWeb: Split FrequencyStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
87f920a299
LibWeb: Split FontStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
e24679f870
LibWeb: Split FlexFlowStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
273b9b4ca1
LibWeb: Split FlexStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
89ed8e59f9
LibWeb: Split FilterValueListStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
9436b7de83
LibWeb: Split ContentStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
77b2826402
LibWeb: Split ColorStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
66bc816284
LibWeb: Split BorderRadiusStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
25114c159d
LibWeb: Split BorderRadiusShorthandStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00
Sam Atkins
1c03bc7a6f
LibWeb: Split BorderStyleValue out of StyleValue.{h,cpp}
2023-03-25 16:56:04 +00:00