W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2019

[csswg-drafts] [resize-observer] Resize events on inline elements (#4507)

From: bobOnGitHub via GitHub <sysbot+gh@w3.org>
Date: Mon, 11 Nov 2019 18:40:59 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-521122470-1573497658-sysbot+gh@w3.org>
bobOnGitHub has just created a new issue for https://github.com/w3c/csswg-drafts:

== [resize-observer] Resize events on inline elements ==
I see there was a discussion on resize events for inline elements in [How do we observe inline elements](https://github.com/WICG/ResizeObserver/issues/19)

The current state of affairs appears to be that events do not fire as a result of size changes to existing inline elements and this appears to be the agreed behaviour for ResizeObserver ([Observations do not fire for non-replaced inline Elements](https://drafts.csswg.org/resize-observer/#resize-observer-interface)).

Consequently, ResizeObserver is of no use with regard to inline elements.

Reading [here](https://github.com/WICG/ResizeObserver/blob/master/explainer.md) the case for ResizeObserver is the need to be able to react to a component size change. 

However, a component can be styled as inline by the consumer at which point you are back to square 1.

Example : 
Your component renders an image with height to match the host height. The host has been styled inline with font size 24pt. The user increases the fontsize to 48pt and you have no event to react to and re-render the image.

I can't see why it should matter whether the element is inline/block/inline-block etc. All that matters if you are monitoring size changes is size.

I'd suggest that ResizeObserver should fire an event for a size change on an observed element regardless of anything else. 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4507 using your GitHub account
Received on Monday, 11 November 2019 18:41:00 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:56 UTC