W3C home > Mailing lists > Public > www-style@w3.org > January 2012

[cssom] window.getComputedStyle(xx, "::first-letter") (and "::first-line" perhaps) Re: [CSS21][12.2 The 'content' property] computed value on :first-line and :first-letter

From: Kang-Hao (Kenny) Lu <kennyluck@csail.mit.edu>
Date: Sun, 15 Jan 2012 20:16:40 +0800
Message-ID: <4F12C3A8.7030906@csail.mit.edu>
To: WWW Style <www-style@w3.org>
CC: Anton Prowse <prowse@moonhenge.net>, Simon Sapin <simon.sapin@kozea.fr>
(I meant to sent my previous mail just to www-archive but failed, please
forgive me.)

(12/01/09 3:38), Anton Prowse wrote:
> This bug is being tracked at
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=15457
> I propose the following change:
>   | Except on :before and :after, always computes to 'normal'. On
>   | :before and :after, if 'normal' is specified, computes to 'none';
>   | otherwise, for URI values, the absolute URI; for attr() values, the
>   | resulting string; for other keywords, as specified.

I was going to ask how is the computed value of the 'content' property
on ::first-line/::first-letter going to be testable, but then I figured
all browsers already implemented window.getComputedStyle(xx,
"::first-letter'), although this is not speced yet in CSSOM[1].

Do we want to standardize this? I am not too familiar with the use cases
of querying window.getComputedStyle(xx, "::first-letter") and the compat
requirements here. Browsers exhibit very different behaviors when you
query the ::first-letter of elements that don't yet exist[2][3], but
otherwise I think it is interoperable to some extent besides that Opera
always gives the style of the innermost ::first-letter and somehow
violates the fictional tags interpretation. Since this behavior is
probably a lot less complicated than anything else, I think we might
want to standardize Opera's behavior for normal case like[2], although
Gecko's "always create a temporary formatting object" approach might be
interesting too.

Any thoughts? I think I might be testing angles that don't quite align
with how people would want to use this API and I don't mind if we decide
not to expose this info to Web authors at all.

[1] http://dev.w3.org/csswg/cssom/#extensions-to-the-window-interface

Received on Sunday, 15 January 2012 12:17:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:09 UTC