-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove specification of intrinsic aspect-ratio, and instead map width… #6032
Conversation
…/height to a presentational property. Fixes #5907
Huh, how do I give a |
Empty |
Yup, just hadn't gotten to the test yet yesterday. WPT PR open now. |
Awesome, tests look to be in order. Ping @cbiesinger to confirm that Chrome intends to implement this? |
I am interested in implementing this. |
@tabatkins sorry, found something else. Which elements is this for? Is it just |
Ah, good catch. The deleted text only applied it to |
Related: #5894 (one of these will need to rebase) cc @yoavweiss |
FWIW-- As far as I can tell, this is a behavior change for error images / images without src in that this will now apply to them but didn't (I think) previously (I noticed this due to a failing test while implementing). I think that's fine but wanted to point it out. |
@cbiesinger hmmm, is that both quirks mode and standards mode? I believe that in standards mode,
https://html.spec.whatwg.org/multipage/rendering.html#images-3 (Not sure why it says "phrasing element" instead of "inline element"...) https://drafts.csswg.org/css-sizing-4/#propdef-aspect-ratio says that 'aspect-ratio' doesn't apply for inline boxes. So, AFAICT, the aspect-ratio preshint should do nothing (in no-quirks mode and limited-quirks mode) when showing the alt text. The intention here is to let the alt text flow with the text like normal text, so applying the aspect-ratio seems bad. |
I didn't actually test alt text; I tested an error image without text ( |
Instead of having special code in image layout, map the aspect ratio that's computed from the width and height attributes to the aspect-ratio property. As a side-effect, this patch will also make the aspect-ratio property work when contain: size is specified in an image (as well as error images when no alt text is specified). As specified in whatwg/html#6032. R=masonfreed@chromium.org, xiaochengh@chromium.org Bug: 1137004 Change-Id: I1253fa2ecf1e176711d3c4d7bd4159f466656ae8
@cbiesinger OK. That seems fine. That case falls into the second branch:
|
Instead of having special code in image layout, map the aspect ratio that's computed from the width and height attributes to the aspect-ratio property. As a side-effect, this patch will also make the aspect-ratio property work when contain: size is specified in an image (as well as error images when no alt text is specified). As specified in whatwg/html#6032. R=masonfreed@chromium.org, xiaochengh@chromium.org Bug: 1137004 Change-Id: I1253fa2ecf1e176711d3c4d7bd4159f466656ae8
Instead of having special code in image layout, map the aspect ratio that's computed from the width and height attributes to the aspect-ratio property. As a side-effect, this patch will also make the aspect-ratio property work when contain: size is specified in an image (as well as error images when no alt text is specified). As specified in whatwg/html#6032. R=masonfreed@chromium.org, xiaochengh@chromium.org Bug: 1137004 Change-Id: I1253fa2ecf1e176711d3c4d7bd4159f466656ae8
Instead of having special code in image layout, map the aspect ratio that's computed from the width and height attributes to the aspect-ratio property. As a side-effect, this patch will also make the aspect-ratio property work when contain: size is specified in an image (as well as error images when no alt text is specified). As specified in whatwg/html#6032. R=masonfreed@chromium.org, xiaochengh@chromium.org Bug: 1137004 Change-Id: I1253fa2ecf1e176711d3c4d7bd4159f466656ae8
Instead of having special code in image layout, map the aspect ratio that's computed from the width and height attributes to the aspect-ratio property. As a side-effect, this patch will also make the aspect-ratio property work when contain: size is specified in an image (as well as error images when no alt text is specified). As specified in whatwg/html#6032. R=masonfreed@chromium.org, xiaochengh@chromium.org Bug: 1137004 Change-Id: I1253fa2ecf1e176711d3c4d7bd4159f466656ae8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495560 Reviewed-by: Yu Han <yuzhehan@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#823124}
Instead of having special code in image layout, map the aspect ratio that's computed from the width and height attributes to the aspect-ratio property. As a side-effect, this patch will also make the aspect-ratio property work when contain: size is specified in an image (as well as error images when no alt text is specified). As specified in whatwg/html#6032. R=masonfreed@chromium.org, xiaochengh@chromium.org Bug: 1137004 Change-Id: I1253fa2ecf1e176711d3c4d7bd4159f466656ae8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495560 Reviewed-by: Yu Han <yuzhehan@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#823124}
Instead of having special code in image layout, map the aspect ratio that's computed from the width and height attributes to the aspect-ratio property. As a side-effect, this patch will also make the aspect-ratio property work when contain: size is specified in an image (as well as error images when no alt text is specified). As specified in whatwg/html#6032. R=masonfreed@chromium.org, xiaochengh@chromium.org Bug: 1137004 Change-Id: I1253fa2ecf1e176711d3c4d7bd4159f466656ae8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495560 Reviewed-by: Yu Han <yuzhehan@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#823124}
…o CSS, a=testonly Automatic update from web-platform-tests Map the aspect ratio from width/height to CSS Instead of having special code in image layout, map the aspect ratio that's computed from the width and height attributes to the aspect-ratio property. As a side-effect, this patch will also make the aspect-ratio property work when contain: size is specified in an image (as well as error images when no alt text is specified). As specified in whatwg/html#6032. R=masonfreed@chromium.org, xiaochengh@chromium.org Bug: 1137004 Change-Id: I1253fa2ecf1e176711d3c4d7bd4159f466656ae8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495560 Reviewed-by: Yu Han <yuzhehan@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#823124} -- wpt-commits: af446b330a4610771769a5cb33668e151239c7e7 wpt-pr: 26261
This covers video, img and canvas. This is for whatwg/html#6032. See also #26010. R=masonfreed@chromium.org, yoavweiss@chromium.org Bug: 1137004 Change-Id: I38d690412af67836e4fdede11c5b4938e47f138f
Are there tests that the width and height properties continue to be impacted as well? I guess they already exist but it might be nice to merge them? |
This covers video, img and canvas. This is for whatwg/html#6032. See also #26010. R=masonfreed@chromium.org, yoavweiss@chromium.org Bug: 1137004 Change-Id: I38d690412af67836e4fdede11c5b4938e47f138f
This covers video, img and canvas. This is for whatwg/html#6032. See also #26010. R=masonfreed@chromium.org, yoavweiss@chromium.org Bug: 1137004 Change-Id: I38d690412af67836e4fdede11c5b4938e47f138f
This covers video, img and canvas. This is for whatwg/html#6032. See also #26010. R=masonfreed@chromium.org, yoavweiss@chromium.org Bug: 1137004 Change-Id: I38d690412af67836e4fdede11c5b4938e47f138f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2679289 Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#853156}
This covers video, img and canvas. This is for whatwg/html#6032. See also #26010. R=masonfreed@chromium.org, yoavweiss@chromium.org Bug: 1137004 Change-Id: I38d690412af67836e4fdede11c5b4938e47f138f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2679289 Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#853156}
This covers video, img and canvas. This is for whatwg/html#6032. See also web-platform-tests/wpt#26010. R=masonfreed@chromium.org, yoavweiss@chromium.org Bug: 1137004 Change-Id: I38d690412af67836e4fdede11c5b4938e47f138f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2679289 Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#853156}
I will add those in https://crrev.com/c/2690929
I don't know where/if they exist. However, I'd rather not put them together with these new tests, because currently that file contains various tests for aspect ratios (also that the layout is right). |
See also https://crrev.com/c/2495560 and whatwg/html#6032 Bug: 1137004 Change-Id: I17ff2c6f96b2cb9058858a0dc2439885f62ef414
Alright, I'm happy to merge this. @annevk, I don't quite understand what tests you're asking for (it seems like @cbiesinger does though). Do you think they're necessary before merging, or just something we should also do while we're in the area? |
I believe Anne was asking for a test that width="500" gets mapped to width: 500px; (and same for height) |
See also https://crrev.com/c/2495560 and whatwg/html#6032 Bug: 1137004 Change-Id: I17ff2c6f96b2cb9058858a0dc2439885f62ef414 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2690929 Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Commit-Queue: Mason Freed <masonfreed@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#853591}
See also https://crrev.com/c/2495560 and whatwg/html#6032 Bug: 1137004 Change-Id: I17ff2c6f96b2cb9058858a0dc2439885f62ef414 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2690929 Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Commit-Queue: Mason Freed <masonfreed@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#853591}
See also https://crrev.com/c/2495560 and whatwg/html#6032 Bug: 1137004 Change-Id: I17ff2c6f96b2cb9058858a0dc2439885f62ef414 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2690929 Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Commit-Queue: Mason Freed <masonfreed@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#853591}
… aspect-ratio, a=testonly Automatic update from web-platform-tests Add tests for mapping of width/height to aspect-ratio This covers video, img and canvas. This is for whatwg/html#6032. See also web-platform-tests/wpt#26010. R=masonfreed@chromium.org, yoavweiss@chromium.org Bug: 1137004 Change-Id: I38d690412af67836e4fdede11c5b4938e47f138f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2679289 Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#853156} -- wpt-commits: 87acfece9dfcb016236468d1710c626e92128a57 wpt-pr: 27527
…r <input type=image>, a=testonly Automatic update from web-platform-tests Also map width/height to aspect-ratio for <input type=image> See also https://crrev.com/c/2495560 and whatwg/html#6032 Bug: 1137004 Change-Id: I17ff2c6f96b2cb9058858a0dc2439885f62ef414 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2690929 Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Commit-Queue: Mason Freed <masonfreed@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#853591} -- wpt-commits: 04bcfa1e0caff138eb7a86e4aae15f0888429b55 wpt-pr: 27609
…r <input type=image>, a=testonly Automatic update from web-platform-tests Also map width/height to aspect-ratio for <input type=image> See also https://crrev.com/c/2495560 and whatwg/html#6032 Bug: 1137004 Change-Id: I17ff2c6f96b2cb9058858a0dc2439885f62ef414 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2690929 Auto-Submit: Christian Biesinger <cbiesingerchromium.org> Commit-Queue: Mason Freed <masonfreedchromium.org> Reviewed-by: Mason Freed <masonfreedchromium.org> Cr-Commit-Position: refs/heads/master{#853591} -- wpt-commits: 04bcfa1e0caff138eb7a86e4aae15f0888429b55 wpt-pr: 27609 UltraBlame original commit: 8153bc1bd94f54aef118eeffb2a2330413c70dff
…r <input type=image>, a=testonly Automatic update from web-platform-tests Also map width/height to aspect-ratio for <input type=image> See also https://crrev.com/c/2495560 and whatwg/html#6032 Bug: 1137004 Change-Id: I17ff2c6f96b2cb9058858a0dc2439885f62ef414 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2690929 Auto-Submit: Christian Biesinger <cbiesingerchromium.org> Commit-Queue: Mason Freed <masonfreedchromium.org> Reviewed-by: Mason Freed <masonfreedchromium.org> Cr-Commit-Position: refs/heads/master{#853591} -- wpt-commits: 04bcfa1e0caff138eb7a86e4aae15f0888429b55 wpt-pr: 27609 UltraBlame original commit: 8153bc1bd94f54aef118eeffb2a2330413c70dff
…r <input type=image>, a=testonly Automatic update from web-platform-tests Also map width/height to aspect-ratio for <input type=image> See also https://crrev.com/c/2495560 and whatwg/html#6032 Bug: 1137004 Change-Id: I17ff2c6f96b2cb9058858a0dc2439885f62ef414 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2690929 Auto-Submit: Christian Biesinger <cbiesingerchromium.org> Commit-Queue: Mason Freed <masonfreedchromium.org> Reviewed-by: Mason Freed <masonfreedchromium.org> Cr-Commit-Position: refs/heads/master{#853591} -- wpt-commits: 04bcfa1e0caff138eb7a86e4aae15f0888429b55 wpt-pr: 27609 UltraBlame original commit: 8153bc1bd94f54aef118eeffb2a2330413c70dff
Instead of having special code in image layout, map the aspect ratio that's computed from the width and height attributes to the aspect-ratio property. As a side-effect, this patch will also make the aspect-ratio property work when contain: size is specified in an image (as well as error images when no alt text is specified). As specified in whatwg/html#6032. R=masonfreed@chromium.org, xiaochengh@chromium.org Bug: 1137004 Change-Id: I1253fa2ecf1e176711d3c4d7bd4159f466656ae8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495560 Reviewed-by: Yu Han <yuzhehan@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#823124} GitOrigin-RevId: 8a0368a253633566ceed750bdf3a1725b5800d4f
This matches the code for <img> added in https://crrev.com/c/2495560 and the spec in whatwg/html#6032 . Change-Id: I57e343b3932cd38e5d6c8b9860e60aee70d57a56 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2642857 Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#846862} GitOrigin-RevId: 9008d6728dcc13c6747bcc231c051697a0902870
This matches the code for <img> added in https://crrev.com/c/2495560 and for <video> in https://crrev.com/c/2642857 as well as the spec in whatwg/html#6032 . Change-Id: I897bcf12952cf0cf817b03c7dbd825d4c7212906 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2650135 Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/master@{#848136} GitOrigin-RevId: b08b91bf78c22bb660b2c7f13091a06800cf1c96
This covers video, img and canvas. This is for whatwg/html#6032. See also web-platform-tests/wpt#26010. R=masonfreed@chromium.org, yoavweiss@chromium.org Bug: 1137004 Change-Id: I38d690412af67836e4fdede11c5b4938e47f138f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2679289 Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#853156} GitOrigin-RevId: b6e8b35bad8c9e311525b1a37b8127905826e1e7
See also https://crrev.com/c/2495560 and whatwg/html#6032 Bug: 1137004 Change-Id: I17ff2c6f96b2cb9058858a0dc2439885f62ef414 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2690929 Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Commit-Queue: Mason Freed <masonfreed@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#853591} GitOrigin-RevId: cc7930ea9b6da6a96e7e693526b111a5d0e50207
…/height to a presentational property. Fixes #5907
aspect-ratio
property. #5907)(See WHATWG Working Mode: Changes for more details.)
/infrastructure.html ( diff )
/rendering.html ( diff )