Re: [cssom] Directions for better OM expansions

On Fri, Sep 17, 2010 at 11:44 AM, Maciej Stachowiak <mjs@apple.com> wrote:
> A susprising number of these all come from "I'm writing a CSS editing tool".
> Out of the features you listed, are there any justified only by that use
> case? I'm curious if the design would be different without considering
> editors. A good editor may have really crazy needs, like the ability to
> round-trip comments and exact formatting (including whitespace).

Yes, some are only for the editor use-case.  I was just copying from
my whiteboard with minimal edits; we didn't drill into that case
strongly, but it happened that several requirements popped out from
our discussion of the authoring side.


>> 6. I'm a page author, and I want to read/write the value of a property
>> in the style-sheet block that's providing the value (or just the first
>> one that *would* provide the value, if it wasn't being overridden by
>> @style or something) so that the change will propagate to all similar
>> elements.  (Possibly this requires a bit more smarts from the author,
>> like examining selectors?)
>
> Is there a real scenario where page authors would use this? I am mildly
> skeptical, based on the vague story.

Oh man, yes.  It's quite common, actually.  I've written a lot of
jQuery code where I explicitly grab a group of related elements by
selector and twiddle their @style (this is trivial in jQuery, since
the .css() function doesn't care whether it's being applied to a
single element or a collection).  Being able to do this on the
stylesheet level where it belongs so I don't end up accidentally
clobbering existing @style values would be nice.


> In fact, most of these page author use
> cases are pretty vague. It would help to get more concrete, for instance "I
> want to animate the size and bounds of a lightbox when it initially appears"
> or "I want to pop up a menu that fades in." A lot of these use cases just
> sound like the feature list with "I'm a page author" prepended.

Yeah, I need to write them up better.  Like I said, copied from
whiteboard.  They all spawned directly from pain points while recently
writing a demo app together, though.

~TJ

Received on Friday, 17 September 2010 20:04:19 UTC