mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibWeb: Implement @supports
rule :^)
The main thing missing is that we don't serialize the supports clause, but for actually using a `@supports (something: cool) {}` rule in CSS, it works!
This commit is contained in:
parent
439d978ea5
commit
57a25139a5
Notes:
sideshowbarker
2024-07-18 02:54:56 +09:00
Author: https://github.com/AtkinsSJ
Commit: 57a25139a5
Pull-request: https://github.com/SerenityOS/serenity/pull/10400
Reviewed-by: https://github.com/Lubrsi
9 changed files with 129 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <LibWeb/CSS/CSSImportRule.h>
|
||||
#include <LibWeb/CSS/CSSMediaRule.h>
|
||||
#include <LibWeb/CSS/CSSRuleList.h>
|
||||
#include <LibWeb/CSS/CSSSupportsRule.h>
|
||||
#include <LibWeb/DOM/ExceptionOr.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
@ -93,6 +94,9 @@ void CSSRuleList::for_each_effective_style_rule(Function<void(CSSStyleRule const
|
|||
case CSSRule::Type::Media:
|
||||
verify_cast<CSSMediaRule>(rule).for_each_effective_style_rule(callback);
|
||||
break;
|
||||
case CSSRule::Type::Supports:
|
||||
verify_cast<CSSSupportsRule>(rule).for_each_effective_style_rule(callback);
|
||||
break;
|
||||
case CSSRule::Type::__Count:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
@ -114,6 +118,8 @@ bool CSSRuleList::for_first_not_loaded_import_rule(Function<void(CSSImportRule&)
|
|||
}
|
||||
} else if (rule.type() == CSSRule::Type::Media) {
|
||||
return verify_cast<CSSMediaRule>(rule).for_first_not_loaded_import_rule(callback);
|
||||
} else if (rule.type() == CSSRule::Type::Supports) {
|
||||
return verify_cast<CSSSupportsRule>(rule).for_first_not_loaded_import_rule(callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue