[whatwg] Font Resize Event

Hugh Guiney hugh.guiney at gmail.com
Tue Sep 25 23:41:06 PDT 2012

My use case: I have a <div> with overflow: hidden that contains slides
as part of a JavaScript carousel. It has to be overflow: hidden
because otherwise the unseen slides are visible/stretch the page. And
because each slide is different, the containing <div> therefore needs
to grow/shrink in height depending on the content currently being
displayed. This is trivial enough to do, by changing the height to
match its contents whenever a slide change occurs, or a resize or
orientationchange event is fired, but currently if I increase or
decrease the font size, the content can get cut off, or there will be
a ton of extra white space, since the <div> height is out of sync with
the height of its contents. This could be easily remedied with a
fontresize (or textresize) event.

Some existing efforts to fill in this functionality, going back to
2005, demonstrate the utility beyond just this use case:


While it's true I could use one of the existing scripts I listed, to
me they are all unusable as the change detections don't always occur
when a Cmd-+/- is issued.

More information about the whatwg mailing list