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

Re: [cssom] CSSRule.parentRule and CSSRule.parentStyleSheet should return a "CSSRule?"

From: Glenn Adams <glenn@skynav.com>
Date: Sat, 1 Sep 2012 10:02:35 +0800
Message-ID: <CACQ=j+dAgyQv_OPezQh1Ukh=QPV=uJCz9V7Z5ZjjrDE_RPtdrQ@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: www-style list <www-style@w3.org>
On Sat, Sep 1, 2012 at 9:41 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 8/31/12 8:41 PM, Glenn Adams wrote:
>> Please check. If CSSOM defined constructors for CSSRule concrete
>> subclasses, then I could see this happening. But it doesn't at present,
>> and I'm not sure it appropriate to spec if the spec doesn't otherwise
>> define a context in which it could be null.
> I think the issue here might be one of lifetime management.  I believe
> that if you're holding on to a rule and the rule's stylesheet is not
> attached to a document and you're not holding on to the stylesheet itself
> we will garbage-collect the stylesheet and null out the rule's
> parentStyleSheet.  Could be wrong, though.

At present, CSSOM doesn't provide a way to construct stylesheets or
add/remove them from document.styleSheets, so this seems like an
implementation issue.

Do you think we should add full ability to construct rule instances,
stylesheet instances, etc.? In such case, we would certainly need to
support having parentStyleSheet nullable. I believe some browsers may
already support such mechanisms as extensions over the original DOM-2 Style
Received on Saturday, 1 September 2012 02:03:23 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:03 UTC