mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Implement HTMLStyleElement.disabled attribute (#31682)
https://html.spec.whatwg.org/multipage/#dom-style-disabled
This commit is contained in:
parent
ad37a54f59
commit
bc4f1c217d
10 changed files with 15 additions and 31 deletions
|
@ -276,8 +276,21 @@ impl StylesheetOwner for HTMLStyleElement {
|
|||
}
|
||||
|
||||
impl HTMLStyleElementMethods for HTMLStyleElement {
|
||||
// https://drafts.csswg.org/cssom/#dom-linkstyle-sheet
|
||||
/// <https://drafts.csswg.org/cssom/#dom-linkstyle-sheet>
|
||||
fn GetSheet(&self) -> Option<DomRoot<DOMStyleSheet>> {
|
||||
self.get_cssom_stylesheet().map(DomRoot::upcast)
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-style-disabled>
|
||||
fn Disabled(&self) -> bool {
|
||||
self.get_cssom_stylesheet()
|
||||
.map_or(false, |sheet| sheet.disabled())
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-style-disabled>
|
||||
fn SetDisabled(&self, value: bool) {
|
||||
if let Some(sheet) = self.get_cssom_stylesheet() {
|
||||
sheet.set_disabled(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
interface HTMLStyleElement : HTMLElement {
|
||||
[HTMLConstructor] constructor();
|
||||
|
||||
attribute boolean disabled;
|
||||
// [CEReactions]
|
||||
// attribute DOMString media;
|
||||
// [CEReactions]
|
||||
|
|
|
@ -11,6 +11,3 @@
|
|||
|
||||
[StyleSheet_property_values]
|
||||
expected: FAIL
|
||||
|
||||
[disabled attribute getter/setter]
|
||||
expected: FAIL
|
||||
|
|
|
@ -4863,15 +4863,9 @@
|
|||
[HTMLLinkElement interface: document.createElement("link") must inherit property "blocking" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLStyleElement interface: attribute disabled]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLStyleElement interface: attribute blocking]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLStyleElement interface: document.createElement("style") must inherit property "disabled" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLStyleElement interface: document.createElement("style") must inherit property "blocking" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[style_disabled.html]
|
||||
type: testharness
|
||||
[The style is not applied when it is disabled]
|
||||
expected: FAIL
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
[table-anonymous-objects-015.xht]
|
||||
expected: FAIL
|
|
@ -1,2 +0,0 @@
|
|||
[table-anonymous-objects-016.xht]
|
||||
expected: FAIL
|
|
@ -10,6 +10,3 @@
|
|||
|
||||
[StyleSheet_property_values]
|
||||
expected: FAIL
|
||||
|
||||
[disabled attribute getter/setter]
|
||||
expected: FAIL
|
||||
|
|
|
@ -4581,15 +4581,9 @@
|
|||
[HTMLLinkElement interface: document.createElement("link") must inherit property "blocking" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLStyleElement interface: attribute disabled]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLStyleElement interface: attribute blocking]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLStyleElement interface: document.createElement("style") must inherit property "disabled" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLStyleElement interface: document.createElement("style") must inherit property "blocking" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[style_disabled.html]
|
||||
[The style is not applied when it is disabled]
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue