ladybird/Userland/Libraries/LibWeb/CSS
Andreas Kling 43888b848c LibWeb: Resolve unresolved CSS calc() values in StyleComputer
When mixing calc() and var(), we're forced to delay resolving them until
we're in StyleComputer. Previously we'd just skip over them.

This patch handles calc() in the same pass as attr(). We reparse the
calc() value after var() expansion, and then try to resolve it to a
constant value if possible. If it's not possible, we leave the calc()
where it is, and maybe layout can figure it out later.

Note that I've only implemented resolution to integer and percentage in
this commit. There are more things a calc() could resolve to, and we
should implement those as well.
2022-11-02 22:42:48 +01:00
..
Parser LibWeb: Add CSS::Parser helper for parsing a standalone "calc()" value 2022-11-02 22:42:48 +01:00
SyntaxHighlighter LibWeb: Move Token and Tokenizer into Parser namespace 2022-04-12 23:03:46 +02:00
Angle.cpp LibWeb: Ensure PercentageOr<T>::resolved() returns a concrete T 2022-07-27 17:03:55 +02:00
Angle.h LibWeb: Ensure PercentageOr<T>::resolved() returns a concrete T 2022-07-27 17:03:55 +02:00
BackdropFilter.h LibWeb: Plumb style/computed values for backdrop-filter 2022-09-16 10:50:48 +01:00
Clip.cpp LibWeb: Use rect value in CSS clip property 2022-08-07 22:40:11 +02:00
Clip.h LibWeb: Use rect value in CSS clip property 2022-08-07 22:40:11 +02:00
ComputedValues.h LibWeb: Refactor GridTrackSize classes 2022-11-01 11:19:41 +01:00
CSSConditionRule.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSConditionRule.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSConditionRule.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
CSSFontFaceRule.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSFontFaceRule.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSFontFaceRule.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
CSSGroupingRule.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSGroupingRule.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSGroupingRule.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
CSSImportRule.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSImportRule.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSImportRule.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
CSSMediaRule.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSMediaRule.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSMediaRule.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
CSSRule.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSRule.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSRule.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
CSSRuleList.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSRuleList.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSRuleList.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
CSSStyleDeclaration.cpp LibWeb: Handle currently ignored WebIDL::ExceptionOr<T>s 2022-10-31 14:12:44 +00:00
CSSStyleDeclaration.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSStyleDeclaration.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
CSSStyleRule.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSStyleRule.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSStyleRule.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
CSSStyleSheet.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSStyleSheet.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSStyleSheet.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
CSSSupportsRule.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSSupportsRule.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
CSSSupportsRule.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
Default.css LibWeb: Use the default CSS attributes for embedded content from HTML 2022-10-10 19:33:34 +02:00
Display.cpp LibWeb: Don't crash on unknown CSS display types, fall back to inline 2022-02-13 01:03:49 +01:00
Display.h LibWeb: Tidy up FormattingContext::creates_block_formatting_context() 2022-10-06 17:15:28 +02:00
Enums.json LibWeb: Parse the CSS align-content property 2022-10-14 19:50:15 +02:00
FontFace.cpp LibWeb: Parse @font-face unicode-range descriptor 2022-04-07 21:20:14 +02:00
FontFace.h LibWeb: Understand the format() part of a @font-face's src 2022-04-07 21:20:14 +02:00
Frequency.cpp LibWeb: Ensure PercentageOr<T>::resolved() returns a concrete T 2022-07-27 17:03:55 +02:00
Frequency.h LibWeb: Ensure PercentageOr<T>::resolved() returns a concrete T 2022-07-27 17:03:55 +02:00
GeneralEnclosed.h LibWeb: Implement independent GeneralEnclosed class 2021-11-24 22:57:46 +01:00
GridTrackPlacement.cpp LibWeb: Parse line names in grid track position properties 2022-11-01 11:19:41 +01:00
GridTrackPlacement.h LibWeb: Parse line names in grid track position properties 2022-11-01 11:19:41 +01:00
GridTrackSize.cpp LibWeb: Parse line names in grid track size declarations 2022-11-01 11:19:41 +01:00
GridTrackSize.h LibWeb: Parse line names in grid track size declarations 2022-11-01 11:19:41 +01:00
Identifiers.json LibWeb: Teach CSS::StyleProperties to create CSS::Size values 2022-09-25 17:51:43 +02:00
Length.cpp LibWeb: Resolve cyclic declaration/definitions involving Length 2022-09-15 14:45:38 +01:00
Length.h LibWeb: Resolve cyclic declaration/definitions involving Length 2022-09-15 14:45:38 +01:00
LengthBox.cpp LibWeb: Resolve cyclic declaration/definitions involving Length 2022-09-15 14:45:38 +01:00
LengthBox.h LibWeb: Resolve cyclic declaration/definitions involving Length 2022-09-15 14:45:38 +01:00
LinkStyle.idl LibWeb: Extract the LinkStyle IDL mixin 2022-07-29 17:15:49 +01:00
MediaFeatures.json LibWeb: Add missing MEDIAQUERIES-5 media-features 2022-03-16 22:07:53 +01:00
MediaList.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
MediaList.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
MediaList.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
MediaQuery.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
MediaQuery.h LibWeb: Extract MediaType to/from_string() logic into functions 2022-04-29 00:07:31 +02:00
MediaQueryList.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
MediaQueryList.h LibWeb: Move CallbackType from Bindings/ to WebIDL/ 2022-09-24 19:31:39 +01:00
MediaQueryList.idl LibWeb: Replace ad-hoc EventHandler type with callback function typedef 2022-03-31 01:10:47 +02:00
MediaQueryListEvent.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
MediaQueryListEvent.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
MediaQueryListEvent.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
Number.h LibWeb: Add operator== to CSS::Number 2022-09-16 10:50:48 +01:00
Percentage.cpp LibWeb: Stop handling impossible Percentage return values 2022-07-21 16:36:08 +02:00
Percentage.h LibWeb: Make PercentageOr<T>::contains_percentage() handle more cases 2022-09-29 20:09:44 +02:00
PreferredColorScheme.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
PreferredColorScheme.h LibWeb: Add Web::CSS::PreferredColorScheme enum 2021-10-31 18:39:13 +01:00
Properties.json LibWeb: Establish stacking context when backdrop-filter is not 'none' 2022-10-24 18:05:58 +02:00
QuirksMode.css LibWeb: Flesh out the default "quirks mode" style sheet 2022-09-20 14:48:07 +02:00
Ratio.cpp LibWeb+AudioServer: Remove unused spaceship operators 2022-04-23 10:43:32 -07:00
Ratio.h LibWeb+AudioServer: Remove unused spaceship operators 2022-04-23 10:43:32 -07:00
Resolution.cpp LibWeb: Implement CSS Resolution class 2022-02-24 08:04:25 +01:00
Resolution.h LibWeb: Implement CSS Resolution class 2022-02-24 08:04:25 +01:00
ResolvedCSSStyleDeclaration.cpp LibWeb: Return empty Optional<StyleProperty> for shorthand properties 2022-10-28 16:17:08 +01:00
ResolvedCSSStyleDeclaration.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
Screen.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
Screen.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
Screen.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
Selector.cpp LibWeb: Parse the -webkit-progress-bar/value pseudo elements 2022-07-23 01:45:49 +02:00
Selector.h LibWeb: Cache lowercased names in SimpleSelector 2022-09-15 16:16:56 +02:00
SelectorEngine.cpp LibWeb: Apply :enabled pseudo class to only certain elements 2022-09-30 21:46:53 +02:00
SelectorEngine.h LibWeb: Match styles for pseudo-elements 2022-02-25 19:35:34 +01:00
Serialize.cpp LibWeb: Add partial serialization for CSSFontFaceRule 2022-09-14 10:50:33 +01:00
Serialize.h LibWeb: Add partial serialization for CSSFontFaceRule 2022-09-14 10:50:33 +01:00
Size.cpp LibWeb: Add CSS::Size::to_string() and an AK::Formatter for it 2022-09-29 18:33:41 +02:00
Size.h LibWeb: Add CSS::Size::to_string() and an AK::Formatter for it 2022-09-29 18:33:41 +02:00
StyleComputer.cpp LibWeb: Resolve unresolved CSS calc() values in StyleComputer 2022-11-02 22:42:48 +01:00
StyleComputer.h LibWeb: Do CSS var() expansion in a separate pass 2022-11-02 22:42:48 +01:00
StyleProperties.cpp LibWeb: Don't panic on unsupported text-decoration-line values 2022-11-02 22:42:48 +01:00
StyleProperties.h LibWeb: Refactor GridTrackSize classes 2022-11-01 11:19:41 +01:00
StyleSheet.cpp LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
StyleSheet.h LibWeb: Remove unecessary dependence on Window from CSS classes 2022-10-01 21:05:32 +01:00
StyleSheet.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
StyleSheetList.cpp LibWeb: Don't invalidate style when adding/removing empty style sheet 2022-10-29 15:16:57 +02:00
StyleSheetList.h LibWeb: Remove WRAPPER_HACK() macro 2022-09-21 21:12:24 +01:00
StyleSheetList.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
StyleValue.cpp LibWeb: Paint conic-gradient()s 2022-11-01 23:07:05 +00:00
StyleValue.h LibWeb: Paint conic-gradient()s 2022-11-01 23:07:05 +00:00
Supports.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
Supports.h LibWeb: Implement @supports serialization 2022-05-11 20:16:10 +02:00
Time.cpp LibWeb: Ensure PercentageOr<T>::resolved() returns a concrete T 2022-07-27 17:03:55 +02:00
Time.h LibWeb: Ensure PercentageOr<T>::resolved() returns a concrete T 2022-07-27 17:03:55 +02:00
TransformFunctions.json LibWeb: Support translate3d 2022-11-02 11:04:23 +00:00
UnicodeRange.h LibWeb: Add missing includes 2022-09-18 13:27:24 -04:00