W3C home > Mailing lists > Public > public-houdini@w3.org > February 2015

[parser] Scope question

From: Brian Kardell <bkardell@gmail.com>
Date: Sun, 8 Feb 2015 13:37:15 -0500
Message-ID: <CADC=+jf1cVvoaDHZiyfn0Ud+BHs1=13AS-msoZ7Jd0pOeHG-Ow@mail.gmail.com>
To: public-houdini@w3.org
We have decided to describe a parser which, I think, implies that we'll
have a method (somewhere) that can take a string and give you back
something more useful. This would *appear* to be a major boon for things
that want to polyfill at the high level because as long as they conform to
the forward compatible aspects of CSS they should be able to get
-something- whereas today those values are dropped from the CSSOM.  I
stress the word appear because its usefulness is actually limited unless
you can actually get at the text in the first place and one of the major
problems with anything doing polyfills (or prollyfills) today in CSS is
that it requires you to refetch the stylesheets and sometimes you just
can't because the link tag has special privileges... It doesn't require
CORs so, for example, if bootstrap had something that included polyfilled
rules (which you can definitely imagine it could) and you used it via a cdn
or some basic asset server without CORs you just might not be able to
access that.

I think that an important part of this exercise has to be explaining the
system and exposing hooks you can plug into so I'm wondering if that is in
scope:  What I'd like to know is can we explain parser in terms of its
calling by the underlying system as well such that, for example, you could
get at the stuff thats being sent to the parser.

In terms of my project, for example, we transform a custom pseudo class
into a hash for a regular class and then manage the regular class.  This
means that you have something like

div:--math-lessthan(score, 100) { color: blue; }

which will make divs blue if a div's score attribute is a numeric value
less than 100 simply gets rewritten in the stylesheet to something like

div.-some-magic-hash-code { color: blue; }

and then we watch div[score] for changes and attach or detach the hash
class... So, it's just normal CSS at that point and it's important that it
maintain its place in the stylesheet and so on.  Ideally for this and a lot
of cases like it then, you'd like to see some callback that gives me the
opportunity to intercept the raw text and rewrite some unknown thing into
something known (in fact, that is at some level how all p(r)olyfills work).

So, my question is - are we considering that in scope or not and is that
part of the parser effort or not?




-- 
Brian Kardell :: @briankardell :: hitchjs.com
Received on Sunday, 8 February 2015 18:37:43 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 15:47:05 UTC