[CSS OM] list of issues

Hi there, I agreed during last CSS WG conf call to list a few of the
CSS OM issues I am hitting working on BlueGriffon. Here is a first
list:

1. disabled attribute

    one HTML 4 erratum often listed between 1998 and now is about
    the lack of a disabled HTML attribute on <link> and <style> to
    reflect the CSS OM disabled attribute on stylesheets. Because of
    that, it is impossible to save the disabled status of an embedded or
    linked stylesheet. I think we should add at least a note here
    and make sure the WHATWG and HTML WG have that on their radar.

    We need a similar mechanism for the XML processing instruction.

2. interface CSSStyleSheet, serialization

    I think it is a pity that interface does not have a cssText
    attribute for complete serialization of the stylesheet.
    (note: could the serialization be done according to the
     presence of a @charset rule in the sheet?)

3. interface CSS, rule insertion and deletion

    the insertRule() and deleteRule() methods are string-based.
    This is suboptimal for embedders. Please see

      http://is.gd/6s08Sr

    for a detailed explanation. We could even have

      insertCSSRuleBefore(rule, targetRule)

4. interface CSSImportRule, href

    href on that interface is readonly while it could be read-write.
    For an content editor, it forces the code willing to tweak an
    existing @import rule to create a new rule and delete the existing
    one.

5. interface CSSImportRule, creation

    It could be useful to be able to have some sort of listener notified
    when the stylesheet loaded by a newly inserted @import rule is
    loaded and available through the CSS OM. Could also be useful to
    notify load errors or security warnings (same origin, file URIs, ...)

6. global

    It could be useful to be able to have mutation listeners on
    stylesheets.

7. getComputedStyle

    One of the big lacks of the existing CSS OM is the impossibility to
    get the computed style of an element if a dynamic pseudo-class is
    applied. It would be really cool to extend getComputedStyle() and
    allow for instance ":hover" in the second parameter.

    Similarly, it's currently impossible to find the specified value
    for a given property for a given element. There are tons of use
    cases for online content editors. I think it would be great to
    finally have getSpecifiedStyle(elt, pseudo) replying the result
    of the cascade.

That's all for today.

</Daniel>

Received on Friday, 27 May 2011 10:30:42 UTC