Commit 8577eff6 authored by Sonia Singla's avatar Sonia Singla
Browse files

Bug 1501983 - Add onslotchange event handler.r=smaug

Reflects following spec changes:
- https://github.com/whatwg/html/pull/4129
- https://github.com/whatwg/dom/pull/785

Those new spec addition is already implemented in Safari and Chromium is working on it.

Differential Revision: https://phabricator.services.mozilla.com/D123775
parent 27a83cc3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#ifndef mozilla_dom_shadowroot_h__
#define mozilla_dom_shadowroot_h__

#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/dom/DocumentBinding.h"
#include "mozilla/dom/DocumentFragment.h"
#include "mozilla/dom/DocumentOrShadowRoot.h"
@@ -163,6 +164,8 @@ class ShadowRoot final : public DocumentFragment,
  void PartAdded(const Element&);
  void PartRemoved(const Element&);

  IMPL_EVENT_HANDLER(slotchange);

  const nsTArray<const Element*>& Parts() const { return mParts; }

  const RawServoAuthorStyles* GetServoStyles() const {
+1 −0
Original line number Diff line number Diff line
@@ -237,6 +237,7 @@ EVENT(seeked, eSeeked, EventNameType_HTML, eBasicEventClass)
EVENT(seeking, eSeeking, EventNameType_HTML, eBasicEventClass)
EVENT(select, eFormSelect, EventNameType_HTMLXUL, eBasicEventClass)
EVENT(show, eShow, EventNameType_HTML, eBasicEventClass)
EVENT(slotchange, eSlotChange, EventNameType_All, eBasicEventClass)
EVENT(stalled, eStalled, EventNameType_HTML, eBasicEventClass)
EVENT(start, eMarqueeStart, EventNameType_HTMLMarqueeOnly, eBasicEventClass)
EVENT(submit, eFormSubmit, EventNameType_HTMLXUL, eBasicEventClass)
+1 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ interface mixin GlobalEventHandlers {
           attribute EventHandler onselect;
           [Pref="dom.menuitem.enabled"]
           attribute EventHandler onshow;
           attribute EventHandler onslotchange;
           //(Not implemented)attribute EventHandler onsort;
           attribute EventHandler onstalled;
           attribute EventHandler onsubmit;
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ interface ShadowRoot : DocumentFragment
  [Pref="dom.shadowdom.slot.assign.enabled"]
  readonly attribute SlotAssignmentMode slotAssignment;
  readonly attribute Element host;
  attribute EventHandler onslotchange;

  Element? getElementById(DOMString elementId);

+0 −3
Original line number Diff line number Diff line
@@ -4,9 +4,6 @@
  [Document interface: existence and properties of interface prototype object's @@unscopables property]
    expected: FAIL

  [ShadowRoot interface: attribute onslotchange]
    expected: FAIL

  [Stringification of document.createNSResolver(document.body)]
    expected: FAIL

Loading