Re: [selectors] feedback

On Fri, Apr 18, 2014 at 8:09 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Thu, Apr 17, 2014 at 1:41 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
>> This does not seem clear to me with respect to the above remark. You'd
>> have to interpret "arbitrary additional information" which is not a
>> defined term, in creative ways.
>
> It's defined as *arbitrary additional information*.  Plain english
> words.  Anything additional your tree structure might have.  Because
> it's arbitrary, that includes things like more types of nodes, etc.

If you define it as an element tree one might think you are actually
dealing with an element tree rather than a node tree. E.g. in

A
- B
- #text
- C

given that A, B, C, are elements and #text is a node, are B and C
siblings? Are they siblings when doing selector matching? From what
text does this follow?


> Another reason I'm somewhat against switching to basing it on DOM is
> that the tree model used by Selectors is *wider* than DOM.  It
> contains pseudo-elements, for instance, which don't exist in DOM.  So
> even if I switched over, I'd still be working off a somewhat abstract
> tree with more information in it.

No, pseudo-elements operate on the node you matched against. They are
a good reason for making things clearer. E.g. if you have html::before
you first match until you find html and then there is some kind of
check for its associated before structure, if any. We should probably
also have some kind of flag as to whether pseudo-elements being
present should count as a match or not, for the DOM (or an expectation
setting of the results).


>> If you define matching against a tree, as you do, there's no need to
>> mention this. DTDs may or may not influence the DOM, whether that
>> happens is immaterial to the Selectors Standard.
>
> I'm okay with simplifying this down to a note that some document
> languages may allow attributes to have values by default.  Would that
> work?

Sounds okay.


> I plan to rewrite the parsing section into a Syntax-style parser, at
> which point it would have the same structure as Syntax wrt "parse a
> foo" algorithms.  Would that work?

Yes.


-- 
http://annevankesteren.nl/

Received on Tuesday, 22 April 2014 10:28:55 UTC