This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23793 - "For each element e in elementSet, append the el..."
Summary: "For each element e in elementSet, append the el..."
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-11 10:24 UTC by Simon Sapin
Modified: 2014-02-12 21:08 UTC (History)
4 users (show)

See Also:


Attachments

Description Simon Sapin 2013-11-11 10:24:26 UTC
http://dom.spec.whatwg.org/#interface-parentnode

[[
For each element e in elementSet, append the elements that are not in result and result from matching s against e's root using scoping root e, to result. [SELECTORS]
]]

This should say something about pseudo-elements. In implementations they seem to be valid, but not match anything.
Comment 1 Anne 2013-11-12 06:40:09 UTC
I don't understand why we need to mention them.
Comment 2 Simon Sapin 2013-11-12 21:30:22 UTC
Well, based on the current spec, I don’t know what is supposed to happen when I use document.query('p::after'). Does it throw? Return null? Ignore ::after and return a <p> element? It’s either specified in a part of the spec that I missed, or it’s not defined which is bad for interop.
Comment 3 Anne 2013-11-13 08:52:48 UTC
How would what it is matched be ever up to DOM? That's up to the Selectors specification.
Comment 4 Tab Atkins Jr. 2013-11-19 16:02:07 UTC
It's not a matter of what gets matched (Selectors does indeed define that), but what gets returned by the function.  When you match a selector against a tree, you might get pseudo-elements.  In that case, what gets added to _result_ and ultimately returned to the user?

(The right answer is to use the new PseudoElement interface, I think, but the match-current-implementation behavior is to ignore them.)
Comment 5 Boris Zbarsky 2013-11-19 16:04:33 UTC
> The right answer is to use the new PseudoElement interface, I think

Defining the right behavior there could get ... pretty exciting.

I think the right thing here is in fact to match current implementations.
Comment 6 Anne 2013-11-19 16:30:52 UTC
Wait, Selectors matches against a DOM, not a layout tree Tab. This again shows you not defining the actual tree creates problems.
Comment 7 Tab Atkins Jr. 2013-11-19 16:44:40 UTC
(In reply to Anne from comment #6)
> Wait, Selectors matches against a DOM, not a layout tree Tab. This again
> shows you not defining the actual tree creates problems.

Dunno what you're talking about, bro. Selectors totally returns pseudo-elements when you specify them, at least in CSS.

Agree that there's still gaps there that need to be filled in, though.
Comment 8 Anne 2013-11-19 17:02:12 UTC
Bro? What I talk about is that pseudo-elements are not in the DOM so there's no way to return them.
Comment 9 Anne 2014-02-12 20:00:05 UTC
Is this solved with the updates to Selectors?
Comment 10 Simon Sapin 2014-02-12 21:08:10 UTC
It’s not clear to me that the issue is solved, but I guess DOM now says what it can/should and the issue is now in Selectors. Moved to http://lists.w3.org/Archives/Public/www-style/2014Feb/0447.html