mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement 'background' IDL attribute on <body>
This commit is contained in:
parent
c0835ec336
commit
9a1fd472ab
4 changed files with 12 additions and 136 deletions
|
@ -84,6 +84,17 @@ impl HTMLBodyElementMethods for HTMLBodyElement {
|
|||
fn SetOnstorage(&self, listener: Option<Rc<EventHandlerNonNull>>) {
|
||||
window_from_node(self).SetOnstorage(listener)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-body-background
|
||||
make_getter!(Background, "background");
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-body-background
|
||||
fn SetBackground(&self, value: DOMString) {
|
||||
let document = document_from_node(self);
|
||||
let base = document.url();
|
||||
*self.background.borrow_mut() = base.join(&value).ok();
|
||||
self.upcast::<Element>().set_string_attribute(&atom!("background"), value);
|
||||
}
|
||||
}
|
||||
|
||||
pub trait HTMLBodyElementLayoutHelpers {
|
||||
|
|
|
@ -23,5 +23,5 @@ partial interface HTMLBodyElement {
|
|||
//[TreatNullAs=EmptyString] attribute DOMString aLink;
|
||||
|
||||
[TreatNullAs=EmptyString] attribute DOMString bgColor;
|
||||
// attribute DOMString background;
|
||||
attribute DOMString background;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue