Skip to content

Commit

Permalink
script: Add pre element obsolete width attribute support
Browse files Browse the repository at this point in the history
  • Loading branch information
bplaat committed Mar 20, 2024
1 parent 02a0cdd commit f3e20b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 9 additions & 0 deletions components/script/dom/htmlpreelement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use dom_struct::dom_struct;
use html5ever::{LocalName, Prefix};
use js::rust::HandleObject;

use crate::dom::bindings::codegen::Bindings::HTMLPreElementBinding::HTMLPreElementMethods;
use crate::dom::bindings::root::DomRoot;
use crate::dom::document::Document;
use crate::dom::htmlelement::HTMLElement;
Expand Down Expand Up @@ -41,3 +42,11 @@ impl HTMLPreElement {
)
}
}

impl HTMLPreElementMethods for HTMLPreElement {
// https://html.spec.whatwg.org/multipage/#dom-pre-width
make_int_getter!(Width, "width", 0);

// https://html.spec.whatwg.org/multipage/#dom-pre-width
make_int_setter!(SetWidth, "width", 0);
}
3 changes: 1 addition & 2 deletions components/script/dom/webidls/HTMLPreElement.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ interface HTMLPreElement : HTMLElement {

// https://html.spec.whatwg.org/multipage/#HTMLPreElement-partial
partial interface HTMLPreElement {
// [CEReactions]
// attribute long width;
[CEReactions] attribute long width;
};

0 comments on commit f3e20b0

Please sign in to comment.