Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add onslotchange #3487

Closed
annevk opened this issue Feb 20, 2018 · 9 comments · Fixed by #4129
Closed

Add onslotchange #3487

annevk opened this issue Feb 20, 2018 · 9 comments · Fixed by #4129
Labels
addition/proposal New features or enhancements impacts documentation Used by documentation communities, such as MDN, to track changes that impact documentation topic: shadow Relates to shadow trees (as defined in DOM)

Comments

@annevk
Copy link
Member

annevk commented Feb 20, 2018

Since slotchange bubbles and is fired on slot elements, it seems somewhat reasonable to add an onslotchange event handler. Since it's only useful inside shadow trees, it probably makes the most sense to add it to HTMLElement and ShadowRoot? Though maybe SVGElement as well?

Thoughts @whatwg/components?

@annevk annevk added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: shadow Relates to shadow trees (as defined in DOM) labels Feb 20, 2018
@rniwa
Copy link

rniwa commented Feb 21, 2018

Why don't we just add it to Element if we're also adding it to SVGElement?

@annevk
Copy link
Member Author

annevk commented Feb 21, 2018

We could do that too. We don't really have a good principle for when to put things on Element versus SVGElement and HTMLElement (and sometimes MathMLElement).

@snuggs
Copy link
Member

snuggs commented Feb 28, 2018

Whoa totally forgot about MathMLElement. FWIW @annevk @rniwa I know historically things have been simple(r) placing on HTMLElement until realizing SVGElement is not only necessary but a tad more difficult when related to CE Shadow Root implementation. Even within polyfill attempts usually work is duplicated from HTMLElement to SVGElement. I'd lay a cowpath @ Element.

My 2 Satoshi. 😎

@snuggs
Copy link
Member

snuggs commented Feb 28, 2018

Also @annevk on second thought, perhaps can think about what IS the principle for "putting something on Element"?

Personally curious as we use Element as a factory to remove the ceremony of custom element definition/instantiation. We also reassign the prototype so we don't play with things that aren't ours (at least other people's code doesn't think we do).

Just when I thought there wouldn't be anything touched on Element for a few years... hehe.

Thanks in advance! 🙏

@annevk
Copy link
Member Author

annevk commented Oct 25, 2018

Conclusion: add it on HTMLOrSVGElement.

@rniwa
Copy link

rniwa commented Oct 25, 2018

I would prefer having it on Element, but I'm fine with adding it to HTMLOrSVGElement for now.

@sideshowbarker sideshowbarker added the impacts documentation Used by documentation communities, such as MDN, to track changes that impact documentation label Oct 26, 2018
@sideshowbarker
Copy link
Member

cc @whatwg/documentation

annevk added a commit that referenced this issue Oct 26, 2018
Tests: ...

Fixes #3487.
@chrisdavidmills
Copy link

Documentation need recorded on MDN content roadmap at https://trello.com/c/OrG1iEf2/127-shadow-dom-api

domenic pushed a commit that referenced this issue Sep 20, 2019
Fixes part of #3487; what remains is to add it to ShadowRoot.
domenic added a commit to whatwg/dom that referenced this issue Sep 20, 2019
This introduces it to ShadowRoot in addition to GlobalEventHandlers, as
a counterpart to whatwg/html#4129. Closes
whatwg/html#3487.
@domenic
Copy link
Member

domenic commented Sep 20, 2019

Reopening until we add it to ShadowRoot too

@domenic domenic reopened this Sep 20, 2019
domenic added a commit to whatwg/dom that referenced this issue Sep 23, 2019
This introduces it to ShadowRoot in addition to GlobalEventHandlers, as
a counterpart to whatwg/html#4129. Closes
whatwg/html#3487.
@domenic domenic removed the needs implementer interest Moving the issue forward requires implementers to express interest label Sep 23, 2019
zcorpan pushed a commit that referenced this issue Nov 6, 2019
Fixes part of #3487; what remains is to add it to ShadowRoot.
philn pushed a commit to philn/old-webkit that referenced this issue Oct 4, 2020
https://bugs.webkit.org/show_bug.cgi?id=191310

Patch by Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> on 2020-10-03
Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaselined tests to pass more test cases.

* web-platform-tests/dom/idlharness.window-expected.txt:
* web-platform-tests/html/webappapis/scripting/events/event-handler-all-global-events-expected.txt:
* web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-body-window-expected.txt:
* web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-windowless-body-expected.txt:
* web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative-expected.txt:

Source/WebCore:

`onslotchange` attribute has been added to `ShadowRoot` and
`GlobalEventHandlers` by whatwg/html#3487

    - whatwg/dom#78
    - whatwg/html#4129

This patch supports it.

Tests: imported/w3c/web-platform-tests/dom/idlharness.window.html:
       imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-all-global-events.html
       imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-body-window.html
       imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-windowless-body.html
       imported/w3c/web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative.html

* dom/GlobalEventHandlers.idl:
* dom/ShadowRoot.idl:
* html/HTMLAttributeNames.in:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):

LayoutTests:

Rebaselined tests to pass more test cases.

* platform/glib/imported/w3c/web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@267939 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements impacts documentation Used by documentation communities, such as MDN, to track changes that impact documentation topic: shadow Relates to shadow trees (as defined in DOM)
Development

Successfully merging a pull request may close this issue.

6 participants