mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
script: Implement CSSStyleSheet constructor (#36521)
https://drafts.csswg.org/cssom/#dom-cssstylesheet-cssstylesheet Testing: covered by WPT This is part of #36162 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
372fd04b23
commit
10f6f50c61
11 changed files with 127 additions and 38 deletions
|
@ -125,6 +125,11 @@ impl CSSRuleList {
|
|||
let loader = owner
|
||||
.as_ref()
|
||||
.map(|element| StylesheetLoader::for_element(element));
|
||||
let allow_import_rules = if self.parent_stylesheet.is_constructed() {
|
||||
AllowImportRules::No
|
||||
} else {
|
||||
AllowImportRules::Yes
|
||||
};
|
||||
let new_rule = css_rules
|
||||
.insert_rule(
|
||||
&parent_stylesheet.shared_lock,
|
||||
|
@ -134,7 +139,7 @@ impl CSSRuleList {
|
|||
containing_rule_types,
|
||||
parse_relative_rule_type,
|
||||
loader.as_ref().map(|l| l as &dyn StyleStylesheetLoader),
|
||||
AllowImportRules::Yes,
|
||||
allow_import_rules,
|
||||
)
|
||||
.map_err(Convert::convert)?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue