Re: [cssom] serializing Selectors

On Mon, 19 Oct 2009, Anne van Kesteren wrote:

> Another thing I was wondering about was what to do about @namespace rules 
> that are removed and added dynamically. Changing/adding them would 
> essentially require parsing the style sheet again which seems suboptimal.
>
> I thought of various ways to solve this all assuming we want to keep that 
> @namespace rules are a parse-time construct only (and therefore a namespace 
> map is created during parsing):
>
> 1) Any changes to @namespace rules (removal, adding, etc.) does not affect 
> the namespace map.
> 2) We remove @namespace rules (and the CSSNamespaceRule interface/object) 
> from the rules collection and expose a readonly namespace map on the 
> CSSStyleSheet object in some fashion.
> 3) We remove the ability for @namespace rules to be either added, removed, or 
> changed by either 3a) throwing or 3b) ignoring such operations.
>
> Any thoughts?

neither:
ability to aceess @namespace rules essential if stylesheet
constructed using cssom api.
removing them from rules collection making cssom inconsistent/inadequate.
the same if changes not affect namespace map (subsequent rule insertion
broken).

too high price for 'perfect serialization'. i prefer non-serializable 
impl:
- changes in @namespace rules mirrored to namespace map in sheet's
   context immediately;
- such map used only during parse;
- any subsequent parser invocation use current state of map.

>
>
>

Received on Tuesday, 20 October 2009 14:03:14 UTC