From 9e3ce67c7927d6642646a3d0c84fa6d8f7926cfa Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 14 Apr 2016 16:18:46 +0300 Subject: [PATCH 01/30] Add more legacy event types for createEvent() Approximately as requested at https://bugzilla.mozilla.org/show_bug.cgi?id=1251198#c7. This is the list of events supported in createEvent() by at least two of Firefox, Chrome, and IE 11. The one exception is I omitted MutationEvent, which all three support, because apparently spec-land has decided to deny its existence in the hope that it will go away. Bikeshed does not know about all of the added interface names, hopefully that will sort itself out over time. --- dom.bs | 34 +++++++++++--- dom.html | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 164 insertions(+), 11 deletions(-) diff --git a/dom.bs b/dom.bs index aca5d6b6b..082123e45 100644 --- a/dom.bs +++ b/dom.bs @@ -4919,21 +4919,43 @@ invoked, must run these steps: StringInterfaceNotes - "customevent"{{CustomEvent}} - "event{{Event}} + "animationevent"{{AnimationEvent}}[[!CSS3-ANIMATIONS]] + "beforeunloadevent"{{BeforeUnloadEvent}}[[!HTML]] + "closeevent"{{CloseEvent}} + "compositionevent"{{CompositionEvent}}[[!UIEVENTS]] + + "customevent"{{CustomEvent}} + "devicemotionevent"{{DeviceMotionEvent}}[[!DEVICE-ORIENTATION]] + "deviceorientationevent"{{DeviceOrientationEvent}} + "dragevent"{{DragEvent}}[[!HTML]] + "errorevent"{{ErrorEvent}} + "event"{{Event}} "events" - "htmlevents" + + "focusevent"{{FocusEvent}}[[!UIEVENTS]] + "hashchangeevent"{{HashChangeEvent}}[[!HTML]] + "htmlevents"{{Event}} + "idbversionchangeevent"{{IDBVersionChangeEvent}}[[INDEXEDDB]] "keyboardevent"{{KeyboardEvent}}[[!UIEVENTS]] "messageevent"{{MessageEvent}}[[!HTML]] "mouseevent"{{MouseEvent}}[[!UIEVENTS]] "mouseevents" + "pagetransitionevent"{{PageTransitionEvent}}[[!HTML]] + "popstateevent"{{PopStateEvent}} + "progressevent"{{ProgressEvent}}[[!XHR]] + "storageevent"{{StorageEvent}}[[!HTML]] + "svgevent"{{Event}} + "svgzoomevent"{{SVGZoomEvent}}[[!SVG]] + "svgzoomevents" + "textevent"{{CompositionEvent}}[[!UIEVENTS]] "touchevent"{{TouchEvent}}[[!TOUCH-EVENTS]] + "trackevent"{{TrackEvent}}[[!HTML]] + "transitionevent"{{TransitionEvent}}[[!CSS3-TRANSITIONS]] "uievent"{{UIEvent}}[[!UIEVENTS]] "uievents" + "webglcontextevent"{{WebGLContextEvent}}[[!WEBGL]] + "wheelevent"{{WheelEvent}}[[!UIEVENTS]] -
  • If constructor is null, throw a {{NotSupportedError}}. diff --git a/dom.html b/dom.html index 39cf0f767..7e700d221 100644 --- a/dom.html +++ b/dom.html @@ -71,7 +71,7 @@

    DOM

    -

    Living Standard — Last Updated

    +

    Living Standard — Last Updated

    @@ -2723,17 +2723,61 @@

    Interface Notes + + "animationevent" + AnimationEvent + [CSS3-ANIMATIONS] + + "beforeunloadevent" + BeforeUnloadEvent + [HTML] + + "closeevent" + CloseEvent + + "compositionevent" + CompositionEvent + [UIEVENTS] "customevent" CustomEvent - + - "event - Event + "devicemotionevent" + DeviceMotionEvent + [DEVICE-ORIENTATION] + + "deviceorientationevent" + DeviceOrientationEvent + + "dragevent" + DragEvent + [HTML] + + "errorevent" + ErrorEvent + + "event" + Event + "events" - "htmlevents" + "focusevent" + FocusEvent + [UIEVENTS] + + "hashchangeevent" + HashChangeEvent + [HTML] + + "htmlevents" + Event + + + "idbversionchangeevent" + IDBVersionChangeEvent + [INDEXEDDB] "keyboardevent" KeyboardEvent @@ -2748,16 +2792,61 @@

    [UIEVENTS] "mouseevents" + + "pagetransitionevent" + PageTransitionEvent + [HTML] + + "popstateevent" + PopStateEvent + + "progressevent" + ProgressEvent + [XHR] + + "storageevent" + StorageEvent + [HTML] + + "svgevent" + Event + + + "svgzoomevent" + SVGZoomEvent + [SVG] + + "svgzoomevents" + + "textevent" + CompositionEvent + [UIEVENTS] "touchevent" TouchEvent [TOUCH-EVENTS] + + "trackevent" + TrackEvent + [HTML] + + "transitionevent" + TransitionEvent + [CSS3-TRANSITIONS] "uievent" UIEvent [UIEVENTS] "uievents" + + "webglcontextevent" + WebGLContextEvent + [WEBGL] + + "wheelevent" + WheelEvent + [UIEVENTS]
  • If constructor is null, throw a NotSupportedError.
  • Let event be the result of invoking the initial @@ -5866,6 +5955,16 @@

    Construct
  • TypeError +
  • + [css-animations-1] defines the following terms: + +
  • + [css-transitions-1] defines the following terms: +
  • [CSSOM-VIEW] defines the following terms:
      @@ -5875,9 +5974,18 @@

      [HTML] defines the following terms: +
    • + [SVG] defines the following terms: +
    • [URL] defines the following terms:
        @@ -5916,6 +6029,16 @@

        References

        Normative References

        +
        [CSS-ANIMATIONS-1] +
        CSS Animations Module Level 1 URL: https://drafts.csswg.org/css-animations-1/ +
        [CSS-TRANSITIONS-1] +
        CSS Transitions Module Level 1 URL: https://drafts.csswg.org/css-transitions-1/ +
        [CSS3-ANIMATIONS] +
        Dean Jackson; et al. CSS Animations. 19 February 2013. WD. URL: http://www.w3.org/TR/css3-animations/ +
        [CSS3-TRANSITIONS] +
        Dean Jackson; et al. CSS Transitions. 19 November 2013. WD. URL: http://dev.w3.org/csswg/css-transitions/ +
        [DEVICE-ORIENTATION] +
        Stephen Block; Andrei Popescu. DeviceOrientation Event Specification. 1 December 2011. LCWD. URL: http://www.w3.org/TR/orientation-event/
        [ECMASCRIPT]
        ECMAScript Language Specification. URL: https://tc39.github.io/ecma262/
        [ENCODING] @@ -5930,14 +6053,20 @@

        N
        Elika Etemad; Tab Atkins Jr.. Selectors Level 4. 2 May 2013. WD. URL: http://www.w3.org/TR/selectors4/
        [SERVICE-WORKERS]
        Alex Russell; Jungkee Song; Jake Archibald. Service Workers. 25 June 2015. WD. URL: https://slightlyoff.github.io/ServiceWorker/spec/service_worker/ +
        [SVG] +
        Jon Ferraiolo. Scalable Vector Graphics (SVG) 1.0 Specification. 4 September 2001. REC. URL: http://www.w3.org/TR/SVG/
        [TOUCH-EVENTS]
        Doug Schepers; et al. Touch Events. 10 October 2013. REC. URL: http://dvcs.w3.org/hg/webevents/raw-file/v1/touchevents.html
        [UIEVENTS]
        Gary Kacmarcik; Travis Leithead. UI Events Specification. 15 December 2015. WD. URL: https://w3c.github.io/uievents/
        [URL]
        Anne van Kesteren; Sam Ruby. URL Standard. Living Standard. URL: https://url.spec.whatwg.org/ +
        [WEBGL] +
        Chris Marrin (Apple Inc.). WebGL Specification, Version 1.0. 10 February 2011. URL: https://www.khronos.org/registry/webgl/specs/1.0/
        [WEBIDL]
        Cameron McCormack; Boris Zbarsky. WebIDL Level 1. 8 March 2016. CR. URL: https://heycam.github.io/webidl/ +
        [XHR] +
        Anne van Kesteren. XMLHttpRequest Standard. Living Standard. URL: https://xhr.spec.whatwg.org/
        [XML]
        Tim Bray; et al. Extensible Markup Language (XML) 1.0 (Fifth Edition). 26 November 2008. REC. URL: http://www.w3.org/TR/xml
        [XML-NAMES] @@ -5955,6 +6084,8 @@

        Travis Leithead. DOM Parsing and Serialization. 17 June 2014. CR. URL: https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html
        [ELEMENTTRAVERSAL]
        Doug Schepers; Robin Berjon. Element Traversal Specification. 22 December 2008. REC. URL: http://www.w3.org/TR/ElementTraversal/ +
        [INDEXEDDB] +
        Nikunj Mehta; et al. Indexed Database API. 8 January 2015. REC. URL: http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
        [SELECTORS-API2]
        Lachlan Hunt. Selectors API Level 2. 17 October 2013. NOTE. URL: http://dev.w3.org/2006/webapi/selectors-api2/
        [UIEVENTS-20031107] From 17849035d8dab45f44c4a59fd0a6627ac90b56ec Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 15 Apr 2016 10:56:20 +0200 Subject: [PATCH 02/30] Meta: improve pull request instructions for DOM See https://github.com/whatwg/fetch/issues/276 for context. --- README.md | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index caa297f87..a6c9fd64b 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,71 @@ started, leave a comment on the issue or ask around [on IRC](https://wiki.whatwg ### Pull requests -See the [whatwg/html README](https://github.com/whatwg/html/blob/master/README.md) for the general -guidelines. Note that `source` is `dom.bs` and "Acknowledgements" is "Acknowledgments" here (I -know). Also, the DOM Standard uses [bikeshed](https://github.com/tabatkins/bikeshed) to generate -`dom.html`. (Do not worry if using that tool is too complicated, your pull request does not need to -contain the generated HTML.) +In short, change `dom.bs` and submit your patch, with a +[good commit message](https://github.com/erlang/otp/wiki/Writing-good-commit-messages). Consider +reading through the [WHATWG FAQ](https://wiki.whatwg.org/wiki/FAQ) if you are new here. + +Please add your name to the Acknowledgments section in your first pull request, even for trivial +fixes. The names are sorted lexicographically. + +To generate `dom.html`, [bikeshed](https://github.com/tabatkins/bikeshed) can be used. (Do not worry +if using that tool is too complicated, your pull request does not need to contain the generated HTML +to be accepted.) + +#### Formatting + +Use a column width of 100 characters. + +Do not use newlines inside "inline" elements, even if that means exceeding the column width +requirement. +```html +

        The +remove(tokens…) +method, when invoked, must run these steps: +``` +is okay and + ```html +

        The remove(tokens…) method, when +invoked, must run these steps: +``` +is not. + +Using newlines between "inline" element tag names and their content is also forbidden. (This +actually alters the content, by adding spaces.) That is +```html +token +``` +is fine and +```html +token + +``` +is not. + +An `

      • ` element always has a `

        ` element inside it, unless it's a child of `

          `. + +If a "block" element contains a single "block" element, do not put it on a newline. + +Do not indent for anything except a new "block" element. For instance +```html +
        • For each token in tokens, in given order, that is not in + tokens, append token to tokens. +``` +is not indented, but +```html +

            +
          1. +

            For each token in tokens, run these substeps: + +

              +
            1. If token is the empty string, throw a {{SyntaxError}} exception. +``` +is. + +End tags may be included (if done consistently) and attributes may be quoted (using double quotes), +though the prevelant theme is to omit end tags and not quote attributes (unless they contain a +space). ### Tests From e002d7811533e276c9927b237748c4e170f4cb10 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 8 Apr 2016 13:08:09 +0200 Subject: [PATCH 03/30] Enable an event listener to be invoked just once --- dom.bs | 47 ++++++++++++++++++++++++++++++++++++++--------- dom.html | 40 +++++++++++++++++++++++++++++++++++----- 2 files changed, 73 insertions(+), 14 deletions(-) diff --git a/dom.bs b/dom.bs index 082123e45..2af1964f6 100644 --- a/dom.bs +++ b/dom.bs @@ -966,7 +966,7 @@ for historical reasons.

               [Exposed=(Window,Worker)]
               interface EventTarget {
              -  void addEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options);
              +  void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options);
                 void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options);
                 boolean dispatchEvent(Event event);
               };
              @@ -979,6 +979,10 @@ dictionary EventListenerOptions {
                 boolean capture;
                 boolean passive;
               };
              +
              +dictionary AddEventListenerOptions : EventListenerOptions {
              +  boolean once;
              +};
               

              The {{EventTarget}} object represents the target to which an event is dispatched @@ -996,6 +1000,7 @@ when something has occurred.

            2. callback (an {{EventListener}})
            3. capture (a boolean, initially false)
            4. passive (a boolean, initially false) +
            5. once (a boolean, initially false)
            6. removed (a boolean for bookkeeping purposes, initially false)
        @@ -1031,6 +1036,9 @@ specified otherwise it returns null. callback will not cancel the event by invoking {{preventDefault()}}. This is used to enable performance optimizations described in [[#observing-event-listeners]]. + When set to true, options's once member indicates that the callback + will only be invoked once after which the event listener will be removed. + The event listener is appended to target's list of event listeners and is not appended if it is a duplicate, i.e., having the same type, callback, capture and passive values. @@ -1048,7 +1056,8 @@ specified otherwise it returns null. {{Event/preventDefault()}} method was not invoked, and false otherwise.
      • -

        To flatten options run these steps: +

        To flatten options, run these +steps:

        1. Let capture and passive be false. @@ -1064,6 +1073,21 @@ specified otherwise it returns null.

        2. Return capture and passive.

        +

        To flatten more options, run these +steps: + +

          +
        1. Let capture and passive be the result of flattening + options. + +

        2. Let once be false. + +

        3. If options is a dictionary and {{AddEventListenerOptions/once}} is + present in options with value true, then set once to true. + +

        4. Return capture, passive, and once. +

        +

        The addEventListener(type, callback, options) method, when invoked, must run these steps: @@ -1080,14 +1104,15 @@ method, when invoked, must run these steps:

      • If callback is null, terminate these steps. -

      • Let capture and passive be the result of flattening - options. +

      • Let capture, passive, and once be the result of + flattening more options. -

      • Append an event listener to the associated list of event listeners with - type set to type, callback set to callback, capture - set to capture, and passive set to passive unless there already is an - event listener in that list with the same type, callback, capture, and - passive. +

      • If context object's associated list of event listener does not contain an + event listener whose type is type, callback is callback, + capture is capture, and passive is passive, then append a new + event listener to it, whose type is type, callback is + callback, capture is capture, passive is passive, + and once is once.

        The @@ -1271,6 +1296,10 @@ an object with event, run these steps:

      • Unset event's in passive listener flag. +

      • If listener's once is true, then set listener's + removed to true and remove it from object's associated list of + event listeners. +

      • If event's stop immediate propagation flag is set, return found. diff --git a/dom.html b/dom.html index 7e700d221..7ef3a0939 100644 --- a/dom.html +++ b/dom.html @@ -687,7 +687,7 @@

        3.6. Interface EventTarget

        [Exposed=(Window,Worker)]
         interface EventTarget {
        -  void addEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options);
        +  void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options);
           void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options);
           boolean dispatchEvent(Event event);
         };
        @@ -700,6 +700,10 @@ 

        capture; boolean passive; }; + +dictionary AddEventListenerOptions : EventListenerOptions { + boolean once; +};

        The EventTarget object represents the target to which an event is dispatched when something has occurred.

        Each EventTarget object has an associated list of event listeners.

        @@ -710,6 +714,7 @@

        callback (an EventListener)
      • capture (a boolean, initially false)
      • passive (a boolean, initially false) +
      • once (a boolean, initially false)
      • removed (a boolean for bookkeeping purposes, initially false)

      Although callback is an EventListener, as can be seen from the @@ -730,6 +735,7 @@

      event’s eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event’s eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event’s eventPhase attribute value is AT_TARGET.

      When set to true, optionspassive member indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in §3.7 Observing event listeners.

      +

      When set to true, options’s once member indicates that the callback will only be invoked once after which the event listener will be removed.

      The event listener is appended to target’s list of event listeners and is not appended if it is a duplicate, i.e., having the same type, callback, capture and passive values.

      target . removeEventListener(type, callback [, options]) @@ -738,7 +744,8 @@

      Dispatches a synthetic event event to target and returns true if either event’s cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

  • -

    To flatten options run these steps:

    +

    To flatten options, run these +steps:

    1. Let capture and passive be false.

      @@ -753,6 +760,19 @@

      Return capture and passive.

    +

    To flatten more options, run these +steps:

    +
      +
    1. +

      Let capture and passive be the result of flattening options.

      +
    2. +

      Let once be false.

      +
    3. +

      If options is a dictionary and once is + present in options with value true, then set once to true.

      +
    4. +

      Return capture, passive, and once.

      +

    The addEventListener(type, callback, options) method, when invoked, must run these steps:

    1. @@ -765,9 +785,10 @@

      If callback is null, terminate these steps.

    2. -

      Let capture and passive be the result of flattening options.

      +

      Let capture, passive, and once be the result of flattening more options.

    3. -

      Append an event listener to the associated list of event listeners with type set to type, callback set to callback, capture set to capture, and passive set to passive unless there already is an event listener in that list with the same type, callback, capture, and passive.

      +

      If context object’s associated list of event listener does not contain an event listener whose type is type, callback is callback, capture is capture, and passive is passive, then append a new event listener to it, whose type is type, callback is callback, capture is capture, passive is passive, + and once is once.

    The removeEventListener(type, callback, options) method, when invoked, must, run these steps

      @@ -911,6 +932,8 @@

      Call listener’s callback’s handleEvent(), with event as argument and event’s currentTarget attribute value as callback this value. If this throws any exception, report the exception.

    1. Unset event’s in passive listener flag.

      +
    2. +

      If listener’s once is true, then set listener’s removed to true and remove it from object’s associated list of event listeners.

    3. If event’s stop immediate propagation flag is set, return found.

      @@ -5125,6 +5148,7 @@

      acceptNode(node), in §6.3
    4. add(), in §7.1
    5. addedNodes, in §4.3.3 +
    6. AddEventListenerOptions, in §3.6
    7. addEventListener(type, callback), in §3.6
    8. addEventListener(type, callback, options), in §3.6
    9. add(tokens), in §7.1 @@ -5413,6 +5437,7 @@

      first child, in §2.1
    10. firstElementChild, in §4.2.6
    11. flatten, in §3.6 +
    12. flatten more, in §3.6
    13. following, in §2.1
    14. get an attribute by name, in §4.9
    15. get an attribute by namespace and local name, in §4.9 @@ -5665,6 +5690,7 @@

      observe(target, options), in §4.3.1
    16. offset, in §5.2
    17. oldValue, in §4.3.3 +
    18. once, in §3.6
    19. "open", in §4.8
    20. ordered set parser, in §2.3
    21. ordered set serializer, in §2.3 @@ -6138,7 +6164,7 @@

      I [Exposed=(Window,Worker)] interface EventTarget { - void addEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options); + void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options); void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options); boolean dispatchEvent(Event event); }; @@ -6152,6 +6178,10 @@

      I boolean passive; }; +dictionary AddEventListenerOptions : EventListenerOptions { + boolean once; +}; + [NoInterfaceObject, Exposed=Window] interface NonElementParentNode { From 346e32c67ba976e6e4c10db8be1d216f34cd7e3b Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 15 Apr 2016 15:59:28 +0200 Subject: [PATCH 04/30] Editorial: web compatibility typically remains relevant Fixes #210. --- dom.bs | 12 ++++++------ dom.html | 8 +++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/dom.bs b/dom.bs index 2af1964f6..9818d1425 100644 --- a/dom.bs +++ b/dom.bs @@ -2098,9 +2098,8 @@ steps:

      Mixin {{NonElementParentNode}}

      -

      The {{NonElementParentNode/getElementById()}} method is not on -elements for compatibility with older versions of jQuery. If a time comes where that -version of jQuery has disappeared, we might be able to support it. +

      Web compatibility prevents the {{NonElementParentNode/getElementById()}} +method from being exposed on elements (and therefore on {{ParentNode}}).

       [NoInterfaceObject,
      @@ -2313,9 +2312,9 @@ running scope-match a selectors string selectors against the
       
       

      Mixin {{NonDocumentTypeChildNode}}

      -

      The {{previousElementSibling}} and {{nextElementSibling}} attributes have -been removed from {{DocumentType}} nodes for compatibility reasons. If these additions are deemed -compatible enough in the future, they could be reinstated. +

      Web compatibility prevents the {{previousElementSibling}} and +{{nextElementSibling}} attributes from being exposed on doctypes (and therefore on +{{ChildNode}}).

       [NoInterfaceObject,
      @@ -9733,6 +9732,7 @@ Tobie Langel,
       Tom Pixley,
       Travis Leithead,
       triple-underscore,
      +Veli Senol,
       Vidur Apparao,
       Warren He,
       Yehuda Katz,
      diff --git a/dom.html b/dom.html
      index 7ef3a0939..d8bec6da8 100644
      --- a/dom.html
      +++ b/dom.html
      @@ -1319,8 +1319,7 @@ 

      oldNextSibling, and previousSibling oldPreviousSibling.

    4.2.4. Mixin NonElementParentNode

    -

    The getElementById() method is not on elements for compatibility with older versions of jQuery. If a time comes where that -version of jQuery has disappeared, we might be able to support it.

    +

    Web compatibility prevents the getElementById() method from being exposed on elements (and therefore on ParentNode).

    [NoInterfaceObject,
      Exposed=Window]
     interface NonElementParentNode {
    @@ -1420,9 +1419,7 @@ 

    The querySelectorAll(selectors) method, when invoked, must return the static result of running scope-match a selectors string selectors against the context object.

    4.2.7. Mixin NonDocumentTypeChildNode

    -

    The previousElementSibling and nextElementSibling attributes have -been removed from DocumentType nodes for compatibility reasons. If these additions are deemed -compatible enough in the future, they could be reinstated.

    +

    Web compatibility prevents the previousElementSibling and nextElementSibling attributes from being exposed on doctypes (and therefore on ChildNode).

    [NoInterfaceObject,
      Exposed=Window]
     interface NonDocumentTypeChildNode {
    @@ -5124,6 +5121,7 @@ 

    Acknowledgmen Tobie Langel, Tom Pixley, Travis Leithead, triple-underscore, +Veli Senol, Vidur Apparao, Warren He, Yehuda Katz, From b8d2854152aaabc412063c67bcb4177d8a2607a1 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 15 Apr 2016 14:26:46 +0200 Subject: [PATCH 05/30] Shadow: define attachShadow() for custom elements --- dom.bs | 8 +++++--- dom.html | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dom.bs b/dom.bs index 9818d1425..657261a36 100644 --- a/dom.bs +++ b/dom.bs @@ -6107,9 +6107,11 @@ method, when invoked, must run these steps: invoked, must run these steps:
      -
    1. If context object is not a custom element, and is not an - element whose namespace is the HTML namespace and - local name is +

    2. If context object's namespace is not the + HTML namespace, then throw a {{NotSupportedError}} exception. + +

    3. If context object's local name is not a + valid custom element name, "article", "aside", "blockquote", diff --git a/dom.html b/dom.html index d8bec6da8..629b9cd22 100644 --- a/dom.html +++ b/dom.html @@ -71,7 +71,7 @@

      DOM

      -

      Living Standard — Last Updated

      +

      Living Standard — Last Updated

      @@ -3483,7 +3483,9 @@

      1. -

        If context object is not a custom element, and is not an element whose namespace is the HTML namespace and local name is +

        If context object’s namespace is not the HTML namespace, then throw a NotSupportedError exception.

        +
      2. +

        If context object’s local name is not a valid custom element name, "article", "aside", "blockquote", From 9b8612a18d1348c3ca1f71ea1186f782107f6d1b Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Tue, 12 Apr 2016 14:17:15 -0700 Subject: [PATCH 06/30] Meta: make it easier to reference participate in a tree PR: https://github.com/whatwg/dom/pull/216 --- dom.bs | 3 ++- dom.html | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dom.bs b/dom.bs index 657261a36..831bc840c 100644 --- a/dom.bs +++ b/dom.bs @@ -234,7 +234,7 @@ A tree is a finite hierarchical tree structure traversal of a tree. -An object that participates in +An object that participates in a tree has a parent, which is either another object or null, and an ordered list of zero or more @@ -9671,6 +9671,7 @@ Jake Verbaten, James Graham, James Greene, James Robinson, +Jeffrey Yasskin, Jens Lindström, Jesse McCarthy, João Eiras, diff --git a/dom.html b/dom.html index 629b9cd22..e466b4b98 100644 --- a/dom.html +++ b/dom.html @@ -292,7 +292,7 @@

        2.1. Trees

        A tree is a finite hierarchical tree structure. In tree order is preorder, depth-first traversal of a tree.

        -

        An object that participates in +

        An object that participates in a tree has a parent, which is either another object or null, and an ordered list of zero or more child objects. An object A whose parent is object B is a child of B.

        The root of an object is itself, if its parent is null, or else it is the root of its parent. The root of a tree is any object participating in that tree whose parent is null.

        @@ -5063,6 +5063,7 @@

        Acknowledgmen James Graham, James Greene, James Robinson, +Jeffrey Yasskin, Jens Lindström, Jesse McCarthy, João Eiras, @@ -5706,6 +5707,8 @@

        parentNode(), in §6.2
      3. partially contained, in §5.2
      4. participate, in §2.1 +
      5. participate in a tree, in §2.1 +
      6. participates in a tree, in §2.1
      7. passive, in §3.6
      8. pointerBeforeReferenceNode, in §6.1
      9. position, in §5.2 From 36ef32ebc6c8318c1da27c2e9fa178398ff401f6 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Sat, 16 Apr 2016 06:22:16 +0200 Subject: [PATCH 07/30] Define node document for new Text nodes Fixes #224 and part of #212. Also fix part of #209 by stating these algorithms can rethrow exceptions. --- dom.bs | 74 +++++++++++++++++++++++++++----------------------------- dom.html | 59 ++++++++++++++++++++++++-------------------- 2 files changed, 69 insertions(+), 64 deletions(-) diff --git a/dom.bs b/dom.bs index 831bc840c..4fbea0ab6 100644 --- a/dom.bs +++ b/dom.bs @@ -2141,22 +2141,21 @@ standards that want to define APIs shared between documents and

        Mixin {{ParentNode}}

        -To -convert nodes into a node, -run these steps: +To convert nodes into a node, given +nodes and document, run these steps:
        1. Let node be null. -

        2. Replace each string in nodes with a {{Text}} node whose - data is the string. +

        3. Replace each string in nodes with a new {{Text}} node whose data is + the string and node document is document.

        4. If nodes contains one node, set node to that node. -

        5. Otherwise, set node to a new {{DocumentFragment}}, and then - append each node in nodes, if any, to it. Rethrow any - exceptions. +

        6. Otherwise, set node to a new {{DocumentFragment}} whose node document is + document, and then append each node in nodes, if any, to it. + Rethrow any exceptions.

        7. Return node.

        @@ -2272,10 +2271,11 @@ The method must run these steps:
          -
        1. Let node be the result of converting nodes into a node. +
        2. Let node be the result of converting nodes into a node given + nodes and context object's node document. Rethrow any exceptions. -

        3. Pre-insert node into the context object - before the context object's first child. +
        4. Pre-insert node into context object before the + context object's first child. Rethrow any exceptions.

        The @@ -2283,10 +2283,10 @@ The method must run these steps:
          -
        1. Let node be the result of converting nodes into a node. +
        2. Let node be the result of converting nodes into a node given + nodes and context object's node document. Rethrow any exceptions. -

        3. Append - node to the context object. +
        4. Append node to context object. Rethrow any exceptions.

          -
        1. Let node be null. +
        2. Let node be null. -

        3. If new value is not the empty string, set node to - a new {{Text}} node whose - data is new value. +
        4. If the given value is not the empty string, set node to a new {{Text}} + node whose data is the given value and node document is + context object's node document. -

        5. Replace all with - node within the context object. +
        6. Replace all with node within the context object.

        {{Text}}
        {{ProcessingInstruction}}
        {{Comment}} -
        Replace data with node - context object, offset 0, count - {{CharacterData/length}} attribute value, and - data new value. +

        Replace data with node context object, offset 0, count + {{CharacterData/length}} attribute value, and data the given value.

        Any other node -
        Do nothing. +

        Do nothing.


      @@ -6273,7 +6270,8 @@ method, when invoked, must return the result of running insert adjacent, method, when invoked, must run these steps:
        -
      1. Let text be a new Text object whose data is data. +

      2. Let text be a new {{Text}} node whose data is data and + node document is context object's node document.

      3. Run insert adjacent, given context object, where, and text. Rethrow any exceptions. diff --git a/dom.html b/dom.html index e466b4b98..89e09b70d 100644 --- a/dom.html +++ b/dom.html @@ -1346,18 +1346,18 @@

        <

        The DocumentOrShadowRoot mixin is expected to be used by other standards that want to define APIs shared between documents and shadow roots.

        4.2.6. Mixin ParentNode

        -

        To convert nodes into a node, -run these steps:

        +

        To convert nodes into a node, given nodes and document, run these steps:

        1. Let node be null.

        2. -

          Replace each string in nodes with a Text node whose data is the string.

          +

          Replace each string in nodes with a new Text node whose data is + the string and node document is document.

        3. If nodes contains one node, set node to that node.

        4. -

          Otherwise, set node to a new DocumentFragment, and then append each node in nodes, if any, to it. Rethrow any - exceptions.

          +

          Otherwise, set node to a new DocumentFragment whose node document is document, and then append each node in nodes, if any, to it. + Rethrow any exceptions.

        5. Return node.

        @@ -1407,13 +1407,17 @@

        The childElementCount attribute must return the number of children of the context object that are elements.

        The prepend(nodes) method must run these steps:

          -
        1. Let node be the result of converting nodes into a node. -
        2. Pre-insert node into the context object before the context object’s first child. +
        3. +

          Let node be the result of converting nodes into a node given nodes and context object’s node document. Rethrow any exceptions.

          +
        4. +

          Pre-insert node into context object before the context object’s first child. Rethrow any exceptions.

        The append(nodes) method must run these steps:

          -
        1. Let node be the result of converting nodes into a node. -
        2. Append node to the context object. +
        3. +

          Let node be the result of converting nodes into a node given nodes and context object’s node document. Rethrow any exceptions.

          +
        4. +

          Append node to context object. Rethrow any exceptions.

        The querySelector(selectors) method, when invoked, must return the first result of running scope-match a selectors string selectors against the context object, and null if the result is an empty list otherwise.

        The querySelectorAll(selectors) method, when invoked, must return the static result of @@ -1483,11 +1487,11 @@

        Let viablePreviousSibling be context object’s first preceding sibling not in nodes, and null otherwise.

      4. -

        Let node be the result of converting nodes into a node.

        +

        Let node be the result of converting nodes into a node, given nodes and context object’s node document. Rethrow any exceptions.

      5. If viablePreviousSibling is non-null, set it to viablePreviousSibling’s next sibling, and to parent’s first child otherwise.

      6. -

        Pre-insert node into parent before viablePreviousSibling.

        +

        Pre-insert node into parent before viablePreviousSibling. Rethrow any exceptions.

      The after(nodes) method, when invoked, must run these steps:

      @@ -1499,9 +1503,9 @@

      Let viableNextSibling be context object’s first following sibling not in nodes, and null otherwise.

    4. -

      Let node be the result of converting nodes into a node.

      +

      Let node be the result of converting nodes into a node, given nodes and context object’s node document. Rethrow any exceptions.

    5. -

      Pre-insert node into parent before viableNextSibling.

      +

      Pre-insert node into parent before viableNextSibling. Rethrow any exceptions.

    The replaceWith(nodes) method, when invoked, must run these steps:

    @@ -1513,12 +1517,12 @@

    Let viableNextSibling be context object’s first following sibling not in nodes, and null otherwise.

  • -

    Let node be the result of converting nodes into a node.

    +

    Let node be the result of converting nodes into a node, given nodes and context object’s node document. Rethrow any exceptions.

  • -

    If context object’s parent is parent, replace the context object with node within parent.

    +

    If context object’s parent is parent, replace the context object with node within parent. Rethrow any exceptions.

    Context object could have been inserted into node.

  • -

    Otherwise, pre-insert node into parent before viableNextSibling.

    +

    Otherwise, pre-insert node into parent before viableNextSibling. Rethrow any exceptions.

    The remove() method, when invoked, must run these steps:

    @@ -2104,26 +2108,29 @@

    textContent attribute’s setter must, if the new value is null, act as if it was the -empty string instead, and then do as described below, switching on context object:

    +

    The textContent attribute’s setter must, if the given value is null, act as if it was +the empty string instead, and then do as described below, switching on context object:

    DocumentFragment
    ShadowRoot
    Element
      -
    1. Let node be null. -
    2. If new value is not the empty string, set node to - a new Text node whose data is new value. -
    3. Replace all with node within the context object. +
    4. +

      Let node be null.

      +
    5. +

      If the given value is not the empty string, set node to a new Text node whose data is the given value and node document is context object’s node document.

      +
    6. +

      Replace all with node within the context object.

    Text
    ProcessingInstruction
    Comment -
    Replace data with node context object, offset 0, count length attribute value, and - data new value. +
    +

    Replace data with node context object, offset 0, count length attribute value, and data the given value.

    Any other node -
    Do nothing. +
    +

    Do nothing.


    @@ -3576,7 +3583,7 @@

    The insertAdjacentText(where, data) method, when invoked, must run these steps:

    1. -

      Let text be a new Text object whose data is data.

      +

      Let text be a new Text node whose data is data and node document is context object’s node document.

    2. Run insert adjacent, given context object, where, and text. Rethrow any exceptions.

    From 4b291d1a91a1e8b59997d4b021137d809706bd37 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 18 Apr 2016 14:03:35 +0200 Subject: [PATCH 08/30] Use a single concept for attribute changes This setup is still a little sketchy I think, but not more so than the insertion and removing steps. --- dom.bs | 98 +++++++++++++++++++++++++++++++------------------------- dom.html | 57 +++++++++++++++++++++----------- 2 files changed, 93 insertions(+), 62 deletions(-) diff --git a/dom.bs b/dom.bs index 4fbea0ab6..ee95ba62d 100644 --- a/dom.bs +++ b/dom.bs @@ -5573,11 +5573,10 @@ given a document, localName, prefix, names A is in its attribute list. -This specification uses and -applicable specifications can use the hooks an -attribute is set, an attribute is changed, an -attribute is added, and an attribute is removed, for -further processing of the attribute's value. +This and other specifications may define +attribute change steps for +elements. The algorithm is passed element, localName, +oldValue, value, and namespace. To change an attribute attribute @@ -5598,11 +5597,12 @@ to value, run these steps: list containing attribute's local name, attribute's value, value, and attribute's namespace. +
  • Run the attribute change steps with element, attribute's + local name, attribute's value, value, and + attribute's namespace. +

  • Set attribute's value to value. - -
  • An attribute is set and an - attribute is changed. To append an @@ -5623,14 +5623,15 @@ run these steps: list containing attribute's local name, null, attribute's value, and attribute's namespace. +
  • Run the attribute change steps with element, attribute's + local name, null, attribute's value, and + attribute's namespace. +

  • Append the attribute to the element's attribute list.
  • Set attribute's element to element. - -
  • An attribute is set and an - attribute is added. To remove an @@ -5652,14 +5653,16 @@ run these steps: list containing attribute's local name, attribute's value, null, and attribute's namespace. +
  • Run the attribute change steps with element, attribute's + local name, attribute's value, null, and + attribute's namespace. +

  • Remove attribute from the element's attribute list.
  • Set attribute's element to null. - -
  • An attribute is removed. To replace an @@ -5678,14 +5681,16 @@ in an element element, run these steps: value, newAttr's value, and oldAttr's namespace. +
  • Run the attribute change steps with element, oldAttr's + local name, oldAttr's value, newAttr's + value, and oldAttr's namespace. +

  • Replace oldAttr by newAttr in the element's attribute list.

  • Set oldAttr's element to null.

  • Set newAttr's element to element. - -

  • An attribute is set and an attribute is changed.


    @@ -5825,24 +5830,15 @@ the HTML id attribute and a DTD. This specification makes element, given by an id attribute. -When an element is created that -has an -id attribute whose -value is not the empty string or -when an element's -id attribute is -set to a -value other than the empty -string, set the element's -ID to the new -value. +

    Use these attribute change steps to update an element's ID: -When an element's -id attribute is -removed or -set to the empty string, unset the -element's -ID. +

      +
    1. If localName is id, namespace is null, and + value is null or the empty string, then unset element's ID. + +

    2. Otherwise, if localName is id, namespace is null, then + set element's ID to value. +

    While this specification defines requirements for class, id, and slot attributes on any element, it makes no @@ -9203,17 +9199,33 @@ are to return the result of running get an attribute value given the asso


    -

    When a {{DOMTokenList}} object is created and its associated element -has an -associated attribute's local name attribute or -associated element's -associated attribute's local name attribute is -set, set tokens to the new value, -parsed. - -

    When an associated element's -associated attribute's local name attribute is -removed, set tokens to the empty set. +

    A {{DOMTokenList}} object has these attribute change steps for its associated +element: + +

      +
    1. If localName is associated attribute's local name, + namespace is null, and value is null, then set tokens to the empty + set. + +

    2. Otherwise, localName is associated attribute's local name, + namespace is null, then set tokens to value, + parsed. +

    + +

    When a {{DOMTokenList}} object is created, run these substeps: + +

      +
    1. Let element be associated element. + +

    2. Let localName be associated attribute's local name. + +

    3. Let value be the result of + getting an attribute given null, + localName, and element. + +

    4. Run the attribute change steps for element, localName, + value, value, and null. +

    tokenlist . {{DOMTokenList/length}} diff --git a/dom.html b/dom.html index 89e09b70d..49f7ea230 100644 --- a/dom.html +++ b/dom.html @@ -71,7 +71,7 @@

    DOM

    -

    Living Standard — Last Updated

    +

    Living Standard — Last Updated

    @@ -3218,16 +3218,16 @@

    Return result.

    Elements also have an ordered attribute list exposed through a NamedNodeMap. Unless explicitly given when an element is created, its attribute list is empty. An element has an attribute A if A is in its attribute list.

    -

    This specification uses and applicable specifications can use the hooks an attribute is set, an attribute is changed, an attribute is added, and an attribute is removed, for -further processing of the attribute’s value.

    +

    This and other specifications may define attribute change steps for elements. The algorithm is passed element, localName, oldValue, value, and namespace.

    To change an attribute attribute from an element element to value, run these steps:

    1. Queue a mutation record of "attributes" for element with name attribute’s local name, namespace attribute’s namespace, and oldValue attribute’s value.
    2. If element is custom, then enqueue a custom element callback reaction with element, callback name "attributeChangedCallback", and an argument list containing attribute’s local name, attribute’s value, value, and attribute’s namespace. +
    3. +

      Run the attribute change steps with element, attribute’s local name, attribute’s value, value, and attribute’s namespace.

    4. Set attribute’s value to value. -
    5. An attribute is set and an attribute is changed.

    To append an attribute attribute to an element element, @@ -3238,9 +3238,10 @@

    If element is custom, then enqueue a custom element callback reaction with element, callback name "attributeChangedCallback", and an argument list containing attribute’s local name, null, attribute’s value, and attribute’s namespace. +
  • +

    Run the attribute change steps with element, attribute’s local name, null, attribute’s value, and attribute’s namespace.

  • Append the attribute to the element’s attribute list.
  • Set attribute’s element to element. -
  • An attribute is set and an attribute is added.

    To remove an attribute attribute from an element element, run these steps:

    @@ -3249,9 +3250,10 @@

    element with name attribute’s local name, namespace attribute’s namespace, and oldValue attribute’s value.
  • If element is custom, then enqueue a custom element callback reaction with element, callback name "attributeChangedCallback", and an argument list containing attribute’s local name, attribute’s value, null, and attribute’s namespace. +
  • +

    Run the attribute change steps with element, attribute’s local name, attribute’s value, null, and attribute’s namespace.

  • Remove attribute from the element’s attribute list.
  • Set attribute’s element to null. -
  • An attribute is removed.

    To replace an attribute oldAttr by an attribute newAttr in an element element, run these steps:

      @@ -3261,14 +3263,14 @@

      oldAttr’s value.

    1. If element is custom, then enqueue a custom element callback reaction with element, callback name "attributeChangedCallback", and an argument list containing oldAttr’s local name, oldAttr’s value, newAttr’s value, and oldAttr’s namespace. +
    2. +

      Run the attribute change steps with element, oldAttr’s local name, oldAttr’s value, newAttr’s value, and oldAttr’s namespace.

    3. Replace oldAttr by newAttr in the element’s attribute list.

    4. Set oldAttr’s element to null.

    5. Set newAttr’s element to element.

      -
    6. -

      An attribute is set and an attribute is changed.


    To get an attribute by name given a qualifiedName and element element, run these steps:

    @@ -3339,10 +3341,14 @@

    Historically elements could have multiple identifiers e.g., by using the HTML id attribute and a DTD. This specification makes ID a concept of the DOM and allows for only one per element, given by an id attribute.

    -

    When an element is created that has an id attribute whose value is not the empty string or -when an element’s id attribute is set to a value other than the empty -string, set the element’s ID to the new value.

    -

    When an element’s id attribute is removed or set to the empty string, unset the element’s ID.

    +

    Use these attribute change steps to update an element’s ID:

    +
      +
    1. +

      If localName is id, namespace is null, and value is null or the empty string, then unset element’s ID.

      +
    2. +

      Otherwise, if localName is id, namespace is null, then + set element’s ID to value.

      +

    While this specification defines requirements for class, id, and slot attributes on any element, it makes no claims as to whether using them is conforming or not.


    @@ -4735,9 +4741,25 @@

    set an attribute value for the associated element using associated attribute’s local name and the result of running the ordered set serializer for tokens.

    A DOMTokenList object’s serialize steps are to return the result of running get an attribute value given the associated element and the associated attribute’s local name.


    -

    When a DOMTokenList object is created and its associated element has an associated attribute’s local name attribute or -associated element’s associated attribute’s local name attribute is set, set tokens to the new value, parsed.

    -

    When an associated element’s associated attribute’s local name attribute is removed, set tokens to the empty set.

    +

    A DOMTokenList object has these attribute change steps for its associated element:

    +
      +
    1. +

      If localName is associated attribute’s local name, namespace is null, and value is null, then set tokens to the empty + set.

      +
    2. +

      Otherwise, localName is associated attribute’s local name, namespace is null, then set tokens to value, parsed.

      +
    +

    When a DOMTokenList object is created, run these substeps:

    +
      +
    1. +

      Let element be associated element.

      +
    2. +

      Let localName be associated attribute’s local name.

      +
    3. +

      Let value be the result of getting an attribute given null, localName, and element.

      +
    4. +

      Run the attribute change steps for element, localName, value, value, and null.

      +
    tokenlist . length
    @@ -5180,11 +5202,8 @@

    AT_TARGET, in §3.2
  • Attr, in §4.9.2
  • attribute, in §4.9.2 +
  • attribute change steps, in §4.9
  • attributeFilter, in §4.3.1 -
  • attribute is added, in §4.9 -
  • attribute is changed, in §4.9 -
  • attribute is removed, in §4.9 -
  • attribute is set, in §4.9
  • attribute list
      From a9d2a37f85baffa82e0cf16ec2a552c6ab4e527d Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Mon, 18 Apr 2016 16:43:00 +0300 Subject: [PATCH 09/30] SVGEvent is only Gecko, Blink also has SVGEvents As pointed out by zcorpan in #227. --- dom.bs | 4 ++-- dom.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dom.bs b/dom.bs index ee95ba62d..eea6ded90 100644 --- a/dom.bs +++ b/dom.bs @@ -4956,7 +4956,7 @@ invoked, must run these steps: "errorevent"{{ErrorEvent}} "event"{{Event}} "events" - + "focusevent"{{FocusEvent}}[[!UIEVENTS]] "hashchangeevent"{{HashChangeEvent}}[[!HTML]] "htmlevents"{{Event}} @@ -4969,7 +4969,7 @@ invoked, must run these steps: "popstateevent"{{PopStateEvent}} "progressevent"{{ProgressEvent}}[[!XHR]] "storageevent"{{StorageEvent}}[[!HTML]] - "svgevent"{{Event}} + "svgevents"{{Event}} "svgzoomevent"{{SVGZoomEvent}}[[!SVG]] "svgzoomevents" "textevent"{{CompositionEvent}}[[!UIEVENTS]] diff --git a/dom.html b/dom.html index 49f7ea230..a6f45b96d 100644 --- a/dom.html +++ b/dom.html @@ -2835,7 +2835,7 @@

      StorageEvent [HTML] - "svgevent" + "svgevents" Event From 537e579fac8d0a99544d798bb7d46660e59ffc78 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Wed, 13 Apr 2016 15:58:42 +0300 Subject: [PATCH 10/30] Set createDocument()'s content type based on namespace Fixes #217. PR: https://github.com/whatwg/dom/pull/218 --- dom.bs | 17 +++++++++++++++++ dom.html | 12 ++++++++++++ 2 files changed, 29 insertions(+) diff --git a/dom.bs b/dom.bs index eea6ded90..a1c6b8289 100644 --- a/dom.bs +++ b/dom.bs @@ -443,6 +443,9 @@ added. The HTML namespace is http://www.w3.org/1999/xhtml. +The SVG namespace is +http://www.w3.org/2000/svg. + The XML namespace is http://www.w3.org/XML/1998/namespace. @@ -5136,6 +5139,20 @@ method, when invoked, must run these steps:
    • document's origin is the origin of the context object's associated document. [[!HTML]] +

    • +

      document's content type is determined by namespace: + +

      +
      HTML namespace +
      application/xhtml+xml + +
      SVG namespace +
      image/svg+xml + +
      Any other namespace +
      application/xml +
      +
    • Return document. diff --git a/dom.html b/dom.html index a6f45b96d..d65960af0 100644 --- a/dom.html +++ b/dom.html @@ -385,6 +385,7 @@

      added.

      2.5. Namespaces

      The HTML namespace is http://www.w3.org/1999/xhtml.

      +

      The SVG namespace is http://www.w3.org/2000/svg.

      The XML namespace is http://www.w3.org/XML/1998/namespace.

      The XMLNS namespace is http://www.w3.org/2000/xmlns/.

      To validate a qualifiedName, run these steps:

      @@ -2960,6 +2961,16 @@

    • document’s origin is the origin of the context object’s associated document. [HTML]

      +
    • +

      document’s content type is determined by namespace:

      +
      +
      HTML namespace +
      application/xhtml+xml +
      SVG namespace +
      image/svg+xml +
      Any other namespace +
      application/xml +
    • Return document.

      @@ -5926,6 +5937,7 @@

      supported tokens, in §7.1
    • supports(token), in §7.1
    • surroundContents(newParent), in §5.2 +
    • SVG namespace, in §2.5
    • system ID, in §4.6
    • systemId, in §4.6
    • tagName, in §4.9 From cb7c16b764d64e43da1f9d62da7d4066341ff0e5 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Tue, 19 Apr 2016 07:47:21 +0200 Subject: [PATCH 11/30] Make document.createEvent("touchevent") sometimes throw Browsers typically disable touch events on non-touch devices, and there exists web content that detects this difference using document.createEvent(). Fixes #227. --- dom.bs | 27 ++++++++++++++++----------- dom.html | 48 ++++++++++++++++++++++++++++++++++-------------- 2 files changed, 50 insertions(+), 25 deletions(-) diff --git a/dom.bs b/dom.bs index a1c6b8289..2559a0a22 100644 --- a/dom.bs +++ b/dom.bs @@ -4931,17 +4931,16 @@ method, when invoked, must run these steps:
      -The createEvent(interface) method, when +

      The createEvent(interface) method, when invoked, must run these steps:

        -
      1. Let constructor be null. +
      2. Let constructor be null.

      3. - If interface is an - ASCII case-insensitive match for any of the strings in the - first column in the following table, set constructor to the - interface in the second column on the same row as the matching string: +

        If interface is an ASCII case-insensitive match for any of the strings in the + first column in the following table, then set constructor to the interface in the + second column on the same row as the matching string: @@ -4985,16 +4984,22 @@ invoked, must run these steps:
        "wheelevent"{{WheelEvent}}[[!UIEVENTS]]
        -

      4. If constructor is null, throw a - {{NotSupportedError}}. +
      5. If constructor is null, then throw a {{NotSupportedError}}. -

      6. Let event be the result of invoking the initial +
      7. +

        If the initial value of constructor is undefined, then throw a + {{NotSupportedError}}. + +

        Typically user agents disable support for touch events in some configurations, in + which case the initial value of {{TouchEvent}} is undefined. + +

      8. Let event be the result of invoking the initial value of constructor with the empty string as argument. -

      9. Unset event's initialized flag. +
      10. Unset event's initialized flag. -

      11. Return event. +
      12. Return event.

      Event constructors ought to be used instead. diff --git a/dom.html b/dom.html index d65960af0..249151210 100644 --- a/dom.html +++ b/dom.html @@ -71,7 +71,7 @@

      DOM

      -

      Living Standard — Last Updated

      +

      Living Standard — Last Updated

      @@ -2737,13 +2737,14 @@


      The createEvent(interface) method, when -invoked, must run these steps:

      +invoked, must run these steps:

        -
      1. Let constructor be null.
      2. - If interface is an ASCII case-insensitive match for any of the strings in the - first column in the following table, set constructor to the - interface in the second column on the same row as the matching string: +

        Let constructor be null.

        +
      3. +

        If interface is an ASCII case-insensitive match for any of the strings in the + first column in the following table, then set constructor to the interface in the + second column on the same row as the matching string:

        @@ -2876,11 +2877,19 @@

        WheelEvent

        [UIEVENTS]
        -
      4. If constructor is null, throw a NotSupportedError. -
      5. Let event be the result of invoking the initial - value of constructor with the empty string as argument. -
      6. Unset event’s initialized flag. -
      7. Return event. +
      8. +

        If constructor is null, then throw a NotSupportedError.

        +
      9. +

        If the initial value of constructor is undefined, then throw a NotSupportedError.

        +

        Typically user agents disable support for touch events in some configurations, in + which case the initial value of TouchEvent is undefined.

        +
      10. +

        Let event be the result of invoking the initial + value of constructor with the empty string as argument.

        +
      11. +

        Unset event’s initialized flag.

        +
      12. +

        Return event.

      Event constructors ought to be used instead.


      @@ -3183,7 +3192,7 @@

      Set result to Construct(C). Rethrow any exceptions.

    • -

      If result does not implement the HTMLElement interface, throw a TypeError exception.

      +

      If result does not implement the HTMLElement interface, throw a TypeError exception.

      This is meant to be a brand check to ensure that the object was allocated by the HTMLElement constructor. See webidl #97 about making this more precise.

    • @@ -4929,7 +4938,7 @@

      8.2. DOM Core

      These are the changes made to the features described in DOM Level 3 Core.

      -

      DOMString, DOMException, and DOMTimeStamp are now defined in Web IDL.

      +

      DOMString, DOMException, and DOMTimeStamp are now defined in Web IDL.

      Node now inherits from EventTarget.

      Nodes are implicitly adopted across document boundaries.

      Doctypes now always have a node document and can be moved @@ -6020,7 +6029,6 @@

      [ECMASCRIPT] defines the following terms:
    • [css-animations-1] defines the following terms: @@ -6090,7 +6098,19 @@

      [WEBIDL] defines the following terms:

    References

    From 81566a31a393d6fc07332f92a2a5d551dc7c96bd Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 19 Apr 2016 08:42:20 +0200 Subject: [PATCH 12/30] Shadow: define slotchange event MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shadow: define slotchange event Fixes https://github.com/w3c/webcomponents/issues/288. This defines the slotchange event in response to remove/insert operations, changes to a slot’s name attribute, and changes to an element’s slot attribute. This also introduces the assigned nodes concept for slots, and assigned slot concept for slotables. Slotables now also have a name, rather than a “get name”. The slotchange event dispatches just after mutation observers have their callbacks invoked. The slotchange event is not yet marked scoped as scoped events are not yet defined in the DOM Standard. Note: although the original issue did not mention it, this also suppresses signaling when slots are removed from a tree. Not just when they are inserted. --- dom.bs | 178 +++++++++++++++++++++++++++++++++++++++++++++++++------ dom.html | 152 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 296 insertions(+), 34 deletions(-) diff --git a/dom.bs b/dom.bs index 2559a0a22..81d63ffe6 100644 --- a/dom.bs +++ b/dom.bs @@ -1518,27 +1518,78 @@ itself.

    A slot has an associated name (a string). Unless stated otherwise it is the empty string.

    +

    Use these attribute change steps to update a slot's name: + +

      +
    1. +

      If element is a slot, localName is name, and + namespace is null, then: + +

        +
      1. If value is oldValue, then return. + +

      2. If value is null and oldValue is the empty string, then return. + +

      3. If value is the empty string and oldValue is null, then return. + +

      4. If value is null or the empty string, then set element's + name to the empty string. + +

      5. Otherwise, set element's name to value. + +

      6. Run assign slotables for a tree with element's tree. +

      +
    +

    The first slot in a shadow tree, in tree order, whose name is the empty string, is sometimes known as the "default slot".

    +

    A slot has an associated assigned nodes (a list of +slotables). Unless stated otherwise it is empty.

    +
    Slotables

    {{Element}} and {{Text}} nodes are slotables.

    -

    A slotable has a get name algorithm, which runs these steps:

    +

    A slot can be a slotable. + +

    A slotable has an associated name (a string). Unless stated +otherwise it is the empty string.

    + +

    Use these attribute change steps to update a slotable's name:

      -
    1. If context object is a {{Text}} node, then return the empty string.

    2. +
    3. +

      If localName is slot and namespace is null, then: -

    4. Return the result of running get an attribute value given context object and - "slot".

    5. +
        +
      1. If value is oldValue, then return. + +

      2. If value is null and oldValue is the empty string, then return. + +

      3. If value is the empty string and oldValue is null, then return. + +

      4. If value is null or the empty string, then set element's + name to the empty string. + +

      5. Otherwise, set element's name to value. + +

      6. If element's assigned slot is non-null, then run + assign slotables for element's assigned slot. + +

      7. Run assign a slot for element. +

    +

    A slotable has an associated assigned slot (null or a +slot). Unless stated otherwise it is null.

    +
    Finding slots and slotables
    -

    To find a slot for a given slotable slotable and an optional -open flag (unset unless stated otherwise), run these steps:

    +

    To find a slot for a given slotable +slotable and an optional open flag (unset unless stated otherwise), run these +steps:

    1. If slotable's parent is null, then return null.

    2. @@ -1551,14 +1602,12 @@ otherwise it is the empty string.

    3. If the open flag is set and shadow's mode is not "open", then return null.

    4. -
    5. Let name be the result of running slotable's - get name.

    6. -
    7. Return the first slot in shadow's tree whose name - is name, if any, and null otherwise.

    8. + is slotable's name, if any, and null otherwise.

    -

    To find slotables for a given slot slot, run these steps:

    +

    To find slotables for a given slot +slot, run these steps:

    1. Let result be an empty list.

    2. @@ -1574,7 +1623,7 @@ otherwise it is the empty string.

      tree order, run these substeps:

        -
      1. Let foundSlot be the result of running find a slot given +

      2. Let foundSlot be the result of finding a slot given slotable.

      3. If foundSlot is slot, then append slotable to @@ -1585,13 +1634,14 @@ otherwise it is the empty string.

      4. Return result.

      -

      To find distributed slotables for a given slot slot, run these -steps:

      +

      To +find distributed slotables for +a given slot slot, run these steps:

      1. Let result be an empty list.

      2. -
      3. Let slotables be the result of running find slotables given +

      4. Let slotables be the result of finding slotables given slot.

      5. If slotables is the empty list, then append each slotable @@ -1605,8 +1655,8 @@ steps:

        If node is a slot, run these subsubsteps:

          -
        1. Let temporaryResult be the result of running - find distributed slotables given node.

        2. +
        3. Let temporaryResult be the result of finding flattened slotables given + node.

        4. Append each slotable in temporaryResult, in order, to result.

        5. @@ -1619,6 +1669,66 @@ steps:

        6. Return result.

        +
        Assigning slotables and slots
        + +

        To assign slotables, for a slot slot with an optional +suppress signaling flag (unset unless stated otherwise), run these steps: + +

          +
        1. Let slotables be the result of finding slotables for slot. + +

        2. If suppress signaling flag is unset, and slotables and + slot's assigned nodes are not identical, then run signal a slot change for + slot. + +

        3. Set slot's assigned nodes to slotables. + +

        4. For each slotable in slotables, set slotable's + assigned slot to slot. +

        + +

        To assign slotables for a tree, given a tree tree and an optional +set of slots noSignalSlots (empty unless stated otherwise), run these steps for +each slot slot in tree, in tree order: + +

          +
        1. Let suppress signaling flag be set, if slot is in + noSignalSlots, and unset otherwise.

        2. + +
        3. Run assign slotables for slot with suppress signaling flag. +

        + +

        To assign a slot, given a slotable slotable, run these steps: + +

          +
        1. Let slot be the result of finding a slot with slotable. + +

        2. If slot is non-null, then run assign slotables for slot. +

        + +
        Signaling slot change
        + +

        Each unit of related similar-origin browsing contexts has a +signal slot list (a list of slots). Unless stated otherwise it is empty. +[[!HTML]] + +

        To signal a slot change, for a slot slot, run these steps: + +

          +
        1. If slot is not in unit of related similar-origin browsing contexts' + signal slot list, append slot to + unit of related similar-origin browsing contexts' signal slot list. + +

        2. If slot's assigned slot is non-null, then run signal a slot change + for slot's assigned slot. + +

        3. Otherwise, if slot's parent is a slot and slot's + parent's assigned nodes is the empty list, then run signal a slot change for + slot's parent. + +

        4. Queue a mutation observer compound microtask. +

        +

        Mutation algorithms

        @@ -1788,6 +1898,15 @@ into a parent before a child, with an optional
      6. Insert node into parent before child or at the end of parent if child is null. +

      7. If parent's shadow root is non-null and node is a + slotable, then assign a slot for node. + +

      8. If parent is a slot whose assigned nodes is the empty list, then + run signal a slot change for parent. + +

      9. Run assign slotables for a tree with node's tree and a set + containing each inclusive descendant of node that is a slot. +

      10. For each shadow-including inclusive descendant inclusiveDescendant of node, in shadow-including tree order, run these subsubsteps: @@ -2059,6 +2178,21 @@ steps:

      11. Remove node from its parent. +
      12. If node's assigned slot is non-null, then run assign slotables for + node's assigned slot. + +

      13. If parent is a slot whose assigned nodes is the empty list, then + run signal a slot change for parent. + +

      14. If node has an inclusive descendant that is a slot, then: + +

          +
        1. Run assign slotables for a tree with parent's tree. + +

        2. Run assign slotables for a tree with node's tree and a set + containing each inclusive descendant of node that is a slot. +

        +
      15. Run the removing steps with node and parent.

      16. @@ -2755,6 +2889,16 @@ To notify mutation observers, run these steps: callback this value. If this throws an exception, report the exception.
      + +
    3. Let signalList be a copy of + unit of related similar-origin browsing contexts' signal slot list. + +

    4. Empty unit of related similar-origin browsing contexts' signal slot list. + +

    5. For each slot slot in signalList, in order, + fire an event named slotchange, with its {{Event/bubbles}} attribute set to + true, at slot. +


    diff --git a/dom.html b/dom.html index 249151210..d904251a7 100644 --- a/dom.html +++ b/dom.html @@ -136,6 +136,8 @@

    Table of Contents

  • 4.2.2.1 Slots
  • 4.2.2.2 Slotables
  • 4.2.2.3 Finding slots and slotables +
  • 4.2.2.4 Assigning slotables and slots +
  • 4.2.2.5 Signaling slot change
  • 4.2.3 Mutation algorithms
  • 4.2.4 Mixin NonElementParentNode @@ -1063,19 +1065,57 @@
    A slot can only be created through HTML’s slot element.

    A slot has an associated name (a string). Unless stated otherwise it is the empty string.

    +

    Use these attribute change steps to update a slot’s name:

    +
      +
    1. +

      If element is a slot, localName is name, and namespace is null, then:

      +
        +
      1. +

        If value is oldValue, then return.

        +
      2. +

        If value is null and oldValue is the empty string, then return.

        +
      3. +

        If value is the empty string and oldValue is null, then return.

        +
      4. +

        If value is null or the empty string, then set element’s name to the empty string.

        +
      5. +

        Otherwise, set element’s name to value.

        +
      6. +

        Run assign slotables for a tree with element’s tree.

        +
      +

    The first slot in a shadow tree, in tree order, whose name is the empty string, is sometimes known as the "default slot".

    +

    A slot has an associated assigned nodes (a list of slotables). Unless stated otherwise it is empty.

    4.2.2.2. Slotables

    Element and Text nodes are slotables.

    -

    A slotable has a get name algorithm, which runs these steps:

    +

    A slot can be a slotable.

    +

    A slotable has an associated name (a string). Unless stated +otherwise it is the empty string.

    +

    Use these attribute change steps to update a slotable’s name:

    1. -

      If context object is a Text node, then return the empty string.

      -
    2. -

      Return the result of running get an attribute value given context object and - "slot".

      +

      If localName is slot and namespace is null, then:

      +
        +
      1. +

        If value is oldValue, then return.

        +
      2. +

        If value is null and oldValue is the empty string, then return.

        +
      3. +

        If value is the empty string and oldValue is null, then return.

        +
      4. +

        If value is null or the empty string, then set element’s name to the empty string.

        +
      5. +

        Otherwise, set element’s name to value.

        +
      6. +

        If element’s assigned slot is non-null, then run assign slotables for element’s assigned slot.

        +
      7. +

        Run assign a slot for element.

        +
    +

    A slotable has an associated assigned slot (null or a slot). Unless stated otherwise it is null.

    4.2.2.3. Finding slots and slotables
    -

    To find a slot for a given slotable slotable and an optional open flag (unset unless stated otherwise), run these steps:

    +

    To find a slot for a given slotable slotable and an optional open flag (unset unless stated otherwise), run these +steps:

    1. If slotable’s parent is null, then return null.

      @@ -1086,11 +1126,9 @@
    -

    To find slotables for a given slot slot, run these steps:

    +

    To find slotables for a given slot slot, run these steps:

    1. Let result be an empty list.

      @@ -1102,20 +1140,20 @@
    -

    To find distributed slotables for a given slot slot, run these -steps:

    +

    To find distributed slotables for +a given slot slot, run these steps:

    1. Let result be an empty list.

    2. -

      Let slotables be the result of running find slotables given slot.

      +

      Let slotables be the result of finding slotables given slot.

    3. If slotables is the empty list, then append each slotable child of slot, in tree order, to slotables.

    4. @@ -1125,7 +1163,7 @@
      4.2.2.4. Assigning slotables and slots
      +

      To assign slotables, for a slot slot with an optional suppress signaling flag (unset unless stated otherwise), run these steps:

      +
        +
      1. +

        Let slotables be the result of finding slotables for slot.

        +
      2. +

        If suppress signaling flag is unset, and slotables and slot’s assigned nodes are not identical, then run signal a slot change for slot.

        +
      3. +

        Set slot’s assigned nodes to slotables.

        +
      4. +

        For each slotable in slotables, set slotable’s assigned slot to slot.

        +
      +

      To assign slotables for a tree, given a tree tree and an optional +set of slots noSignalSlots (empty unless stated otherwise), run these steps for +each slot slot in tree, in tree order:

      +
        +
      1. +

        Let suppress signaling flag be set, if slot is in noSignalSlots, and unset otherwise.

        +
      2. +

        Run assign slotables for slot with suppress signaling flag.

        +
      +

      To assign a slot, given a slotable slotable, run these steps:

      +
        +
      1. +

        Let slot be the result of finding a slot with slotable.

        +
      2. +

        If slot is non-null, then run assign slotables for slot.

        +
      +
      4.2.2.5. Signaling slot change
      +

      Each unit of related similar-origin browsing contexts has a signal slot list (a list of slots). Unless stated otherwise it is empty. [HTML]

      +

      To signal a slot change, for a slot slot, run these steps:

      +
        +
      1. +

        If slot is not in unit of related similar-origin browsing contexts' signal slot list, append slot to unit of related similar-origin browsing contexts' signal slot list.

        +
      2. +

        If slot’s assigned slot is non-null, then run signal a slot change for slot’s assigned slot.

        +
      3. +

        Otherwise, if slot’s parent is a slot and slot’s parent’s assigned nodes is the empty list, then run signal a slot change for slot’s parent.

        +
      4. +

        Queue a mutation observer compound microtask.

        +

      4.2.3. Mutation algorithms

      To ensure pre-insertion validity of a node into a parent before a child, run these steps:

        @@ -1197,6 +1276,14 @@

      1. Insert node into parent before child or at the end of parent if child is null.

        +
      2. +

        If parent’s shadow root is non-null and node is a slotable, then assign a slot for node.

        +
      3. +

        If parent is a slot whose assigned nodes is the empty list, then + run signal a slot change for parent.

        +
      4. +

        Run assign slotables for a tree with node’s tree and a set + containing each inclusive descendant of node that is a slot.

      5. For each shadow-including inclusive descendant inclusiveDescendant of node, in shadow-including tree order, run these subsubsteps:

          @@ -1299,6 +1386,20 @@

          Let oldPreviousSibling be node’s previous sibling.
        1. Let oldNextSibling be node’s next sibling.
        2. Remove node from its parent. +
        3. +

          If node’s assigned slot is non-null, then run assign slotables for node’s assigned slot.

          +
        4. +

          If parent is a slot whose assigned nodes is the empty list, then + run signal a slot change for parent.

          +
        5. +

          If node has an inclusive descendant that is a slot, then:

          +
            +
          1. +

            Run assign slotables for a tree with parent’s tree.

            +
          2. +

            Run assign slotables for a tree with node’s tree and a set + containing each inclusive descendant of node that is a slot.

            +
        6. Run the removing steps with node and parent.

        7. @@ -1666,6 +1767,13 @@

          Remove all transient registered observers whose observer is mo.
        8. If queue is non-empty, call mo’s callback with queue as first argument, and mo (itself) as second argument and callback this value. If this throws an exception, report the exception.
        +
      6. +

        Let signalList be a copy of unit of related similar-origin browsing contexts' signal slot list.

        +
      7. +

        Empty unit of related similar-origin browsing contexts' signal slot list.

        +
      8. +

        For each slot slot in signalList, in order, fire an event named slotchange, with its bubbles attribute set to + true, at slot.


      Each node has an associated list of registered observers.

      @@ -5217,7 +5325,12 @@

      append(nodes...), in §4.2.6
    5. ASCII case-insensitive, in §2.2
    6. ASCII case-insensitively, in §2.2 +
    7. assign a slot, in §4.2.2.4 +
    8. assigned nodes, in §4.2.2.1 +
    9. assigned slot, in §4.2.2.2
    10. assignedSlot, in §4.2.9 +
    11. assign slotables, in §4.2.2.4 +
    12. assign slotables for a tree, in §4.2.2.4
    13. attachShadow(init), in §4.9
    14. AT_TARGET, in §3.2
    15. Attr, in §4.9.2 @@ -5476,7 +5589,10 @@

      FILTER_REJECT, in §6.3
    16. FILTER_SKIP, in §6.3
    17. find a slot, in §4.2.2.3 -
    18. find distributed slotables, in §4.2.2.3 +
    19. find flattened slotables, in §4.2.2.3 +
    20. finding a slot, in §4.2.2.3 +
    21. finding flattened slotables, in §4.2.2.3 +
    22. finding slotables, in §4.2.2.3
    23. find slotables, in §4.2.2.3
    24. fire an event, in §3.9
    25. firstChild(), in §6.2 @@ -5519,7 +5635,6 @@

      method for Node, in §8.2
    26. method for DOMImplementation, in §8.2 -
    27. get name, in §4.2.2.2
    28. getNamedItemNS(namespace, localName), in §4.9.1
    29. getNamedItem(qualifiedName), in §4.9.1
    30. get the parent, in §3.6 @@ -5661,6 +5776,7 @@

      dfn for slot, in §4.2.2.1 +
    31. dfn for slotable, in §4.2.2.2
    32. dfn for DocumentType, in §4.6
    33. attribute for DocumentType, in §4.6
    34. attribute for Attr, in §4.9.2 @@ -5909,6 +6025,8 @@

      SHOW_PROCESSING_INSTRUCTION, in §6.3
    35. SHOW_TEXT, in §6.3
    36. sibling, in §2.1 +
    37. signal a slot change, in §4.2.2.5 +
    38. signal slot list, in §4.2.2.5
    39. skip ASCII whitespace, in §2.3
    40. slot From 3536dd95dbc6bad216f414d34de6c6805db67e6f Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Mon, 18 Apr 2016 13:51:33 -0400 Subject: [PATCH 13/30] Editorial: update custom element cross-spec references --- dom.bs | 19 +++---------------- dom.html | 55 +++++++++++++++++++++++++++++++++---------------------- 2 files changed, 36 insertions(+), 38 deletions(-) diff --git a/dom.bs b/dom.bs index 81d63ffe6..08b5e184b 100644 --- a/dom.bs +++ b/dom.bs @@ -96,19 +96,6 @@ urlPrefix: https://slightlyoff.github.io/ServiceWorker/spec/service_worker/# text: service worker text: script resource text: has ever been evaluated flag -urlPrefix: https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html# - type: selector; url: dfn-defined; text: :defined - type: dfn; urlPrefix: dfn- - text: look up a custom element definition; url: look-up-custom-element-definition - text: type extension - text: name; url: element-definition-name; for: custom element definition - text: local name; url: element-definition-local-name; for: custom element definition - text: constructor; url: element-definition-constructor; for: custom element definition - text: upgrade an element; url: upgrade-a-custom-element - text: enqueue a custom element upgrade reaction; url: enqueue-upgrade - text: enqueue a custom element callback reaction; url: enqueue-lifecycle-callback - text: valid custom element name - text: try to upgrade an element; url: try-upgrade urlPrefix: https://tc39.github.io/ecma262/#; spec: ECMASCRIPT text: Construct; url: sec-construct; type: abstract-op text: TypeError; url: sec-native-error-types-used-in-this-standard-typeerror; type: exception @@ -4756,7 +4743,7 @@ for the context object. exception will be thrown. When supplied, options' is member can be used to create a - type extension. + customized built-in element.
      element = document . createElementNS(namespace, qualifiedName [, options]) @@ -4800,7 +4787,7 @@ for the context object. When supplied, options' is member can be used to create a - type extension. + customized built-in element.
      documentFragment = document . {{createDocumentFragment()}}
      Returns a {{DocumentFragment}} @@ -5620,7 +5607,7 @@ given a document, localName, prefix, names

      If definition is non-null, and definition's name is not equal to its local name (i.e., definition represents a - type extension), then: + customized built-in element), then:

      1. Let interface be the element interface for localName and the diff --git a/dom.html b/dom.html index d904251a7..14b172e4f 100644 --- a/dom.html +++ b/dom.html @@ -1293,11 +1293,11 @@

        If inclusiveDescendant is in a shadow-including document, then:

        1. -

          If inclusiveDescendant is custom, then enqueue a custom element callback reaction with inclusiveDescendant, +

          If inclusiveDescendant is custom, then enqueue a custom element callback reaction with inclusiveDescendant, callback name "connectedCallback", and an empty argument list.

        2. -

          Otherwise, try to upgrade inclusiveDescendant.

          -

          If this successfully upgrades inclusiveDescendant, its connectedCallback will be enqueued automatically during the upgrade an element algorithm.

          +

          Otherwise, try to upgrade inclusiveDescendant.

          +

          If this successfully upgrades inclusiveDescendant, its connectedCallback will be enqueued automatically during the upgrade an element algorithm.

    @@ -1403,7 +1403,7 @@

    Run the removing steps with node and parent.

  • -

    If node is custom, then enqueue a custom element callback reaction with node, callback name "disconnectedCallback", and an empty argument +

    If node is custom, then enqueue a custom element callback reaction with node, callback name "disconnectedCallback", and an empty argument list.

    It is intentional for now that custom elements do not get parent passed. This might change in the future if there is a need.

  • @@ -1412,7 +1412,7 @@

    Run the removing steps with descendant.

  • -

    If descendant is custom, then enqueue a custom element callback reaction with descendant, callback name +

    If descendant is custom, then enqueue a custom element callback reaction with descendant, callback name "disconnectedCallback", and an empty argument list.

  • For each inclusive ancestor inclusiveAncestor of parent, if inclusiveAncestor has any registered observers whose options' subtree is true, then for each @@ -2697,7 +2697,7 @@

    Returns an element in the HTML namespace with localName as local name. (In an HTML document localName is lowercased.)

    If localName does not match the Name production an InvalidCharacterError exception will be thrown.

    -

    When supplied, optionsis member can be used to create a type extension.

    +

    When supplied, optionsis member can be used to create a customized built-in element.

    element = document . createElementNS(namespace, qualifiedName [, options])
    Returns an element with namespace namespace. Its namespace prefix will @@ -2714,7 +2714,7 @@

    namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns". -

    When supplied, optionsis member can be used to create a type extension.

    +

    When supplied, optionsis member can be used to create a customized built-in element.

    documentFragment = document . createDocumentFragment()
    Returns a DocumentFragment node.
    text = document . createTextNode(data) @@ -2737,7 +2737,7 @@

    localName be converted to ASCII lowercase.
  • Let is be the value of is member of options, or null if no such member exists. -
  • Let definition be the result of looking up a custom element definition, given the context object, the HTML namespace, localName, and is. +
  • Let definition be the result of looking up a custom element definition, given the context object, the HTML namespace, localName, and is.
  • If is is non-null and definition is null, then throw a NotFoundError.
  • Let namespace be the HTML namespace, if the context object’s content type is "text/html" or "application/xhtml+xml", and null otherwise. @@ -2753,7 +2753,7 @@

    Let is be the value of is member of options, or null if no such member exists. -
  • Let definition be the result of looking up a custom element definition, given the context object, namespace, localName, and is. +
  • Let definition be the result of looking up a custom element definition, given the context object, namespace, localName, and is.
  • If is is non-null and definition is null, then throw a NotFoundError.
  • Let element be the result of creating an element given document, localName, prefix, namespace, is, @@ -3232,7 +3232,7 @@

    An element’s custom element state is one of "undefined", "uncustomized", or "custom". An element whose custom element state is "uncustomized" or "custom" is said to be defined. An element whose custom element state is "custom", is said to be custom.

    -

    Whether or not an element is defined is used to determine the behavior of the :defined pseudo-class. Whether or not an element is custom is used to determine the +

    Whether or not an element is defined is used to determine the behavior of the :defined pseudo-class. Whether or not an element is custom is used to determine the behavior of the mutation algorithms.

    @@ -3273,9 +3273,9 @@

    Let result be null.

  • -

    Let definition be the result of looking up a custom element definition given document, namespace, localName, and is.

    +

    Let definition be the result of looking up a custom element definition given document, namespace, localName, and is.

  • -

    If definition is non-null, and definition’s name is not equal to its local name (i.e., definition represents a type extension), then:

    +

    If definition is non-null, and definition’s name is not equal to its local name (i.e., definition represents a customized built-in element), then:

    1. Let interface be the element interface for localName and the HTML namespace.

      @@ -3284,9 +3284,9 @@

      namespace set to the HTML namespace, namespace prefix set to prefix, local name set to localName, custom element state set to "undefined", and node document set to document.

    2. -

      If the synchronous custom elements flag is set, upgrade element using definition.

      +

      If the synchronous custom elements flag is set, upgrade element using definition.

    3. -

      Otherwise, enqueue a custom element upgrade reaction given result and definition.

      +

      Otherwise, enqueue a custom element upgrade reaction given result and definition.

  • Otherwise, if definition is non-null, then:

    @@ -3295,7 +3295,7 @@

    If the synchronous custom elements flag is set:

    1. -

      Let C be definition’s constructor.

      +

      Let C be definition’s constructor.

    2. Set result to Construct(C). Rethrow any exceptions.

      @@ -3327,7 +3327,7 @@

      Set result to a new element that implements the HTMLElement interface, with no attributes, namespace set to the HTML namespace, namespace prefix set to prefix, local name set to localName, custom element state set to "undefined", and node document set to document.

    3. -

      Enqueue a custom element upgrade reaction given result and definition.

      +

      Enqueue a custom element upgrade reaction given result and definition.

  • @@ -3340,7 +3340,7 @@

    namespace set to namespace, namespace prefix set to prefix, local name set to localName, custom element state set to "uncustomized", and node document set to document.

  • -

    If document has a browsing context, and namespace is the HTML namespace, and either localName is a valid custom element name or is is is non-null, set result’s custom element state to "undefined".

    +

    If document has a browsing context, and namespace is the HTML namespace, and either localName is a valid custom element name or is is is non-null, set result’s custom element state to "undefined".

  • Return result.

    @@ -3351,7 +3351,7 @@

  • Queue a mutation record of "attributes" for element with name attribute’s local name, namespace attribute’s namespace, and oldValue attribute’s value. -
  • If element is custom, then enqueue a custom element callback reaction with element, callback name "attributeChangedCallback", and an argument +
  • If element is custom, then enqueue a custom element callback reaction with element, callback name "attributeChangedCallback", and an argument list containing attribute’s local name, attribute’s value, value, and attribute’s namespace.
  • Run the attribute change steps with element, attribute’s local name, attribute’s value, value, and attribute’s namespace.

    @@ -3364,7 +3364,7 @@

    Queue a mutation record of "attributes" for element with name attribute’s local name, namespace attribute’s namespace, and oldValue null. -
  • If element is custom, then enqueue a custom element callback reaction with element, callback name "attributeChangedCallback", and an argument +
  • If element is custom, then enqueue a custom element callback reaction with element, callback name "attributeChangedCallback", and an argument list containing attribute’s local name, null, attribute’s value, and attribute’s namespace.
  • Run the attribute change steps with element, attribute’s local name, null, attribute’s value, and attribute’s namespace.

    @@ -3376,7 +3376,7 @@

  • Queue a mutation record of "attributes" for element with name attribute’s local name, namespace attribute’s namespace, and oldValue attribute’s value. -
  • If element is custom, then enqueue a custom element callback reaction with element, callback name "attributeChangedCallback", and an argument +
  • If element is custom, then enqueue a custom element callback reaction with element, callback name "attributeChangedCallback", and an argument list containing attribute’s local name, attribute’s value, null, and attribute’s namespace.
  • Run the attribute change steps with element, attribute’s local name, attribute’s value, null, and attribute’s namespace.

    @@ -3389,7 +3389,7 @@

    Queue a mutation record of "attributes" for element with name oldAttr’s local name, namespace oldAttr’s namespace, and oldValue oldAttr’s value.

    -
  • If element is custom, then enqueue a custom element callback reaction with element, callback name "attributeChangedCallback", and an argument +
  • If element is custom, then enqueue a custom element callback reaction with element, callback name "attributeChangedCallback", and an argument list containing oldAttr’s local name, oldAttr’s value, newAttr’s value, and oldAttr’s namespace.
  • Run the attribute change steps with element, oldAttr’s local name, oldAttr’s value, newAttr’s value, and oldAttr’s namespace.

    @@ -3626,7 +3626,7 @@

    If context object’s namespace is not the HTML namespace, then throw a NotSupportedError exception.

  • -

    If context object’s local name is not a valid custom element name, +

    If context object’s local name is not a valid custom element name, "article", "aside", "blockquote", @@ -6167,6 +6167,7 @@

    [HTML] defines the following terms:
  • [selectors-4] defines the following terms: From a87873370266d1a1c59178fdf6375edd4d5a8f99 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Mon, 18 Apr 2016 13:55:41 -0400 Subject: [PATCH 14/30] Editorial: fix a few cross-linking missteps --- dom.bs | 10 +++++----- dom.html | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dom.bs b/dom.bs index 08b5e184b..bf63a6bfd 100644 --- a/dom.bs +++ b/dom.bs @@ -1002,7 +1002,7 @@ which takes an event event, and returns an {{EventTarget}} obj specified otherwise it returns null.

    Nodes and documents override the -get the parent algorithm. +get the parent algorithm.

    target . addEventListener(type, callback [, options]) @@ -5305,10 +5305,10 @@ method, when invoked, must run these steps: name and with its node document set to doc, to doc. -
  • Append a new <{html}> element in the HTML namespace, to +
  • Append a new <{html}> element in the HTML namespace, to doc. -
  • Append a new <{head}> element in the HTML namespace, to the +
  • Append a new <{head}> element in the HTML namespace, to the <{html}> element created earlier.
  • @@ -8831,7 +8831,7 @@ To traversebefore node is false, let node be the first node following - node in the iterator collection. If + node in the iterator collection. If there is no such node return null. If before node is true, set it to false.
    If direction is previous @@ -8839,7 +8839,7 @@ To traversebefore node is true, let node be the first node preceding - node in the iterator collection. If + node in the iterator collection. If there is no such node return null. If before node is false, set it to true.
  • diff --git a/dom.html b/dom.html index 14b172e4f..4dbf6f65c 100644 --- a/dom.html +++ b/dom.html @@ -725,7 +725,7 @@

    Each EventTarget object also has an associated get the parent algorithm, which takes an event event, and returns an EventTarget object. Unless specified otherwise it returns null.

    -

    Nodes and documents override the get the parent algorithm.

    +

    Nodes and documents override the get the parent algorithm.

    target . addEventListener(type, callback [, options])
    @@ -3096,8 +3096,8 @@

  • Let doc be a new document that is an HTML document.
  • Set doc’s content type to "text/html".
  • Append a new doctype, with "html" as its name and with its node document set to doc, to doc. -
  • Append a new html element in the HTML namespace, to doc. -
  • Append a new head element in the HTML namespace, to the html element created earlier. +
  • Append a new html element in the HTML namespace, to doc. +
  • Append a new head element in the HTML namespace, to the html element created earlier.
  • If the title argument is not omitted:
      @@ -4608,11 +4608,11 @@

      If direction is next -
      If before node is false, let node be the first node following node in the iterator collection. If +
      If before node is false, let node be the first node following node in the iterator collection. If there is no such node return null. If before node is true, set it to false.
      If direction is previous -
      If before node is true, let node be the first node preceding node in the iterator collection. If +
      If before node is true, let node be the first node preceding node in the iterator collection. If there is no such node return null. If before node is false, set it to true.
      From 5fc5624fb80648de46088cac06864b4048c1981c Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Mon, 18 Apr 2016 13:53:06 -0400 Subject: [PATCH 15/30] Editorial: make "is" and "prefix" optional in "create an element" --- dom.bs | 20 ++++++++++++-------- dom.html | 14 +++++++++----- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/dom.bs b/dom.bs index bf63a6bfd..249eecea4 100644 --- a/dom.bs +++ b/dom.bs @@ -3886,9 +3886,9 @@ dom-Range-extractContents, dom-Range-cloneContents -->

      If node is an element, then:

        -
      1. Let copy be the result of creating an element, given document, - node's local name, node's - namespace prefix, node's namespace, and the +

      2. Let copy be the result of creating an element, given + document, node's local name, node's + namespace, node's namespace prefix, and the value of node's is attribute if present (or null if not). The synchronous custom elements flag should be unset. @@ -4853,8 +4853,8 @@ invoked, must run these steps: "application/xhtml+xml", and null otherwise.

      3. Let element be the result of creating an element given the - context object, localName, null, namespace, is, and - with the synchronous custom elements flag set. Rethrow any exceptions. + context object, localName, namespace, null, is, and with + the synchronous custom elements flag set. Rethrow any exceptions.
      4. If is is non-null, then set an attribute value for element using "is" and is. @@ -4881,7 +4881,7 @@ invoked, must run these steps: {{NotFoundError}}.
      5. Let element be the result of creating an element given - document, localName, prefix, namespace, is, + document, localName, namespace, prefix, is, and with the synchronous custom elements flag set. Rethrow any exceptions.

      6. If is is non-null, then set an attribute value for element using @@ -5593,10 +5593,14 @@ required to do so. The standard has this concept for readability.

        To create an element, -given a document, localName, prefix, namespace, -is, and optional synchronous custom elements flag, run these steps: +given a document, localName, namespace, and optional +prefix, is, and synchronous custom elements flag, run these steps:

          +
        1. If prefix was not given, let prefix be null. + +

        2. If is was not given, let is be null. +

        3. Let result be null.

        4. Let definition be the result of diff --git a/dom.html b/dom.html index 4dbf6f65c..3866414e3 100644 --- a/dom.html +++ b/dom.html @@ -2292,7 +2292,7 @@

          element, then:

          1. -

            Let copy be the result of creating an element, given document, node’s local name, node’s namespace prefix, node’s namespace, and the +

            Let copy be the result of creating an element, given document, node’s local name, node’s namespace, node’s namespace prefix, and the value of node’s is attribute if present (or null if not). The synchronous custom elements flag should be unset.

          2. For each attribute in node’s attribute list, in order, run these substeps:

            @@ -2741,8 +2741,8 @@

            If is is non-null and definition is null, then throw a NotFoundError.
          3. Let namespace be the HTML namespace, if the context object’s content type is "text/html" or "application/xhtml+xml", and null otherwise. -
          4. Let element be the result of creating an element given the context object, localName, null, namespace, is, and - with the synchronous custom elements flag set. Rethrow any exceptions. +
          5. Let element be the result of creating an element given the context object, localName, namespace, null, is, and with + the synchronous custom elements flag set. Rethrow any exceptions.
          6. If is is non-null, then set an attribute value for element using "is" and is.
          7. Return element. @@ -2756,7 +2756,7 @@

            Let definition be the result of looking up a custom element definition, given the context object, namespace, localName, and is.
          8. If is is non-null and definition is null, then throw a NotFoundError.
          9. -

            Let element be the result of creating an element given document, localName, prefix, namespace, is, +

            Let element be the result of creating an element given document, localName, namespace, prefix, is, and with the synchronous custom elements flag set. Rethrow any exceptions.

          10. If is is non-null, then set an attribute value for element using "is" and is. @@ -3268,8 +3268,12 @@

            User agents could have this as an internal slot as an optimization, but are not required to do so. The standard has this concept for readability.

            To create an element, -given a document, localName, prefix, namespace, is, and optional synchronous custom elements flag, run these steps:

            +given a document, localName, namespace, and optional prefix, is, and synchronous custom elements flag, run these steps:

              +
            1. +

              If prefix was not given, let prefix be null.

              +
            2. +

              If is was not given, let is be null.

            3. Let result be null.

            4. From 7b42a54ee5876a1767d0a6007f2b9dc32b0034e3 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Mon, 18 Apr 2016 14:02:46 -0400 Subject: [PATCH 16/30] Use "create an element" in createHTMLDocument Takes care of part of #212. --- dom.bs | 36 ++++++++++++++++++------------------ dom.html | 38 ++++++++++++++++++++++++++------------ 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/dom.bs b/dom.bs index 249eecea4..154a4c576 100644 --- a/dom.bs +++ b/dom.bs @@ -5297,39 +5297,39 @@ The method, when invoked, must run these steps:
                -
              1. Let doc be a new document that is an HTML document. +
              2. Let doc be a new document that is an HTML document. -

              3. Set doc's content type to "text/html". +
              4. Set doc's content type to "text/html". -

              5. Append a new doctype, with "html" as its +
              6. Append a new doctype, with "html" as its name and with its node document set to doc, to doc. -

              7. Append a new <{html}> element in the HTML namespace, to - doc. +
              8. Append the result of creating an element given doc, <{html}>, and + the HTML namespace, to doc. -

              9. Append a new <{head}> element in the HTML namespace, to the - <{html}> element created earlier. +
              10. Append the result of creating an element given doc, <{head}>, and + the HTML namespace, to the <{html}> element created earlier.

              11. - If the title argument is not omitted: +

                If title is given:

                  -
                1. Append a new <{title}> element in the HTML namespace, to the <{head}> - element created earlier. +
                2. Append the result of creating an element given doc, <{title}>, + and the HTML namespace, to the <{head}> element created earlier. -

                3. Append a new {{Text}} node, with its data set to - title (which could be the empty string), to the <{title}> element created - earlier. +
                4. Append a new {{Text}} node, with its data set to + title (which could be the empty string) and its node document set to + doc, to the <{title}> element created earlier.

                -
              12. Append a new <{body}> element in the HTML namespace, to the <{html}> - element created earlier. +
              13. Append the result of creating an element given doc, <{body}>, and + the HTML namespace, to the <{html}> element created earlier.

              14. -
              15. doc's origin is the origin of the context object's associated - document. [[!HTML]] +
              16. doc's origin is the origin of the context object's + associated document. [[!HTML]] -

              17. Return doc. +
              18. Return doc.

              The hasFeature() method, when diff --git a/dom.html b/dom.html index 3866414e3..49fb0e902 100644 --- a/dom.html +++ b/dom.html @@ -3093,21 +3093,35 @@

            The createHTMLDocument(title) method, when invoked, must run these steps:

              -
            1. Let doc be a new document that is an HTML document. -
            2. Set doc’s content type to "text/html". -
            3. Append a new doctype, with "html" as its name and with its node document set to doc, to doc. -
            4. Append a new html element in the HTML namespace, to doc. -
            5. Append a new head element in the HTML namespace, to the html element created earlier.
            6. - If the title argument is not omitted: +

              Let doc be a new document that is an HTML document.

              +
            7. +

              Set doc’s content type to "text/html".

              +
            8. +

              Append a new doctype, with "html" as its name and with its node document set to doc, to doc.

              +
            9. +

              Append the result of creating an element given doc, html, and + the HTML namespace, to doc.

              +
            10. +

              Append the result of creating an element given doc, head, and + the HTML namespace, to the html element created earlier.

              +
            11. +

              If title is given:

                -
              1. Append a new title element in the HTML namespace, to the head element created earlier. -
              2. Append a new Text node, with its data set to title (which could be the empty string), to the title element created - earlier. +
              3. +

                Append the result of creating an element given doc, title, + and the HTML namespace, to the head element created earlier.

                +
              4. +

                Append a new Text node, with its data set to title (which could be the empty string) and its node document set to doc, to the title element created earlier.

              -
            12. Append a new body element in the HTML namespace, to the html element created earlier. -
            13. doc’s origin is the origin of the context object’s associated document. [HTML] -
            14. Return doc. +
            15. +

              Append the result of creating an element given doc, body, and + the HTML namespace, to the html element created earlier.

              +
            16. +

              doc’s origin is the origin of the context object’s + associated document. [HTML]

              +
            17. +

              Return doc.

            The hasFeature() method, when invoked, must return true.

            From e4b93c8c025a826bd163bf9148d729a2d429e4d2 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 19 Apr 2016 09:22:51 +0200 Subject: [PATCH 17/30] Editorial: align exception language with IDL --- dom.bs | 334 +++++++++++++++++++++---------------------------------- dom.html | 191 ++++++++++++++++--------------- 2 files changed, 228 insertions(+), 297 deletions(-) diff --git a/dom.bs b/dom.bs index 154a4c576..704632dff 100644 --- a/dom.bs +++ b/dom.bs @@ -49,19 +49,6 @@ urlPrefix: https://heycam.github.io/webidl/ text: supported property indices text: supported property names text: code unit - type: exception - text: HierarchyRequestError - text: IndexSizeError - text: InUseAttributeError - text: InvalidCharacterError - text: InvalidNodeTypeError - text: InvalidStateError - text: NamespaceError - text: NotFoundError - text: NotSupportedError - text: SyntaxError - text: WrongDocumentError - text: DOMException; urlPrefix: #dfn- type: interface; text: DOMTimeStamp; urlPrefix: #common- urlPrefix: https://html.spec.whatwg.org/multipage/ @@ -98,7 +85,6 @@ urlPrefix: https://slightlyoff.github.io/ServiceWorker/spec/service_worker/# text: has ever been evaluated flag urlPrefix: https://tc39.github.io/ecma262/#; spec: ECMASCRIPT text: Construct; url: sec-construct; type: abstract-op - text: TypeError; url: sec-native-error-types-used-in-this-standard-typeerror; type: exception

  • Elements also have an associated shadow root (null or a shadow root). It is null unless otherwise stated.

    -

    An element’s qualified name is its local name if its namespace prefix is null, and its namespace prefix, followed by ":", followed by its local name, otherwise.

    +

    An element’s qualified name is its local name if its namespace prefix is null, and its namespace prefix, followed by ":", followed by its local name, otherwise.

    User agents could have this as an internal slot as an optimization, but are not required to do so. The standard has this concept for readability.

    To create an element, @@ -3841,7 +3841,7 @@

    Attributes have a namespace (null or a non-empty string), namespace prefix (null or a non-empty string), local name (a non-empty string), value (a string), and element (null or an element).

    If designed today they would just have a name and value. ☹

    -

    An attribute’s qualified name is its local name if its namespace prefix is null, and its namespace prefix, followed by ":", followed by its local name, otherwise.

    +

    An attribute’s qualified name is its local name if its namespace prefix is null, and its namespace prefix, followed by ":", followed by its local name, otherwise.

    User agents could have this as an internal slot as an optimization, but are not required to do so. The standard has this concept for readability.

    When an attribute is created, its local name is given. Unless explicitly From 8ae87496beb249925a3a72cf62aee9987e3620eb Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 20 Apr 2016 15:52:45 +0200 Subject: [PATCH 21/30] Editorial: add "shadow host" and "assigned" as terms This makes a couple of non-null checks read better and enshrines a term we had already been using. --- dom.bs | 27 ++++++++++++++------------- dom.html | 19 ++++++++++--------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/dom.bs b/dom.bs index a2599114b..7231bfb6e 100644 --- a/dom.bs +++ b/dom.bs @@ -1544,15 +1544,16 @@ otherwise it is the empty string.

  • Otherwise, set element's name to value. -

  • If element's assigned slot is non-null, then run - assign slotables for element's assigned slot. +

  • If element is assigned, then run assign slotables + for element's assigned slot.

  • Run assign a slot for element.

    A slotable has an associated assigned slot (null or a -slot). Unless stated otherwise it is null.

    +slot). Unless stated otherwise it is null. A slotable is +assigned if its assigned slot is non-null.

    Finding slots and slotables
    @@ -1689,8 +1690,8 @@ steps: signal slot list, append slot to unit of related similar-origin browsing contexts' signal slot list. -
  • If slot's assigned slot is non-null, then run signal a slot change - for slot's assigned slot. +

  • If slot is assigned, then run signal a slot change for + slot's assigned slot.

  • Otherwise, if slot's parent is a slot and slot's parent's assigned nodes is the empty list, then run signal a slot change for @@ -1866,7 +1867,7 @@ into a parent before a child, with an optional

  • Insert node into parent before child or at the end of parent if child is null. -

  • If parent's shadow root is non-null and node is a +

  • If parent is a shadow host and node is a slotable, then assign a slot for node.

  • If parent is a slot whose assigned nodes is the empty list, then @@ -2142,7 +2143,7 @@ steps:

  • Remove node from its parent. -
  • If node's assigned slot is non-null, then run assign slotables for +

  • If node is assigned, then run assign slotables for node's assigned slot.

  • If parent is a slot whose assigned nodes is the empty list, then @@ -5404,10 +5405,9 @@ or "closed").

    shadow-including preorder, depth-first traversal of a node tree. shadow-including preorder, depth-first traversal of a node tree tree is preorder, depth-first traversal of tree, with for each -element element encountered in tree with a non-null -shadow root, shadow-including preorder, depth-first traversal of that -element's shadow root's node tree just after it is -encountered. +shadow host encountered in tree, +shadow-including preorder, depth-first traversal of that element's +shadow root's node tree just after it is encountered.

    The shadow-including root of an object is its root's host's shadow-including root, if the @@ -5548,7 +5548,8 @@ behavior of the mutation algorithms.

    Elements also have an associated shadow root (null or a -shadow root). It is null unless otherwise stated. +shadow root). It is null unless otherwise stated. An element is a +shadow host if its shadow root is non-null.

    An element's qualified name is its @@ -6245,7 +6246,7 @@ invoked, must run these steps: "section", or "span", then throw a {{NotSupportedError}}. -

  • If context object's shadow root is non-null, then throw an +

  • If context object is a shadow host, then throw an {{InvalidStateError}}.

  • Let shadow be a new shadow root whose node document is diff --git a/dom.html b/dom.html index 190933a1a..5eec5a139 100644 --- a/dom.html +++ b/dom.html @@ -1110,12 +1110,12 @@

    Otherwise, set element’s name to value.

  • -

    If element’s assigned slot is non-null, then run assign slotables for element’s assigned slot.

    +

    If element is assigned, then run assign slotables for element’s assigned slot.

  • Run assign a slot for element.

    -

    A slotable has an associated assigned slot (null or a slot). Unless stated otherwise it is null.

    +

    A slotable has an associated assigned slot (null or a slot). Unless stated otherwise it is null. A slotable is assigned if its assigned slot is non-null.

    4.2.2.3. Finding slots and slotables

    To find a slot for a given slotable slotable and an optional open flag (unset unless stated otherwise), run these steps:

    @@ -1211,7 +1211,7 @@

    If slot is not in unit of related similar-origin browsing contexts' signal slot list, append slot to unit of related similar-origin browsing contexts' signal slot list.

  • -

    If slot’s assigned slot is non-null, then run signal a slot change for slot’s assigned slot.

    +

    If slot is assigned, then run signal a slot change for slot’s assigned slot.

  • Otherwise, if slot’s parent is a slot and slot’s parent’s assigned nodes is the empty list, then run signal a slot change for slot’s parent.

  • @@ -1280,7 +1280,7 @@

    Insert node into parent before child or at the end of parent if child is null.

  • -

    If parent’s shadow root is non-null and node is a slotable, then assign a slot for node.

    +

    If parent is a shadow host and node is a slotable, then assign a slot for node.

  • If parent is a slot whose assigned nodes is the empty list, then run signal a slot change for parent.

    @@ -1390,7 +1390,7 @@

    Let oldNextSibling be node’s next sibling.
  • Remove node from its parent.
  • -

    If node’s assigned slot is non-null, then run assign slotables for node’s assigned slot.

    +

    If node is assigned, then run assign slotables for node’s assigned slot.

  • If parent is a slot whose assigned nodes is the empty list, then run signal a slot change for parent.

    @@ -3190,8 +3190,7 @@

    The mode attribute’s getter must return the context object’s mode.

    The host attribute’s getter must return the context object’s host.


    -

    In shadow-including tree order, is shadow-including preorder, depth-first traversal of a node tree. shadow-including preorder, depth-first traversal of a node tree tree is preorder, depth-first traversal of tree, with for each element element encountered in tree with a non-null shadow root, shadow-including preorder, depth-first traversal of that element’s shadow root’s node tree just after it is -encountered.

    +

    In shadow-including tree order, is shadow-including preorder, depth-first traversal of a node tree. shadow-including preorder, depth-first traversal of a node tree tree is preorder, depth-first traversal of tree, with for each shadow host encountered in tree, shadow-including preorder, depth-first traversal of that element’s shadow root’s node tree just after it is encountered.

    The shadow-including root of an object is its root’s host’s shadow-including root, if the object’s root is a shadow root, and its root otherwise.

    An object A is a shadow-including descendant of an object B, if A is a descendant of B, or A’s root is a shadow root and A’s root’s host is a shadow-including inclusive descendant of B.

    @@ -3287,7 +3286,7 @@

    <sw-rey></sw-rey> <p is="sw-finn"></p> -

    Elements also have an associated shadow root (null or a shadow root). It is null unless otherwise stated.

    +

    Elements also have an associated shadow root (null or a shadow root). It is null unless otherwise stated. An element is a shadow host if its shadow root is non-null.

    An element’s qualified name is its local name if its namespace prefix is null, and its namespace prefix, followed by ":", followed by its local name, otherwise.

    User agents could have this as an internal slot as an optimization, but are not required to do so. The standard has this concept for readability.

    @@ -3677,7 +3676,7 @@

    span", then throw a NotSupportedError.

  • -

    If context object’s shadow root is non-null, then throw an InvalidStateError.

    +

    If context object is a shadow host, then throw an InvalidStateError.

  • Let shadow be a new shadow root whose node document is context object’s node document, host is context object, and mode is init’s mode.

  • @@ -5359,6 +5358,7 @@

    ASCII case-insensitive, in §2.2
  • ASCII case-insensitively, in §2.2
  • assign a slot, in §4.2.2.4 +
  • assigned, in §4.2.2.2
  • assigned nodes, in §4.2.2.1
  • assigned slot, in §4.2.2.2
  • assignedSlot, in §4.2.9 @@ -6028,6 +6028,7 @@

    set the end, in §5.2
  • set the start, in §5.2
  • setUserData(), in §8.2 +
  • shadow host, in §4.9
  • shadow-including ancestor, in §4.8
  • shadow-including descendant, in §4.8
  • shadow-including inclusive ancestor, in §4.8 From 8d281a354690abfda5ff558c461747f304f11788 Mon Sep 17 00:00:00 2001 From: Aleksey Shvayka Date: Wed, 20 Apr 2016 06:21:27 +0300 Subject: [PATCH 22/30] Editorial: flip non-null/otherwise conditions PR: https://github.com/whatwg/dom/pull/234 --- dom.bs | 15 +++++++-------- dom.html | 8 ++++---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/dom.bs b/dom.bs index 7231bfb6e..ce877a27d 100644 --- a/dom.bs +++ b/dom.bs @@ -2517,9 +2517,8 @@ invoked, must run these steps:
  • Let node be the result of converting nodes into a node, given nodes and context object's node document. Rethrow any exceptions. -

  • If viablePreviousSibling is non-null, set it to - viablePreviousSibling's next sibling, and to parent's - first child otherwise. +

  • If viablePreviousSibling is null, set it to parent's + first child, and to viablePreviousSibling's next sibling otherwise.

  • Pre-insert node into parent before viablePreviousSibling. Rethrow any exceptions. @@ -8719,11 +8718,10 @@ The NodeIterator pre-removing steps given a

    Steps are not terminated here. -

  • Set nodeIterator's {{NodeIterator/referenceNode}} attribute to the - inclusive descendant of toBeRemovedNode's previous sibling that - appears last in tree order, if toBeRemovedNode's - previous sibling is non-null, and to toBeRemovedNode's parent - otherwise. +

  • Set nodeIterator's {{NodeIterator/referenceNode}} attribute to + toBeRemovedNode's parent, if toBeRemovedNode's previous sibling + is null, and to the inclusive descendant of toBeRemovedNode's + previous sibling that appears last in tree order otherwise.


    @@ -9714,6 +9712,7 @@ making this standard what it is today. With that, many thanks to Adam Klein, Adrian Bateman, +Aleksey Shvayka, Alex Komoroske, Alex Russell, Anthony Ramine, diff --git a/dom.html b/dom.html index 5eec5a139..0754d67c5 100644 --- a/dom.html +++ b/dom.html @@ -71,7 +71,7 @@

    DOM

    -

    Living Standard — Last Updated

    +

    Living Standard — Last Updated

    @@ -1594,7 +1594,7 @@

    Let node be the result of converting nodes into a node, given nodes and context object’s node document. Rethrow any exceptions.

  • -

    If viablePreviousSibling is non-null, set it to viablePreviousSibling’s next sibling, and to parent’s first child otherwise.

    +

    If viablePreviousSibling is null, set it to parent’s first child, and to viablePreviousSibling’s next sibling otherwise.

  • Pre-insert node into parent before viablePreviousSibling. Rethrow any exceptions.

    @@ -4621,8 +4621,7 @@

    Steps are not terminated here.

  • -

    Set nodeIterator’s referenceNode attribute to the inclusive descendant of toBeRemovedNode’s previous sibling that - appears last in tree order, if toBeRemovedNode’s previous sibling is non-null, and to toBeRemovedNode’s parent otherwise.

    +

    Set nodeIterator’s referenceNode attribute to toBeRemovedNode’s parent, if toBeRemovedNode’s previous sibling is null, and to the inclusive descendant of toBeRemovedNode’s previous sibling that appears last in tree order otherwise.


    The root attribute @@ -5198,6 +5197,7 @@

    Acknowledgmen

    With that, many thanks to Adam Klein, Adrian Bateman, +Aleksey Shvayka, Alex Komoroske, Alex Russell, Anthony Ramine, From fdad8cb90a78b399cd2bdf5a20c1960649697462 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 21 Apr 2016 10:17:55 +0200 Subject: [PATCH 23/30] Shadow: is now defined in HTML --- dom.bs | 5 ++--- dom.html | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dom.bs b/dom.bs index ce877a27d..088ffa633 100644 --- a/dom.bs +++ b/dom.bs @@ -1481,8 +1481,7 @@ itself.

    A shadow tree contains zero or more elements that are slots.

    -

    A slot can only be created through HTML's slot element.

    - +

    A slot can only be created through HTML's <{slot}> element.

    A slot has an associated name (a string). Unless stated otherwise it is the empty string.

    @@ -2587,7 +2586,7 @@ interface Slotable { }; Element implements Slotable; Text implements Slotable; - +

    The assignedSlot attribute's getter must return the result of find a slot given context object and with the open flag set.

    diff --git a/dom.html b/dom.html index 0754d67c5..8fb9bfee2 100644 --- a/dom.html +++ b/dom.html @@ -1065,7 +1065,7 @@

    element is in a shadow-including document if its shadow-including root is a document.

    4.2.2.1. Slots

    A shadow tree contains zero or more elements that are slots.

    -

    A slot can only be created through HTML’s slot element.

    +

    A slot can only be created through HTML’s slot element.

    A slot has an associated name (a string). Unless stated otherwise it is the empty string.

    Use these attribute change steps to update a slot’s name:

    @@ -1641,7 +1641,7 @@

    [NoInterfaceObject, Exposed=Window] interface Slotable { - readonly attribute HTMLSlotElement? assignedSlot; + readonly attribute HTMLSlotElement? assignedSlot; }; Element implements Slotable; Text implements Slotable; @@ -6210,6 +6210,7 @@

    ErrorEvent
  • HTMLElement
  • HTMLHtmlElement +
  • HTMLSlotElement
  • HashChangeEvent
  • MessageEvent
  • PageTransitionEvent @@ -6231,6 +6232,7 @@

    name
  • opaque origin
  • script +
  • slot
  • template
  • title
  • try to upgrade an element @@ -6465,7 +6467,7 @@

    I [NoInterfaceObject, Exposed=Window] interface Slotable { - readonly attribute HTMLSlotElement? assignedSlot; + readonly attribute HTMLSlotElement? assignedSlot; }; Element implements Slotable; Text implements Slotable; From a13a3c7fc14732691b50c51316b16de0915a61f2 Mon Sep 17 00:00:00 2001 From: Rick Byers Date: Wed, 20 Apr 2016 21:56:21 -0400 Subject: [PATCH 24/30] Remove passive as event listener key This changes makes passive no longer contribute to the uniqueness of an event listener. It therefore also no longer needs to be supported as part of removeEventListener(). Fixes https://github.com/WICG/EventListenerOptions/issues/27. PR: https://github.com/whatwg/dom/pull/236 --- dom.bs | 47 ++++++++++++++++++++++------------------------- dom.html | 40 ++++++++++++++++++++-------------------- 2 files changed, 42 insertions(+), 45 deletions(-) diff --git a/dom.bs b/dom.bs index 088ffa633..cbbf377d1 100644 --- a/dom.bs +++ b/dom.bs @@ -694,7 +694,7 @@ inherits from the {{Event}} interface.
    event . preventDefault()
    If invoked when the {{Event/cancelable}} attribute value is true, and while executing a - listener for the event with {{EventListenerOptions/passive}} set to false, signals to + listener for the event with {{AddEventListenerOptions/passive}} set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
    event . {{Event/defaultPrevented}} @@ -949,10 +949,10 @@ callback interface EventListener { dictionary EventListenerOptions { boolean capture; - boolean passive; }; dictionary AddEventListenerOptions : EventListenerOptions { + boolean passive; boolean once; }; @@ -1012,8 +1012,8 @@ specified otherwise it returns null. will only be invoked once after which the event listener will be removed. The event listener is appended to target's list of event listeners and is - not appended if it is a duplicate, i.e., having the same type, callback, - capture and passive values. + not appended if it is a duplicate, i.e., having the same type, callback, and + capture values.
    target . removeEventListener(type, callback [, options])
    Remove the event listener @@ -1032,27 +1032,26 @@ specified otherwise it returns null. steps:
      -
    1. Let capture and passive be false. +

    2. Let capture be false.

    3. If options is a boolean, set capture to options.

    4. If options is a dictionary and {{EventListenerOptions/capture}} is present in options with value true, then set capture to true. -

    5. If options is a dictionary and {{EventListenerOptions/passive}} is - present in options with value true, then set passive to true. - -

    6. Return capture and passive. +

    7. Return capture.

    To flatten more options, run these steps:

      -
    1. Let capture and passive be the result of flattening - options. +

    2. Let capture be the result of flattening options. -

    3. Let once be false. +

    4. Let once and passive be false. + +

    5. If options is a dictionary and {{AddEventListenerOptions/passive}} + is present in options with value true, then set passive to true.

    6. If options is a dictionary and {{AddEventListenerOptions/once}} is present in options with value true, then set once to true. @@ -1081,10 +1080,9 @@ method, when invoked, must run these steps:

    7. If context object's associated list of event listener does not contain an event listener whose type is type, callback is callback, - capture is capture, and passive is passive, then append a new - event listener to it, whose type is type, callback is - callback, capture is capture, passive is passive, - and once is once. + and capture is capture, then append a new event listener to it, whose + type is type, callback is callback, capture is + capture, passive is passive, and once is once.

    The @@ -1096,13 +1094,12 @@ method, when invoked, must, run these steps its associated service worker's script resource's has ever been evaluated flag is set, throw a TypeError. [[!SERVICE-WORKERS]] -

  • Let capture and passive be the result of flattening - options. +

  • Let capture be the result of flattening options.

  • If there is an event listener in the associated list of event listeners whose - type is type, callback is callback, capture is - capture, and passive is passive then set that event listener's - removed to true and remove it from the associated list of event listeners. + type is type, callback is callback, and capture is + capture, then set that event listener's removed to true and remove it from + the associated list of event listeners.

    The dispatchEvent(event) method, when @@ -1129,12 +1126,12 @@ requires observing event listeners. This can make the presence of listene that even empty listeners can have a dramatic performance impact on the behavior of the application. For example, touch and wheel events which can be used to block asynchronous scrolling. In some cases this problem can be mitigated by specifying the event to be {{Event/cancelable}} only when there is -at least one non-{{EventListenerOptions/passive}} listener. For example, -non-{{EventListenerOptions/passive}} {{TouchEvent}} listeners must block scrolling, but if all -listeners are {{EventListenerOptions/passive}} then scrolling can be allowed to start +at least one non-{{AddEventListenerOptions/passive}} listener. For example, +non-{{AddEventListenerOptions/passive}} {{TouchEvent}} listeners must block scrolling, but if all +listeners are {{AddEventListenerOptions/passive}} then scrolling can be allowed to start in parallel by making the {{TouchEvent}} uncancelable (so that calls to {{Event/preventDefault()}} are ignored). So code dispatching an event is able to observe the absence -of non-{{EventListenerOptions/passive}} listeners, and use that to clear the {{Event/cancelable}} +of non-{{AddEventListenerOptions/passive}} listeners, and use that to clear the {{Event/cancelable}} property of the event being dispatched.

    Ideally, any new event APIs are defined such that they do not need this property (use diff --git a/dom.html b/dom.html index 8fb9bfee2..9a2614025 100644 --- a/dom.html +++ b/dom.html @@ -550,7 +550,7 @@

    dispatched, can be canceled by invoking the preventDefault() method.
    event . preventDefault()
    If invoked when the cancelable attribute value is true, and while executing a - listener for the event with passive set to false, signals to + listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
    event . defaultPrevented
    Returns true if preventDefault() was invoked successfully to indicate cancellation, @@ -704,10 +704,10 @@

    EventListenerOptions { boolean capture; - boolean passive; }; dictionary AddEventListenerOptions : EventListenerOptions { + boolean passive; boolean once; }; @@ -743,7 +743,7 @@

    §3.7 Observing event listeners.

    When set to true, options’s once member indicates that the callback will only be invoked once after which the event listener will be removed.

    The event listener is appended to target’s list of event listeners and is - not appended if it is a duplicate, i.e., having the same type, callback, capture and passive values.

    + not appended if it is a duplicate, i.e., having the same type, callback, and capture values.

    target . removeEventListener(type, callback [, options])
    Remove the event listener in target’s list of event listeners with the same type, callback, and options.
    target . dispatchEvent(event) @@ -754,25 +754,24 @@

    1. -

      Let capture and passive be false.

      +

      Let capture be false.

    2. If options is a boolean, set capture to options.

    3. If options is a dictionary and capture is present in options with value true, then set capture to true.

    4. -

      If options is a dictionary and passive is - present in options with value true, then set passive to true.

      -
    5. -

      Return capture and passive.

      +

      Return capture.

    To flatten more options, run these steps:

    1. -

      Let capture and passive be the result of flattening options.

      +

      Let capture be the result of flattening options.

      +
    2. +

      Let once and passive be false.

    3. -

      Let once be false.

      +

      If options is a dictionary and passive is present in options with value true, then set passive to true.

    4. If options is a dictionary and once is present in options with value true, then set once to true.

      @@ -793,8 +792,8 @@

      Let capture, passive, and once be the result of flattening more options.

    5. -

      If context object’s associated list of event listener does not contain an event listener whose type is type, callback is callback, capture is capture, and passive is passive, then append a new event listener to it, whose type is type, callback is callback, capture is capture, passive is passive, - and once is once.

      +

      If context object’s associated list of event listener does not contain an event listener whose type is type, callback is callback, + and capture is capture, then append a new event listener to it, whose type is type, callback is callback, capture is capture, passive is passive, and once is once.

    The removeEventListener(type, callback, options) method, when invoked, must, run these steps

      @@ -802,9 +801,10 @@

      If the context object’s global object is a ServiceWorkerGlobalScope object and its associated service worker’s script resource’s has ever been evaluated flag is set, throw a TypeError. [SERVICE-WORKERS]

    1. -

      Let capture and passive be the result of flattening options.

      +

      Let capture be the result of flattening options.

    2. -

      If there is an event listener in the associated list of event listeners whose type is type, callback is callback, capture is capture, and passive is passive then set that event listener’s removed to true and remove it from the associated list of event listeners.

      +

      If there is an event listener in the associated list of event listeners whose type is type, callback is callback, and capture is capture, then set that event listener’s removed to true and remove it from + the associated list of event listeners.

    The dispatchEvent(event) method, when invoked, must run these steps:

    @@ -826,10 +826,10 @@

    cancelable only when there is -at least one non-passive listener. For example, -non-passive TouchEvent listeners must block scrolling, but if all -listeners are passive then scrolling can be allowed to start in parallel by making the TouchEvent uncancelable (so that calls to preventDefault() are ignored). So code dispatching an event is able to observe the absence -of non-passive listeners, and use that to clear the cancelable property of the event being dispatched.

    +at least one non-passive listener. For example, +non-passive TouchEvent listeners must block scrolling, but if all +listeners are passive then scrolling can be allowed to start in parallel by making the TouchEvent uncancelable (so that calls to preventDefault() are ignored). So code dispatching an event is able to observe the absence +of non-passive listeners, and use that to clear the cancelable property of the event being dispatched.

    Ideally, any new event APIs are defined such that they do not need this property (use public-scrip-coord@w3.org for discussion).

    3.8. Dispatching events

    To dispatch an event to a target, with an optional target override, run these steps:

    @@ -5904,7 +5904,7 @@

    participate, in §2.1
  • participate in a tree, in §2.1
  • participates in a tree, in §2.1 -
  • passive, in §3.6 +
  • passive, in §3.6
  • pointerBeforeReferenceNode, in §6.1
  • position, in §5.2
  • preceding, in §2.1 @@ -6403,10 +6403,10 @@

    I dictionary EventListenerOptions { boolean capture; - boolean passive; }; dictionary AddEventListenerOptions : EventListenerOptions { + boolean passive; boolean once; }; From 0f08850f92b538dec94e986536c917ffa3b300f2 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 21 Apr 2016 11:23:15 +0200 Subject: [PATCH 25/30] Meta: point out event's timeStamp is likely to change See #23 for details. --- dom.bs | 3 +++ dom.html | 2 ++ 2 files changed, 5 insertions(+) diff --git a/dom.bs b/dom.bs index cbbf377d1..f55d27317 100644 --- a/dom.bs +++ b/dom.bs @@ -804,6 +804,9 @@ initialized to the number of milliseconds that have passed since 00:00:00 UTC on 1 January 1970, ignoring leap seconds. +

    This is highly likely to change and already does not reflect implementations well. +Please see dom #23 for more details. +


    To initialize an diff --git a/dom.html b/dom.html index 9a2614025..94fce78f3 100644 --- a/dom.html +++ b/dom.html @@ -612,6 +612,8 @@

    event is created the attribute must be initialized to the number of milliseconds that have passed since 00:00:00 UTC on 1 January 1970, ignoring leap seconds.

    +

    This is highly likely to change and already does not reflect implementations well. +Please see dom #23 for more details.


    To initialize an event, with type, bubbles, and cancelable, run these steps:

      From 3cd02d139c159a31fbb400e03932652c72fc7812 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Thu, 21 Apr 2016 11:35:32 -0400 Subject: [PATCH 26/30] Add [CEReactions] annotations to mutating methods Part of https://github.com/w3c/webcomponents/issues/186, and furthering https://github.com/whatwg/html/commit/27aa7bc4fa6f168654a8c858f0773e611f679b39. Linking [CEREactions] will happen once https://github.com/tabatkins/bikeshed/issues/677 is fixed. --- dom.bs | 92 ++++++++++++++-------------- dom.html | 184 +++++++++++++++++++++++++++---------------------------- 2 files changed, 138 insertions(+), 138 deletions(-) diff --git a/dom.bs b/dom.bs index f55d27317..f6dd8d52f 100644 --- a/dom.bs +++ b/dom.bs @@ -2270,8 +2270,8 @@ interface ParentNode { readonly attribute Element? lastElementChild; readonly attribute unsigned long childElementCount; - [Unscopable] void prepend((Node or DOMString)... nodes); - [Unscopable] void append((Node or DOMString)... nodes); + [CEReactions, Unscopable] void prepend((Node or DOMString)... nodes); + [CEReactions, Unscopable] void append((Node or DOMString)... nodes); Element? querySelector(DOMString selectors); [NewObject] NodeList querySelectorAll(DOMString selectors); @@ -2457,10 +2457,10 @@ and null otherwise. [NoInterfaceObject, Exposed=Window] interface ChildNode { - [Unscopable] void before((Node or DOMString)... nodes); - [Unscopable] void after((Node or DOMString)... nodes); - [Unscopable] void replaceWith((Node or DOMString)... nodes); - [Unscopable] void remove(); + [CEReactions, Unscopable] void before((Node or DOMString)... nodes); + [CEReactions, Unscopable] void after((Node or DOMString)... nodes); + [CEReactions, Unscopable] void replaceWith((Node or DOMString)... nodes); + [CEReactions, Unscopable] void remove(); }; DocumentType implements ChildNode; Element implements ChildNode; @@ -3327,11 +3327,11 @@ interface Node : EventTarget { readonly attribute Node? previousSibling; readonly attribute Node? nextSibling; - attribute DOMString? nodeValue; - attribute DOMString? textContent; - void normalize(); + [CEReactions] attribute DOMString? nodeValue; + [CEReactions] attribute DOMString? textContent; + [CEReactions] void normalize(); - [NewObject] Node cloneNode(optional boolean deep = false); + [CEReactions, NewObject] Node cloneNode(optional boolean deep = false); boolean isEqualNode(Node? otherNode); boolean isSameNode(Node? otherNode); // historical alias of === @@ -3348,10 +3348,10 @@ interface Node : EventTarget { DOMString? lookupNamespaceURI(DOMString? prefix); boolean isDefaultNamespace(DOMString? namespace); - Node insertBefore(Node node, Node? child); - Node appendChild(Node node); - Node replaceChild(Node node, Node child); - Node removeChild(Node child); + [CEReactions] Node insertBefore(Node node, Node? child); + [CEReactions] Node appendChild(Node node); + [CEReactions] Node replaceChild(Node node, Node child); + [CEReactions] Node removeChild(Node child); }; @@ -4448,8 +4448,8 @@ interface Document : Node { [NewObject] Comment createComment(DOMString data); [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data); - [NewObject] Node importNode(Node node, optional boolean deep = false); - Node adoptNode(Node node); + [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false); + [CEReactions] Node adoptNode(Node node); [NewObject] Attr createAttribute(DOMString localName); [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString qualifiedName); @@ -5447,28 +5447,28 @@ interface Element : Node { readonly attribute DOMString localName; readonly attribute DOMString tagName; - attribute DOMString id; - attribute DOMString className; - [SameObject, PutForwards=value] readonly attribute DOMTokenList classList; - attribute DOMString slot; + [CEReactions] attribute DOMString id; + [CEReactions] attribute DOMString className; + [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList classList; + [CEReactions] attribute DOMString slot; boolean hasAttributes(); [SameObject] readonly attribute NamedNodeMap attributes; sequence<DOMString> getAttributeNames(); DOMString? getAttribute(DOMString qualifiedName); DOMString? getAttributeNS(DOMString? namespace, DOMString localName); - void setAttribute(DOMString qualifiedName, DOMString value); - void setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value); - void removeAttribute(DOMString qualifiedName); - void removeAttributeNS(DOMString? namespace, DOMString localName); + [CEReactions] void setAttribute(DOMString qualifiedName, DOMString value); + [CEReactions] void setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value); + [CEReactions] void removeAttribute(DOMString qualifiedName); + [CEReactions] void removeAttributeNS(DOMString? namespace, DOMString localName); boolean hasAttribute(DOMString qualifiedName); boolean hasAttributeNS(DOMString? namespace, DOMString localName); Attr? getAttributeNode(DOMString qualifiedName); Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName); - Attr? setAttributeNode(Attr attr); - Attr? setAttributeNodeNS(Attr attr); - Attr removeAttributeNode(Attr attr); + [CEReactions] Attr? setAttributeNode(Attr attr); + [CEReactions] Attr? setAttributeNodeNS(Attr attr); + [CEReactions] Attr removeAttributeNode(Attr attr); ShadowRoot attachShadow(ShadowRootInit init); readonly attribute ShadowRoot? shadowRoot; @@ -5481,8 +5481,8 @@ interface Element : Node { HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); HTMLCollection getElementsByClassName(DOMString classNames); - Element? insertAdjacentElement(DOMString where, Element element); // historical - void insertAdjacentText(DOMString where, DOMString data); // historical + [CEReactions] Element? insertAdjacentElement(DOMString where, Element element); // historical + [CEReactions] void insertAdjacentText(DOMString where, DOMString data); // historical }; dictionary ShadowRootInit { @@ -6406,10 +6406,10 @@ interface NamedNodeMap { getter Attr? item(unsigned long index); getter Attr? getNamedItem(DOMString qualifiedName); Attr? getNamedItemNS(DOMString? namespace, DOMString localName); - Attr? setNamedItem(Attr attr); - Attr? setNamedItemNS(Attr attr); - Attr removeNamedItem(DOMString qualifiedName); - Attr removeNamedItemNS(DOMString? namespace, DOMString localName); + [CEReactions] Attr? setNamedItem(Attr attr); + [CEReactions] Attr? setNamedItemNS(Attr attr); + [CEReactions] Attr removeNamedItem(DOMString qualifiedName); + [CEReactions] Attr removeNamedItemNS(DOMString? namespace, DOMString localName); }; @@ -6525,9 +6525,9 @@ interface Attr { readonly attribute DOMString localName; readonly attribute DOMString name; readonly attribute DOMString nodeName; // historical alias of .name - attribute DOMString value; - [TreatNullAs=EmptyString] attribute DOMString nodeValue; // historical alias of .value - [TreatNullAs=EmptyString] attribute DOMString textContent; // historical alias of .value + [CEReactions] attribute DOMString value; + [CEReactions, TreatNullAs=EmptyString] attribute DOMString nodeValue; // historical alias of .value + [CEReactions, TreatNullAs=EmptyString] attribute DOMString textContent; // historical alias of .value readonly attribute Element? ownerElement; @@ -7113,11 +7113,11 @@ interface Range { const unsigned short END_TO_START = 3; short compareBoundaryPoints(unsigned short how, Range sourceRange); - void deleteContents(); - [NewObject] DocumentFragment extractContents(); - [NewObject] DocumentFragment cloneContents(); - void insertNode(Node node); - void surroundContents(Node newParent); + [CEReactions] void deleteContents(); + [CEReactions, NewObject] DocumentFragment extractContents(); + [CEReactions, NewObject] DocumentFragment cloneContents(); + [CEReactions] void insertNode(Node node); + [CEReactions] void surroundContents(Node newParent); [NewObject] Range cloneRange(); void detach(); @@ -9235,12 +9235,12 @@ interface DOMTokenList { readonly attribute unsigned long length; getter DOMString? item(unsigned long index); boolean contains(DOMString token); - void add(DOMString... tokens); - void remove(DOMString... tokens); - boolean toggle(DOMString token, optional boolean force); - void replace(DOMString token, DOMString newToken); + [CEReactions] void add(DOMString... tokens); + [CEReactions] void remove(DOMString... tokens); + [CEReactions] boolean toggle(DOMString token, optional boolean force); + [CEReactions] void replace(DOMString token, DOMString newToken); boolean supports(DOMString token); - attribute DOMString value; + [CEReactions] attribute DOMString value; stringifier; iterable<DOMString>; }; diff --git a/dom.html b/dom.html index 94fce78f3..0757133d2 100644 --- a/dom.html +++ b/dom.html @@ -1476,8 +1476,8 @@

      Element? lastElementChild; readonly attribute unsigned long childElementCount; - [Unscopable] void prepend((Node or DOMString)... nodes); - [Unscopable] void append((Node or DOMString)... nodes); + [CEReactions, Unscopable] void prepend((Node or DOMString)... nodes); + [CEReactions, Unscopable] void append((Node or DOMString)... nodes); Element? querySelector(DOMString selectors); [NewObject] NodeList querySelectorAll(DOMString selectors); @@ -1556,10 +1556,10 @@

      [NoInterfaceObject, Exposed=Window] interface ChildNode { - [Unscopable] void before((Node or DOMString)... nodes); - [Unscopable] void after((Node or DOMString)... nodes); - [Unscopable] void replaceWith((Node or DOMString)... nodes); - [Unscopable] void remove(); + [CEReactions, Unscopable] void before((Node or DOMString)... nodes); + [CEReactions, Unscopable] void after((Node or DOMString)... nodes); + [CEReactions, Unscopable] void replaceWith((Node or DOMString)... nodes); + [CEReactions, Unscopable] void remove(); }; DocumentType implements ChildNode; Element implements ChildNode; @@ -2021,11 +2021,11 @@

      Node? previousSibling; readonly attribute Node? nextSibling; - attribute DOMString? nodeValue; - attribute DOMString? textContent; - void normalize(); + [CEReactions] attribute DOMString? nodeValue; + [CEReactions] attribute DOMString? textContent; + [CEReactions] void normalize(); - [NewObject] Node cloneNode(optional boolean deep = false); + [CEReactions, NewObject] Node cloneNode(optional boolean deep = false); boolean isEqualNode(Node? otherNode); boolean isSameNode(Node? otherNode); // historical alias of === @@ -2042,10 +2042,10 @@

      lookupNamespaceURI(DOMString? prefix); boolean isDefaultNamespace(DOMString? namespace); - Node insertBefore(Node node, Node? child); - Node appendChild(Node node); - Node replaceChild(Node node, Node child); - Node removeChild(Node child); + [CEReactions] Node insertBefore(Node node, Node? child); + [CEReactions] Node appendChild(Node node); + [CEReactions] Node replaceChild(Node node, Node child); + [CEReactions] Node removeChild(Node child); };

      Node is an abstract interface and does not exist as node. It @@ -2576,8 +2576,8 @@

      Comment createComment(DOMString data); [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data); - [NewObject] Node importNode(Node node, optional boolean deep = false); - Node adoptNode(Node node); + [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false); + [CEReactions] Node adoptNode(Node node); [NewObject] Attr createAttribute(DOMString localName); [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString qualifiedName); @@ -3210,28 +3210,28 @@

      localName; readonly attribute DOMString tagName; - attribute DOMString id; - attribute DOMString className; - [SameObject, PutForwards=value] readonly attribute DOMTokenList classList; - attribute DOMString slot; + [CEReactions] attribute DOMString id; + [CEReactions] attribute DOMString className; + [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList classList; + [CEReactions] attribute DOMString slot; boolean hasAttributes(); [SameObject] readonly attribute NamedNodeMap attributes; sequence<DOMString> getAttributeNames(); DOMString? getAttribute(DOMString qualifiedName); DOMString? getAttributeNS(DOMString? namespace, DOMString localName); - void setAttribute(DOMString qualifiedName, DOMString value); - void setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value); - void removeAttribute(DOMString qualifiedName); - void removeAttributeNS(DOMString? namespace, DOMString localName); + [CEReactions] void setAttribute(DOMString qualifiedName, DOMString value); + [CEReactions] void setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value); + [CEReactions] void removeAttribute(DOMString qualifiedName); + [CEReactions] void removeAttributeNS(DOMString? namespace, DOMString localName); boolean hasAttribute(DOMString qualifiedName); boolean hasAttributeNS(DOMString? namespace, DOMString localName); Attr? getAttributeNode(DOMString qualifiedName); Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName); - Attr? setAttributeNode(Attr attr); - Attr? setAttributeNodeNS(Attr attr); - Attr removeAttributeNode(Attr attr); + [CEReactions] Attr? setAttributeNode(Attr attr); + [CEReactions] Attr? setAttributeNodeNS(Attr attr); + [CEReactions] Attr removeAttributeNode(Attr attr); ShadowRoot attachShadow(ShadowRootInit init); readonly attribute ShadowRoot? shadowRoot; @@ -3244,8 +3244,8 @@

      HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); HTMLCollection getElementsByClassName(DOMString classNames); - Element? insertAdjacentElement(DOMString where, Element element); // historical - void insertAdjacentText(DOMString where, DOMString data); // historical + [CEReactions] Element? insertAdjacentElement(DOMString where, Element element); // historical + [CEReactions] void insertAdjacentText(DOMString where, DOMString data); // historical }; dictionary ShadowRootInit { @@ -3762,10 +3762,10 @@

      Attr? item(unsigned long index); getter Attr? getNamedItem(DOMString qualifiedName); Attr? getNamedItemNS(DOMString? namespace, DOMString localName); - Attr? setNamedItem(Attr attr); - Attr? setNamedItemNS(Attr attr); - Attr removeNamedItem(DOMString qualifiedName); - Attr removeNamedItemNS(DOMString? namespace, DOMString localName); + [CEReactions] Attr? setNamedItem(Attr attr); + [CEReactions] Attr? setNamedItemNS(Attr attr); + [CEReactions] Attr removeNamedItem(DOMString qualifiedName); + [CEReactions] Attr removeNamedItemNS(DOMString? namespace, DOMString localName); };

      A NamedNodeMap has an associated element (an element).

      @@ -3830,9 +3830,9 @@

      localName; readonly attribute DOMString name; readonly attribute DOMString nodeName; // historical alias of .name - attribute DOMString value; - [TreatNullAs=EmptyString] attribute DOMString nodeValue; // historical alias of .value - [TreatNullAs=EmptyString] attribute DOMString textContent; // historical alias of .value + [CEReactions] attribute DOMString value; + [CEReactions, TreatNullAs=EmptyString] attribute DOMString nodeValue; // historical alias of .value + [CEReactions, TreatNullAs=EmptyString] attribute DOMString textContent; // historical alias of .value readonly attribute Element? ownerElement; @@ -4052,11 +4052,11 @@

      END_TO_START = 3; short compareBoundaryPoints(unsigned short how, Range sourceRange); - void deleteContents(); - [NewObject] DocumentFragment extractContents(); - [NewObject] DocumentFragment cloneContents(); - void insertNode(Node node); - void surroundContents(Node newParent); + [CEReactions] void deleteContents(); + [CEReactions, NewObject] DocumentFragment extractContents(); + [CEReactions, NewObject] DocumentFragment cloneContents(); + [CEReactions] void insertNode(Node node); + [CEReactions] void surroundContents(Node newParent); [NewObject] Range cloneRange(); void detach(); @@ -4873,12 +4873,12 @@

      length; getter DOMString? item(unsigned long index); boolean contains(DOMString token); - void add(DOMString... tokens); - void remove(DOMString... tokens); - boolean toggle(DOMString token, optional boolean force); - void replace(DOMString token, DOMString newToken); + [CEReactions] void add(DOMString... tokens); + [CEReactions] void remove(DOMString... tokens); + [CEReactions] boolean toggle(DOMString token, optional boolean force); + [CEReactions] void replace(DOMString token, DOMString newToken); boolean supports(DOMString token); - attribute DOMString value; + [CEReactions] attribute DOMString value; stringifier; iterable<DOMString>; }; @@ -6435,8 +6435,8 @@

      I readonly attribute Element? lastElementChild; readonly attribute unsigned long childElementCount; - [Unscopable] void prepend((Node or DOMString)... nodes); - [Unscopable] void append((Node or DOMString)... nodes); + [CEReactions, Unscopable] void prepend((Node or DOMString)... nodes); + [CEReactions, Unscopable] void append((Node or DOMString)... nodes); Element? querySelector(DOMString selectors); [NewObject] NodeList querySelectorAll(DOMString selectors); @@ -6457,10 +6457,10 @@

      I [NoInterfaceObject, Exposed=Window] interface ChildNode { - [Unscopable] void before((Node or DOMString)... nodes); - [Unscopable] void after((Node or DOMString)... nodes); - [Unscopable] void replaceWith((Node or DOMString)... nodes); - [Unscopable] void remove(); + [CEReactions, Unscopable] void before((Node or DOMString)... nodes); + [CEReactions, Unscopable] void after((Node or DOMString)... nodes); + [CEReactions, Unscopable] void replaceWith((Node or DOMString)... nodes); + [CEReactions, Unscopable] void remove(); }; DocumentType implements ChildNode; Element implements ChildNode; @@ -6551,11 +6551,11 @@

      I readonly attribute Node? previousSibling; readonly attribute Node? nextSibling; - attribute DOMString? nodeValue; - attribute DOMString? textContent; - void normalize(); + [CEReactions] attribute DOMString? nodeValue; + [CEReactions] attribute DOMString? textContent; + [CEReactions] void normalize(); - [NewObject] Node cloneNode(optional boolean deep = false); + [CEReactions, NewObject] Node cloneNode(optional boolean deep = false); boolean isEqualNode(Node? otherNode); boolean isSameNode(Node? otherNode); // historical alias of === @@ -6572,10 +6572,10 @@

      I DOMString? lookupNamespaceURI(DOMString? prefix); boolean isDefaultNamespace(DOMString? namespace); - Node insertBefore(Node node, Node? child); - Node appendChild(Node node); - Node replaceChild(Node node, Node child); - Node removeChild(Node child); + [CEReactions] Node insertBefore(Node node, Node? child); + [CEReactions] Node appendChild(Node node); + [CEReactions] Node replaceChild(Node node, Node child); + [CEReactions] Node removeChild(Node child); }; [Constructor, @@ -6604,8 +6604,8 @@

      I [NewObject] Comment createComment(DOMString data); [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data); - [NewObject] Node importNode(Node node, optional boolean deep = false); - Node adoptNode(Node node); + [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false); + [CEReactions] Node adoptNode(Node node); [NewObject] Attr createAttribute(DOMString localName); [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString qualifiedName); @@ -6662,28 +6662,28 @@

      I readonly attribute DOMString localName; readonly attribute DOMString tagName; - attribute DOMString id; - attribute DOMString className; - [SameObject, PutForwards=value] readonly attribute DOMTokenList classList; - attribute DOMString slot; + [CEReactions] attribute DOMString id; + [CEReactions] attribute DOMString className; + [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList classList; + [CEReactions] attribute DOMString slot; boolean hasAttributes(); [SameObject] readonly attribute NamedNodeMap attributes; sequence<DOMString> getAttributeNames(); DOMString? getAttribute(DOMString qualifiedName); DOMString? getAttributeNS(DOMString? namespace, DOMString localName); - void setAttribute(DOMString qualifiedName, DOMString value); - void setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value); - void removeAttribute(DOMString qualifiedName); - void removeAttributeNS(DOMString? namespace, DOMString localName); + [CEReactions] void setAttribute(DOMString qualifiedName, DOMString value); + [CEReactions] void setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value); + [CEReactions] void removeAttribute(DOMString qualifiedName); + [CEReactions] void removeAttributeNS(DOMString? namespace, DOMString localName); boolean hasAttribute(DOMString qualifiedName); boolean hasAttributeNS(DOMString? namespace, DOMString localName); Attr? getAttributeNode(DOMString qualifiedName); Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName); - Attr? setAttributeNode(Attr attr); - Attr? setAttributeNodeNS(Attr attr); - Attr removeAttributeNode(Attr attr); + [CEReactions] Attr? setAttributeNode(Attr attr); + [CEReactions] Attr? setAttributeNodeNS(Attr attr); + [CEReactions] Attr removeAttributeNode(Attr attr); ShadowRoot attachShadow(ShadowRootInit init); readonly attribute ShadowRoot? shadowRoot; @@ -6696,8 +6696,8 @@

      I HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); HTMLCollection getElementsByClassName(DOMString classNames); - Element? insertAdjacentElement(DOMString where, Element element); // historical - void insertAdjacentText(DOMString where, DOMString data); // historical + [CEReactions] Element? insertAdjacentElement(DOMString where, Element element); // historical + [CEReactions] void insertAdjacentText(DOMString where, DOMString data); // historical }; dictionary ShadowRootInit { @@ -6710,10 +6710,10 @@

      I getter Attr? item(unsigned long index); getter Attr? getNamedItem(DOMString qualifiedName); Attr? getNamedItemNS(DOMString? namespace, DOMString localName); - Attr? setNamedItem(Attr attr); - Attr? setNamedItemNS(Attr attr); - Attr removeNamedItem(DOMString qualifiedName); - Attr removeNamedItemNS(DOMString? namespace, DOMString localName); + [CEReactions] Attr? setNamedItem(Attr attr); + [CEReactions] Attr? setNamedItemNS(Attr attr); + [CEReactions] Attr removeNamedItem(DOMString qualifiedName); + [CEReactions] Attr removeNamedItemNS(DOMString? namespace, DOMString localName); }; [Exposed=Window] @@ -6723,9 +6723,9 @@

      I readonly attribute DOMString localName; readonly attribute DOMString name; readonly attribute DOMString nodeName; // historical alias of .name - attribute DOMString value; - [TreatNullAs=EmptyString] attribute DOMString nodeValue; // historical alias of .value - [TreatNullAs=EmptyString] attribute DOMString textContent; // historical alias of .value + [CEReactions] attribute DOMString value; + [CEReactions, TreatNullAs=EmptyString] attribute DOMString nodeValue; // historical alias of .value + [CEReactions, TreatNullAs=EmptyString] attribute DOMString textContent; // historical alias of .value readonly attribute Element? ownerElement; @@ -6783,11 +6783,11 @@

      I const unsigned short END_TO_START = 3; short compareBoundaryPoints(unsigned short how, Range sourceRange); - void deleteContents(); - [NewObject] DocumentFragment extractContents(); - [NewObject] DocumentFragment cloneContents(); - void insertNode(Node node); - void surroundContents(Node newParent); + [CEReactions] void deleteContents(); + [CEReactions, NewObject] DocumentFragment extractContents(); + [CEReactions, NewObject] DocumentFragment cloneContents(); + [CEReactions] void insertNode(Node node); + [CEReactions] void surroundContents(Node newParent); [NewObject] Range cloneRange(); void detach(); @@ -6858,12 +6858,12 @@

      I readonly attribute unsigned long length; getter DOMString? item(unsigned long index); boolean contains(DOMString token); - void add(DOMString... tokens); - void remove(DOMString... tokens); - boolean toggle(DOMString token, optional boolean force); - void replace(DOMString token, DOMString newToken); + [CEReactions] void add(DOMString... tokens); + [CEReactions] void remove(DOMString... tokens); + [CEReactions] boolean toggle(DOMString token, optional boolean force); + [CEReactions] void replace(DOMString token, DOMString newToken); boolean supports(DOMString token); - attribute DOMString value; + [CEReactions] attribute DOMString value; stringifier; iterable<DOMString>; }; From a768d8eef0584ea8ee831895b5c9dc8bcf363afc Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 21 Apr 2016 18:14:02 +0200 Subject: [PATCH 27/30] Editorial: check stop propagation flag at start of invoke --- dom.bs | 15 +++++++-------- dom.html | 8 +++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/dom.bs b/dom.bs index f6dd8d52f..801d909ca 100644 --- a/dom.bs +++ b/dom.bs @@ -1160,14 +1160,12 @@ for discussion).
    1. Initialize event's {{Event/eventPhase}} attribute to {{Event/CAPTURING_PHASE}}. -

    2. For each object in eventPath, in reverse order, if event's - stop propagation flag is unset and object is not target, invoke - object with event. +

    3. For each object in eventPath, in reverse order, if object + is not target, invoke object with event.

    4. Initialize event's {{Event/eventPhase}} attribute to {{Event/AT_TARGET}}. -

    5. If event's stop propagation flag is unset, invoke target - with event. +

    6. Invoke target with event.

    7. If event's {{Event/bubbles}} attribute value is true, run these substeps: @@ -1175,9 +1173,8 @@ for discussion).

      1. Initialize event's {{Event/eventPhase}} attribute to {{Event/BUBBLING_PHASE}}. -

      2. For each object in eventPath, if event's - stop propagation flag is unset and object is not target, - invoke object with event. +

      3. For each object in eventPath, if object is not + target, invoke object with event.

    8. Unset event's dispatch flag. @@ -1193,6 +1190,8 @@ for discussion). object with event, run these steps:

        +
      1. If event's stop propagation flag is set, then terminate these steps. +

      2. Let listeners be the empty list.

      3. diff --git a/dom.html b/dom.html index 0757133d2..f302cfdad 100644 --- a/dom.html +++ b/dom.html @@ -848,18 +848,18 @@

        Initialize event’s eventPhase attribute to CAPTURING_PHASE.

      4. -

        For each object in eventPath, in reverse order, if event’s stop propagation flag is unset and object is not target, invoke object with event.

        +

        For each object in eventPath, in reverse order, if object is not target, invoke object with event.

      5. Initialize event’s eventPhase attribute to AT_TARGET.

      6. -

        If event’s stop propagation flag is unset, invoke target with event.

        +

        Invoke target with event.

      7. If event’s bubbles attribute value is true, run these substeps:

        1. Initialize event’s eventPhase attribute to BUBBLING_PHASE.

        2. -

          For each object in eventPath, if event’s stop propagation flag is unset and object is not target, invoke object with event.

          +

          For each object in eventPath, if object is not target, invoke object with event.

      8. Unset event’s dispatch flag.

        @@ -872,6 +872,8 @@

        To invoke an object with event, run these steps:

          +
        1. +

          If event’s stop propagation flag is set, then terminate these steps.

        2. Let listeners be the empty list.

        3. From a77a920bda1172e5cb516ff692322df03ef5bbd5 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 26 Apr 2016 06:45:27 +0200 Subject: [PATCH 28/30] =?UTF-8?q?Editorial:=20deduplicate=20Veli=20=C5=9Ee?= =?UTF-8?q?nol?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dom.bs | 3 +-- dom.html | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dom.bs b/dom.bs index 801d909ca..1ce80bbbc 100644 --- a/dom.bs +++ b/dom.bs @@ -9812,7 +9812,6 @@ Ryosuke Niwa, Sam Dutton, Samuel Giles, Sebastian Mayr, -senolv, Seo Sanghyeon, Sergey G. Grekhov, Shiki Okasaka, @@ -9829,7 +9828,7 @@ Tobie Langel, Tom Pixley, Travis Leithead, triple-underscore, -Veli Senol, +Veli Şenol, Vidur Apparao, Warren He, Yehuda Katz, diff --git a/dom.html b/dom.html index f302cfdad..b8e65ffa4 100644 --- a/dom.html +++ b/dom.html @@ -71,7 +71,7 @@

          DOM

          -

          Living Standard — Last Updated

          +

          Living Standard — Last Updated

          @@ -5302,7 +5302,7 @@

          Acknowledgmen Ryosuke Niwa, Sam Dutton, Samuel Giles, -Sebastian Mayr, senolv, +Sebastian Mayr, Seo Sanghyeon, Sergey G. Grekhov, Shiki Okasaka, @@ -5317,7 +5317,7 @@

          Acknowledgmen Tobie Langel, Tom Pixley, Travis Leithead, triple-underscore, -Veli Senol, +Veli Şenol, Vidur Apparao, Warren He, Yehuda Katz, From 2185b636b7c12cb338f527e9ec8ab7c7d0554d26 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 26 Apr 2016 10:13:35 +0200 Subject: [PATCH 29/30] Editorial: define defaults for EventListenerOptions Although this is also done in prose, this nonetheless simplifies the prose a bit and makes it clearer to those skimming the standard what is going on (although skimming is not recommended). Fixes #239. --- dom.bs | 18 ++++++++---------- dom.html | 20 ++++++++------------ 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/dom.bs b/dom.bs index 1ce80bbbc..7ac7bef57 100644 --- a/dom.bs +++ b/dom.bs @@ -951,12 +951,12 @@ callback interface EventListener { }; dictionary EventListenerOptions { - boolean capture; + boolean capture = false; }; dictionary AddEventListenerOptions : EventListenerOptions { - boolean passive; - boolean once; + boolean passive = false; + boolean once = false; }; @@ -1039,8 +1039,8 @@ steps:
        4. If options is a boolean, set capture to options. -

        5. If options is a dictionary and {{EventListenerOptions/capture}} is - present in options with value true, then set capture to true. +

        6. If options is a dictionary, then set capture to options's + {{EventListenerOptions/capture}}.

        7. Return capture.

        @@ -1053,11 +1053,9 @@ steps:
      9. Let once and passive be false. -

      10. If options is a dictionary and {{AddEventListenerOptions/passive}} - is present in options with value true, then set passive to true. - -

      11. If options is a dictionary and {{AddEventListenerOptions/once}} is - present in options with value true, then set once to true. +

      12. If options is a dictionary, then set passive to options's + {{AddEventListenerOptions/passive}} and once to options's + {{AddEventListenerOptions/once}}.

      13. Return capture, passive, and once.

      diff --git a/dom.html b/dom.html index b8e65ffa4..0e2da74c9 100644 --- a/dom.html +++ b/dom.html @@ -705,12 +705,12 @@

      EventListenerOptions { - boolean capture; + boolean capture = false; }; dictionary AddEventListenerOptions : EventListenerOptions { - boolean passive; - boolean once; + boolean passive = false; + boolean once = false; };

      The EventTarget object represents the target to which an event is dispatched when something has occurred.

      @@ -760,8 +760,7 @@

      If options is a boolean, set capture to options.

    9. -

      If options is a dictionary and capture is - present in options with value true, then set capture to true.

      +

      If options is a dictionary, then set capture to options’s capture.

    10. Return capture.

    @@ -773,10 +772,7 @@

    Let once and passive be false.

  • -

    If options is a dictionary and passive is present in options with value true, then set passive to true.

    -
  • -

    If options is a dictionary and once is - present in options with value true, then set once to true.

    +

    If options is a dictionary, then set passive to options’s passive and once to options’s once.

  • Return capture, passive, and once.

    @@ -6406,12 +6402,12 @@

    I }; dictionary EventListenerOptions { - boolean capture; + boolean capture = false; }; dictionary AddEventListenerOptions : EventListenerOptions { - boolean passive; - boolean once; + boolean passive = false; + boolean once = false; }; [NoInterfaceObject, From e4f904f3744ef258431b1d691373988d75b236a5 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 27 Apr 2016 10:38:56 +0200 Subject: [PATCH 30/30] Meta: link to Japanese translation See https://github.com/triple-underscore/triple-underscore.github.io/issues/1 for more details. --- dom.bs | 1 + dom.html | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dom.bs b/dom.bs index 7ac7bef57..cf7692b48 100644 --- a/dom.bs +++ b/dom.bs @@ -9,6 +9,7 @@ No Editor: true !Participate: IRC: #whatwg on Freenode !Commits: GitHub whatwg/dom/commits !Commits: @thedomstandard +!Translation (non-normative): 日本語 Logo: https://resources.whatwg.org/logo-dom.svg Abstract: DOM defines a platform-neutral model for events and node trees. Ignored Terms: EmptyString, Array, Document diff --git a/dom.html b/dom.html index 0e2da74c9..3d8783ded 100644 --- a/dom.html +++ b/dom.html @@ -71,7 +71,7 @@

    DOM

    -

    Living Standard — Last Updated

    +

    Living Standard — Last Updated

    @@ -81,6 +81,8 @@

    GitHub whatwg/dom/commits
    @thedomstandard +
    Translation (non-normative): +
    日本語