From a1a121026006e5a3d0687764eb01f88ad5504dc8 Mon Sep 17 00:00:00 2001 From: Liam Murphy Date: Fri, 2 Sep 2022 20:24:37 +1000 Subject: [PATCH] Add a note about `display: contents` --- src/platform_impl/web/web_sys/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/platform_impl/web/web_sys/mod.rs b/src/platform_impl/web/web_sys/mod.rs index 37fa0a42de..8fad05d8aa 100644 --- a/src/platform_impl/web/web_sys/mod.rs +++ b/src/platform_impl/web/web_sys/mod.rs @@ -91,6 +91,9 @@ pub fn inner_size(raw: &HtmlCanvasElement) -> Option> { // guaranteed to be in `px` (it's left as a percentage if the // property is specified as such, when normally it's resolved to // `px`). + // Note: that's also true when `display` is `contents`, but for + // `` that gets resolved to `display: none` and can never + // happen. // So, return 0, since getting the size right isn't particularly // important for an invisible element. return 0.0;