mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
html: Add the reflected 'sizes' IDL attribute for <image> (#39466)
Add the reflected 'sizes' IDL attribute for <image> element's DOM interface which defines image sizes for different page layouts. See https://html.spec.whatwg.org/multipage/#dom-img-sizes Testing: Improvements in the following tests - custom-elements/reactions/customized-builtins/HTMLImageElement.html - html/dom/idlharness.https.html - html/semantics/embedded-content/the-img-element/relevant-mutations.html Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
This commit is contained in:
parent
72555de341
commit
f91dc33350
5 changed files with 7 additions and 18 deletions
|
@ -1670,6 +1670,12 @@ impl HTMLImageElementMethods<crate::DomTypeHolder> for HTMLImageElement {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-img-src
|
||||
make_url_setter!(SetSrcset, "srcset");
|
||||
|
||||
// <https://html.spec.whatwg.org/multipage/#dom-img-sizes>
|
||||
make_getter!(Sizes, "sizes");
|
||||
|
||||
// <https://html.spec.whatwg.org/multipage/#dom-img-sizes>
|
||||
make_setter!(SetSizes, "sizes");
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-img-crossOrigin
|
||||
fn GetCrossOrigin(&self) -> Option<DOMString> {
|
||||
reflect_cross_origin_attribute(self.upcast::<Element>())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue