From 3ed884a6adff46cb5871508612832ab8691752ac Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 4 Aug 2020 13:54:01 -0700 Subject: Issue #1620 - Use Intrinsic Aspect Ratio for Images https://bugzilla.mozilla.org/show_bug.cgi?id=1547231 https://bugzilla.mozilla.org/show_bug.cgi?id=1559094 https://bugzilla.mozilla.org/show_bug.cgi?id=1633434 https://bugzilla.mozilla.org/show_bug.cgi?id=1565690 https://bugzilla.mozilla.org/show_bug.cgi?id=1602047 Make use of Aspect Ratios in Image frames before Images are loaded. - Check for width and height HTML properties and create a ratio with them. - Overwrite HTML size values with actual image dimensions on load. - Collapse any frames with srcless images. Comments: dom/html/nsGenericHTMLElement.cpp:1483 layout/generic/nsImageFrame.cpp:289 --- modules/libpref/init/all.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules') diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 97070c23a..25e487206 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -4809,6 +4809,12 @@ pref("media.ondevicechange.fakeDeviceChangeEvent.enabled", false); // those platforms we don't handle touch events anyway so it's conceptually // a no-op. pref("layout.css.touch_action.enabled", true); + +// WHATWG computed intrinsic aspect ratio for an img element +// https://html.spec.whatwg.org/multipage/rendering.html#attributes-for-embedded-content-and-images +// Are the width and height attributes on image-like elements mapped to the +// internal-for-now aspect-ratio property? +pref("layout.css.width-and-height-map-to-aspect-ratio.enabled", false); // Enables some assertions in nsStyleContext that are too expensive // for general use, but might be useful to enable for specific tests. -- cgit v1.2.3 From 05ee48943cdf2c48c24a43bdb289eabb1cd08e9a Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 7 Aug 2020 14:32:59 -0700 Subject: Issue #1620 - Enable Intrinsic Ratio by Default A simpler name feels so much cleaner. --- modules/libpref/init/all.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 25e487206..6d5667205 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -4814,7 +4814,7 @@ pref("layout.css.touch_action.enabled", true); // https://html.spec.whatwg.org/multipage/rendering.html#attributes-for-embedded-content-and-images // Are the width and height attributes on image-like elements mapped to the // internal-for-now aspect-ratio property? -pref("layout.css.width-and-height-map-to-aspect-ratio.enabled", false); +pref("layout.css.intrinsic-aspect-ratio.enabled", true); // Enables some assertions in nsStyleContext that are too expensive // for general use, but might be useful to enable for specific tests. -- cgit v1.2.3