Skip to content

Commit

Permalink
Add a note about display: contents
Browse files Browse the repository at this point in the history
  • Loading branch information
Liamolucko committed Sep 5, 2022
1 parent 2c59062 commit a1a1210
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/platform_impl/web/web_sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ pub fn inner_size(raw: &HtmlCanvasElement) -> Option<LogicalSize<f64>> {
// 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
// `<canvas>` 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;
Expand Down

0 comments on commit a1a1210

Please sign in to comment.