Skip to content

Element interfaces across browsers #1015

@domenic

Description

@domenic

In https://www.w3.org/Bugs/Public/show_bug.cgi?id=27877 @bzbarsky brought up that element interfaces are not greatly defined in the current spec. In #1012 we are trying to nail them down better, but I am sticking to basically what the current spec says. There are a couple notable instances where browsers deviate from the more-precise version in #1012.

For clarity, #1012 includes:

  1. If name is bgsound, blink, isindex, multicol, nextid, or spacer, return HTMLUnknownElement.
  2. If name is acronym, basefont, big, center, listing, nobr, noembed, noframes, plaintext, rb, rtc, strike, tt, or xmp, return HTMLElement.
  3. Otherwise, if this specification defines an interface appropriate for the element type corresponding to the local name name, return that interface.
  4. If other applicable specifications define an appropriate interface for name, return the interface they define.
  5. If name is a valid custom element name, return HTMLElement.
  6. Return HTMLUnknownElement.

It is these first two steps I want to focus on.

With the help of https://jsbin.com/liticisino/edit?html,console, which goes through all elements listed as "obsolete" in the spec, and tests across Chrome, Firefox, and Edge, I have noted the following issues:

Element(s) Spec Chrome Firefox Edge Safari
applet HTMLAppletElement HTMLUnknownElement HTMLAppletElement HTMLAppletElement HTMLAppletElement
xmp, listing HTMLElement HTMLPreElement HTMLElement HTMLPreElement HTMLPreElement
blink HTMLUnknownElement HTMLUnknownElement HTMLUnknownElement HTMLElement HTMLUnknownElement
rb, rtc HTMLElement HTMLElement HTMLElement HTMLUnknownElement HTMLElement
marquee HTMLMarqueeElement HTMLMarqueeElement HTMLDivElement HTMLMarqueeElement HTMLMarqueeElement
basefont HTMLElement HTMLElement HTMLElement HTMLBaseFontElement HTMLBaseFontElement

These all seem like browser bugs except applet (#454) and maaaybe xmp/listing. It would be good to fill in the Safari parts of the table though, and to see what implementers think. /cc @DigiTec who I know has been looking into this somewhat recently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatStandard is not web compatible or proprietary feature needs standardizing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions