mirror of
https://github.com/servo/servo.git
synced 2025-09-25 06:10: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
|
// https://html.spec.whatwg.org/multipage/#dom-img-src
|
||||||
make_url_setter!(SetSrcset, "srcset");
|
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
|
// https://html.spec.whatwg.org/multipage/#dom-img-crossOrigin
|
||||||
fn GetCrossOrigin(&self) -> Option<DOMString> {
|
fn GetCrossOrigin(&self) -> Option<DOMString> {
|
||||||
reflect_cross_origin_attribute(self.upcast::<Element>())
|
reflect_cross_origin_attribute(self.upcast::<Element>())
|
||||||
|
|
|
@ -13,6 +13,7 @@ interface HTMLImageElement : HTMLElement {
|
||||||
attribute USVString src;
|
attribute USVString src;
|
||||||
[CEReactions]
|
[CEReactions]
|
||||||
attribute USVString srcset;
|
attribute USVString srcset;
|
||||||
|
[CEReactions] attribute DOMString sizes;
|
||||||
[CEReactions]
|
[CEReactions]
|
||||||
attribute DOMString? crossOrigin;
|
attribute DOMString? crossOrigin;
|
||||||
[CEReactions]
|
[CEReactions]
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
[HTMLImageElement.html]
|
[HTMLImageElement.html]
|
||||||
[sizes on HTMLImageElement must enqueue an attributeChanged reaction when adding a new attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[sizes on HTMLImageElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[decoding on HTMLImageElement must enqueue an attributeChanged reaction when adding a new attribute]
|
[decoding on HTMLImageElement must enqueue an attributeChanged reaction when adding a new attribute]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -5473,9 +5473,6 @@
|
||||||
[HTMLSourceElement interface: document.createElement("source") must inherit property "height" with the proper type]
|
[HTMLSourceElement interface: document.createElement("source") must inherit property "height" with the proper type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[HTMLImageElement interface: attribute sizes]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[HTMLImageElement interface: attribute decoding]
|
[HTMLImageElement interface: attribute decoding]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -5488,9 +5485,6 @@
|
||||||
[HTMLImageElement interface: attribute lowsrc]
|
[HTMLImageElement interface: attribute lowsrc]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[HTMLImageElement interface: document.createElement("img") must inherit property "sizes" with the proper type]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[HTMLImageElement interface: document.createElement("img") must inherit property "decoding" with the proper type]
|
[HTMLImageElement interface: document.createElement("img") must inherit property "decoding" with the proper type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -5503,9 +5497,6 @@
|
||||||
[HTMLImageElement interface: document.createElement("img") must inherit property "lowsrc" with the proper type]
|
[HTMLImageElement interface: document.createElement("img") must inherit property "lowsrc" with the proper type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[HTMLImageElement interface: new Image() must inherit property "sizes" with the proper type]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[HTMLImageElement interface: new Image() must inherit property "decoding" with the proper type]
|
[HTMLImageElement interface: new Image() must inherit property "decoding" with the proper type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,3 @@
|
||||||
|
|
||||||
[crossorigin state not changed: anonymous to foobar]
|
[crossorigin state not changed: anonymous to foobar]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[sizes is set to same value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue