mirror of
https://github.com/servo/servo.git
synced 2025-07-23 23:33:43 +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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue