Skip to content

Commit f59dc15

Browse files
authored
[css-scroll-snap-2] Add snap event handler attributes for Document and Element (w3c#10215)
* [css-scroll-snap-2] Add snap event handler attributes for Document and Element This adds the onsnapchanged and onsnapchanging attributes to the css-scroll-snap-2 specification for elements and Document objects. Heavily influenced by css-animations extensions to GlobalInterfaceHandlers[1]. [1] https://drafts.csswg.org/css-animations/#interface-globaleventhandlers * [css-scroll-snap-2] Add snap event handler attributes Move to appendix; point to html spec. * [css-scroll-snap-2] Add snap event handler attributes Clarify that event handlers are additional attributes.
1 parent 28a6821 commit f59dc15

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

css-scroll-snap-2/Overview.bs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,8 @@ SnapEvent interface
519519
</dl>
520520

521521
A {{SnapEvent}} should not bubble and should not be cancellable.
522+
523+
522524
<!--
523525
██ ███████ ██ ██ ██████ ██ ██ ███ ██ ██ ████████ ██████
524526
██ ██ ██ ███ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ██
@@ -601,3 +603,46 @@ Physical Longhands for 'scroll-start-target' {#scroll-start-target-longhands-phy
601603
</pre>
602604

603605
...
606+
607+
Appendix B: Event Handlers {#event-handlers}
608+
============================================================
609+
610+
ISSUE: This section should be moved to the HTML event handler
611+
<a href="https://html.spec.whatwg.org/#event-handlers-on-elements,-document-objects,-and-window-objects">specification</a>.
612+
613+
Event handlers on elements, Document objects and Window objects {#event-handlers-on-elements-document-and-window-objects}
614+
------------------------------------------------------------------------------------------------------
615+
616+
The following are additional <a>event handlers</a> (and their corresponding <a>event handler event types</a>)
617+
that must be supported by all <a>HTML elements</a> as both <a>event handler content attributes</a>
618+
and <a>event handler IDL attributes</a>; and that must be supported by all {{Window}} objects and {{Document}} objects, as
619+
<a>event handler IDL attributes</a>:
620+
621+
<table class="data" dfn-type=attribute dfn-for="Document,Element,Window">
622+
<tr>
623+
<th><a>Event handler</a></th>
624+
<th><a>Event handler event type</a></th>
625+
<tr>
626+
<td><dfn>onsnapchanged</dfn></td>
627+
<td>{{snapchanged}}</td>
628+
<tr>
629+
<td><dfn>onsnapchanging</dfn></td>
630+
<td>{{snapchanging}}</td>
631+
</table>
632+
633+
634+
Extensions to the <code>GlobalEventHandlers</code> Interface Mixin {#interface-globaleventhandlers}
635+
--------------------------------------------------------------------------------------------------------
636+
637+
This specification extends the {{GlobalEventHandlers}} interface mixin from
638+
HTML to add <a>event handler IDL attributes</a> for {{SnapEvents}} as defined
639+
in [[#event-handlers-on-elements-document-and-window-objects]].
640+
641+
<h4 id="interface-globaleventhandlers-idl">IDL Definition</h4>
642+
643+
<pre class="idl">
644+
partial interface mixin GlobalEventHandlers {
645+
attribute EventHandler onsnapchanged;
646+
attribute EventHandler onsnapchanging;
647+
};
648+
</pre>

0 commit comments

Comments
 (0)