Re: Text metrics with display:none

On Mon, Dec 12, 2011 at 8:04 AM, Charles Pritchard <chuck@jumis.com> wrote:
> On Dec 12, 2011, at 6:27 AM, Chris Lilley <chris@w3.org> wrote:
>> If you want things to be rendered (but invisible) - as opposed to not being in the rendering tree at all, which is what display: none does - then visibility: hidden is what you want.
>
> In HTML it's also position: absolute and top/left offset off screen. It's not an elegant solution but it's been the method for a long time.
>
> It'd be nice to have an elegant solution in the future. These feel like work-arounds for an API that wasn't designed for these use cases.

visibility:hidden is the correct solution for the use-case presented
(measuring things that aren't visible).

HTML/CSS has a further use-case in-between visibility:hidden and
display:none where you want something to not be visible or affect
layout in any way but still generate boxes and run general
house-keeping, like incrementing counters and keeping animations
going.  As far as I can tell this isn't necessary in SVG, as it's
trivial to make the layout algorithm ignore a box, and so just using
visibility:hidden is fine.

~TJ

Received on Monday, 12 December 2011 17:04:03 UTC