From ebd5af0fd6f12ac63cf39d570e128c0051158bba Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Mon, 2 Oct 2017 02:38:28 -0700 Subject: [PATCH] Define document.all as having [[IsHTMLDDA]] Fixes #3015. --- source | 71 ++++++++++++++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/source b/source index ae73f335f87..e74fadd3e0d 100644 --- a/source +++ b/source @@ -3055,6 +3055,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The SharedArrayBuffer class
  • The TypeError class
  • The RangeError class
  • +
  • The [[IsHTMLDDA]] internal slot
  • The typeof operator
  • The TypedArray Constructors table
  • @@ -7157,15 +7158,43 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute different (ab)uses of its methods to all end up returning something, and that it can be called as a function as an alternative to property access.

    -

    Objects that implement the HTMLAllCollection interface are legacy platform objects with an additonal [[Call]] internal - method described in the section below.

    -

    All HTMLAllCollection objects are rooted at a Document and have a filter that matches all elements, so the elements represented by the collection of an HTMLAllCollection object consist of all the descendant elements of the root Document.

    +

    Objects that implement the HTMLAllCollection interface are legacy platform objects with an additonal [[Call]] internal + method described in the section below. They also have an + [[IsHTMLDDA]] internal slot.

    + +
    +

    Objects that implement the HTMLAllCollection interface have several unusual + behaviors, due of the fact that they have an [[IsHTMLDDA]] internal slot:

    + + + +

    These special behaviors are motivated by a desire for compatibility with two classes of legacy + content: one that uses the presence of document.all as a + way to detect legacy user agents, and one that only supports those legacy user agents and uses + the document.all object without testing for its presence + first.

    +
    +
    [Exposed=Window,
      LegacyUnenumerableNamedProperties]
     interface HTMLAllCollection {
    @@ -7174,7 +7203,7 @@ interface HTMLAllCollection {
       getter (HTMLCollection or Element)? namedItem(DOMString name);
       (HTMLCollection or Element)? item(optional DOMString nameOrIndex);
     
    -  // Note: HTMLAllCollection objects have a custom [[Call]] internal method.
    +  // Note: HTMLAllCollection objects have a custom [[Call]] internal method and an [[IsHTMLDDA]] internal slot.
     };
    @@ -114120,38 +114149,6 @@ interface HTMLFontElement : HTMLElement { HTMLAllCollection rooted at the Document node, whose filter matches all elements.

    -

    The object returned for all has several unusual - behaviors:

    - - - -

    These requirements are a willful violation of the JavaScript - specification current at the time of writing. The JavaScript specification - requires that ToBoolean return true for all objects, and does not have - provisions for objects acting as if they were undefined for the purposes of - certain operators. This violation is motivated by a desire for compatibility with two classes of - legacy content: one that uses the presence of document.all - as a way to detect legacy user agents, and one that only supports those legacy user agents and - uses the document.all object without testing for its - presence first.

    -
    partial interface Window {