Add .pseudoTarget property to selected event types#413
Add .pseudoTarget property to selected event types#413danielsakhapov wants to merge 14 commits intow3c:mainfrom
Conversation
|
@garykac could you ptal? |
sections/external-algorithms.txt
Outdated
|
|
||
| <p class="note"> | ||
| This {{CSSPseudoElement}} must be the same object instance that would be returned | ||
| by calling <code>.pseudo(type)</code> on the |pseudoElement|'s originating element |
There was a problem hiding this comment.
What is .pseudo(type) ?
I guess this.
There was a problem hiding this comment.
Updated this part to include links
smaug----
left a comment
There was a problem hiding this comment.
This doesn't seem to handle event dispatch in Shadow DOM. We don't want to leak pseudo element usage in shadow DOM to light DOM.
Not entirely sure how to phrase that, ptal! |
sections/external-algorithms.txt
Outdated
|
|
||
| 1. Let |ultimateOriginatingElement| be the |pseudoElement|'s [=ultimate originating element=]. | ||
|
|
||
| 1. If |ultimateOriginatingElement| is in a shadow tree (that is, its [=tree/root=] is a {{ShadowRoot}}) and |eventTarget| is not contained within the same shadow tree, then exit. |
There was a problem hiding this comment.
I would expect that "ultimateOriginatingElement" (maybe we can find some other name for that ;) ) would be compared to the currentTarget and then the getter of pseudoElement would either return the object or null. Something similar-ish to https://html.spec.whatwg.org/#dom-commandevent-source perhaps?
|
Just FYI, there is now a rather major refactoring happening to UI Events spec, so this one might need to wait until w3c/pointerevents#564 and related PRs are done. Those should happen real soon. |
I see, thanks for the heads up! Does this PR look good now btw? |
sections/event-uievent.txt
Outdated
| 1. If {{UIEvent/pseudoTarget}} internal slot is <code>null</code>, then return <code>null</code>. | ||
| 1. Let |currentTarget| be {{Event/currentTarget}}. | ||
| 1. If |currentTarget| is <code>null</code>, then return <code>null</code>. | ||
| 1. Let |origin| be {{Event/target}} (which would be {{UIEvent/pseudoTarget}}'s [=ultimate originating element=]). |
There was a problem hiding this comment.
"ultimate originating element" sounds a bit, hmm, comical :)
There was a problem hiding this comment.
true... but since there can be nested pseudo-elements, the originating element can be also pseudo-element, so ultimate originating element is Element... that's an established CSS term! :)
As resolved in w3c/csswg-drafts#12163, add .pseudoTarget property to selected event types and describe the initialization process for it.
e0b6dac to
c4c7e79
Compare
|
The blocking PR has been merged now it seems, ptal |
dbaron
left a comment
There was a problem hiding this comment.
This looks good to me, although I think @smaug----'s review is more important here.
| This {{CSSPseudoElement}} must be the same object instance that would be returned | ||
| by calling {{Element/pseudo(type)}} if the |pseudoElement|'s [=originating element=] is an {{Element}}, | ||
| or {{CSSPseudoElement/pseudo(type)}} of {{CSSPseudoElement}} representing |pseudoElement|'s [=originating element=] otherwise. | ||
| This is necessary, to ensure that |pseudoInstance| is a canonical object representing |pseudoElement|. |
There was a problem hiding this comment.
| This is necessary, to ensure that |pseudoInstance| is a canonical object representing |pseudoElement|. | |
| This is necessary to ensure that |pseudoInstance| is the canonical object representing |pseudoElement|. |
No comma here, and the rather than a. (The use of a comma in this case makes the writing sound to me like English written by a native German speaker. It may apply to other languages too. :-) )
As resolved in w3c/csswg-drafts#12163, add .pseudoTarget property to selected event types and describe the initialization process for it.