Skip to content

Commit

Permalink
Bug 1631900 [wpt PR 23150] - Update interfaces/html.idl, a=testonly
Browse files Browse the repository at this point in the history
Automatic update from web-platform-tests
Update interfaces/html.idl (#23150)

Includes necessary idlharness.js updates (handling XYZ --> LegacyXYZ
renames) for web-platform-tests/wpt#23148

Closes web-platform-tests/wpt#23124
--

wpt-commits: 513fe4fe493fd1215987460781345e9fc4cc7b0d
wpt-pr: 23150

UltraBlame original commit: 3d240952f1977fb63a054c6711d4a530359a2cda
  • Loading branch information
marco-c committed May 3, 2020
1 parent 2725644 commit e4b7356
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 67 deletions.
116 changes: 58 additions & 58 deletions testing/web-platform/tests/interfaces/html.idl
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ interface DOMStringList {
enum DocumentReadyState { "loading", "interactive", "complete" };
typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;

[OverrideBuiltins]
[LegacyOverrideBuiltIns]
partial interface Document {
// resource metadata management
[PutForwards=href, Unforgeable] readonly attribute Location? location;
[PutForwards=href, LegacyUnforgeable] readonly attribute Location? location;
attribute USVString domain;
readonly attribute USVString referrer;
attribute USVString cookie;
Expand Down Expand Up @@ -89,7 +89,7 @@ partial interface Document {
DOMString queryCommandValue(DOMString commandId);

// special event handler IDL attributes that only apply to Document objects
[LenientThis] attribute EventHandler onreadystatechange;
[LegacyLenientThis] attribute EventHandler onreadystatechange;

// also has obsolete members
};
Expand Down Expand Up @@ -119,7 +119,7 @@ interface HTMLElement : Element {
[CEReactions] attribute boolean spellcheck;
[CEReactions] attribute DOMString autocapitalize;

[CEReactions] attribute [TreatNullAs=EmptyString] DOMString innerText;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString innerText;

ElementInternals attachInternals();
};
Expand All @@ -145,7 +145,7 @@ interface mixin HTMLOrSVGElement {
};

[Exposed=Window,
OverrideBuiltins]
LegacyOverrideBuiltIns]
interface DOMStringMap {
getter DOMString (DOMString name);
[CEReactions] setter void (DOMString name, DOMString value);
Expand Down Expand Up @@ -365,7 +365,7 @@ interface HTMLSourceElement : HTMLElement {
};

[Exposed=Window,
NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
LegacyFactoryFunction=Image(optional unsigned long width, optional unsigned long height)]
interface HTMLImageElement : HTMLElement {
[HTMLConstructor] constructor();

Expand Down Expand Up @@ -463,7 +463,7 @@ interface HTMLVideoElement : HTMLMediaElement {
};

[Exposed=Window,
NamedConstructor=Audio(optional DOMString src)]
LegacyFactoryFunction=Audio(optional DOMString src)]
interface HTMLAudioElement : HTMLMediaElement {
[HTMLConstructor] constructor();
};
Expand Down Expand Up @@ -766,7 +766,7 @@ interface HTMLTableCellElement : HTMLElement {
};

[Exposed=Window,
OverrideBuiltins,
LegacyOverrideBuiltIns,
LegacyUnenumerableNamedProperties]
interface HTMLFormElement : HTMLElement {
[HTMLConstructor] constructor();
Expand Down Expand Up @@ -840,7 +840,7 @@ interface HTMLInputElement : HTMLElement {
[CEReactions] attribute DOMString step;
[CEReactions] attribute DOMString type;
[CEReactions] attribute DOMString defaultValue;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString value;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString value;
attribute object? valueAsDate;
attribute unrestricted double valueAsNumber;
[CEReactions] attribute unsigned long width;
Expand Down Expand Up @@ -944,7 +944,7 @@ interface HTMLOptGroupElement : HTMLElement {
};

[Exposed=Window,
NamedConstructor=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false)]
LegacyFactoryFunction=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false)]
interface HTMLOptionElement : HTMLElement {
[HTMLConstructor] constructor();

Expand Down Expand Up @@ -979,7 +979,7 @@ interface HTMLTextAreaElement : HTMLElement {

readonly attribute DOMString type;
[CEReactions] attribute DOMString defaultValue;
attribute [TreatNullAs=EmptyString] DOMString value;
attribute [LegacyNullToEmptyString] DOMString value;
readonly attribute unsigned long textLength;

readonly attribute boolean willValidate;
Expand Down Expand Up @@ -1269,7 +1269,7 @@ interface mixin CanvasFillStrokeStyles {
attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black)
CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
CanvasPattern? createPattern(CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition);
CanvasPattern? createPattern(CanvasImageSource image, [LegacyNullToEmptyString] DOMString repetition);

};

Expand Down Expand Up @@ -1593,11 +1593,11 @@ dictionary DragEventInit : MouseEventInit {
LegacyUnenumerableNamedProperties]
interface Window : EventTarget {
// the current browsing context
[Unforgeable] readonly attribute WindowProxy window;
[LegacyUnforgeable] readonly attribute WindowProxy window;
[Replaceable] readonly attribute WindowProxy self;
[Unforgeable] readonly attribute Document document;
[LegacyUnforgeable] readonly attribute Document document;
attribute DOMString name;
[PutForwards=href, Unforgeable] readonly attribute Location location;
[PutForwards=href, LegacyUnforgeable] readonly attribute Location location;
readonly attribute History history;
readonly attribute CustomElementRegistry customElements;
[Replaceable] readonly attribute BarProp locationbar;
Expand All @@ -1616,11 +1616,11 @@ interface Window : EventTarget {
// other browsing contexts
[Replaceable] readonly attribute WindowProxy frames;
[Replaceable] readonly attribute unsigned long length;
[Unforgeable] readonly attribute WindowProxy? top;
[LegacyUnforgeable] readonly attribute WindowProxy? top;
attribute any opener;
[Replaceable] readonly attribute WindowProxy? parent;
readonly attribute Element? frameElement;
WindowProxy? open(optional USVString url = "", optional DOMString target = "_blank", optional [TreatNullAs=EmptyString] DOMString features = "");
WindowProxy? open(optional USVString url = "", optional DOMString target = "_blank", optional [LegacyNullToEmptyString] DOMString features = "");
getter object (DOMString name);
// Since this is the global object, the IDL named getter adds a NamedPropertiesObject exotic
// object on the prototype chain. Indeed, this does not make the global object an exotic object.
Expand Down Expand Up @@ -1668,21 +1668,21 @@ interface History {

[Exposed=Window]
interface Location { // but see also additional creation steps and overridden internal methods
[Unforgeable] stringifier attribute USVString href;
[Unforgeable] readonly attribute USVString origin;
[Unforgeable] attribute USVString protocol;
[Unforgeable] attribute USVString host;
[Unforgeable] attribute USVString hostname;
[Unforgeable] attribute USVString port;
[Unforgeable] attribute USVString pathname;
[Unforgeable] attribute USVString search;
[Unforgeable] attribute USVString hash;
[LegacyUnforgeable] stringifier attribute USVString href;
[LegacyUnforgeable] readonly attribute USVString origin;
[LegacyUnforgeable] attribute USVString protocol;
[LegacyUnforgeable] attribute USVString host;
[LegacyUnforgeable] attribute USVString hostname;
[LegacyUnforgeable] attribute USVString port;
[LegacyUnforgeable] attribute USVString pathname;
[LegacyUnforgeable] attribute USVString search;
[LegacyUnforgeable] attribute USVString hash;

[Unforgeable] void assign(USVString url);
[Unforgeable] void replace(USVString url);
[Unforgeable] void reload();
[LegacyUnforgeable] void assign(USVString url);
[LegacyUnforgeable] void replace(USVString url);
[LegacyUnforgeable] void reload();

[Unforgeable, SameObject] readonly attribute DOMStringList ancestorOrigins;
[LegacyUnforgeable, SameObject] readonly attribute DOMStringList ancestorOrigins;
};

[Exposed=Window,
Expand Down Expand Up @@ -1787,15 +1787,15 @@ dictionary PromiseRejectionEventInit : EventInit {
any reason;
};

[TreatNonObjectAsNull]
[LegacyTreatNonObjectAsNull]
callback EventHandlerNonNull = any (Event event);
typedef EventHandlerNonNull? EventHandler;

[TreatNonObjectAsNull]
[LegacyTreatNonObjectAsNull]
callback OnErrorEventHandlerNonNull = any ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long colno, optional any error);
typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;

[TreatNonObjectAsNull]
[LegacyTreatNonObjectAsNull]
callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event);
typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler;

Expand Down Expand Up @@ -1836,8 +1836,8 @@ interface mixin GlobalEventHandlers {
attribute EventHandler onloadedmetadata;
attribute EventHandler onloadstart;
attribute EventHandler onmousedown;
[LenientThis] attribute EventHandler onmouseenter;
[LenientThis] attribute EventHandler onmouseleave;
[LegacyLenientThis] attribute EventHandler onmouseenter;
[LegacyLenientThis] attribute EventHandler onmouseleave;
attribute EventHandler onmousemove;
attribute EventHandler onmouseout;
attribute EventHandler onmouseover;
Expand Down Expand Up @@ -1969,7 +1969,7 @@ interface mixin NavigatorLanguage {
};

interface mixin NavigatorContentUtils {
[SecureContext] void registerProtocolHandler(DOMString scheme, USVString url, DOMString title);
[SecureContext] void registerProtocolHandler(DOMString scheme, USVString url);
[SecureContext] void unregisterProtocolHandler(DOMString scheme, USVString url);
};

Expand Down Expand Up @@ -2361,8 +2361,8 @@ interface HTMLFrameElement : HTMLElement {
readonly attribute Document? contentDocument;
readonly attribute WindowProxy? contentWindow;

[CEReactions] attribute [TreatNullAs=EmptyString] DOMString marginHeight;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString marginWidth;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString marginHeight;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString marginWidth;
};

partial interface HTMLAnchorElement {
Expand All @@ -2378,11 +2378,11 @@ partial interface HTMLAreaElement {
};

partial interface HTMLBodyElement {
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString text;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString link;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString vLink;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString aLink;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString text;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString link;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString vLink;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString aLink;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor;
[CEReactions] attribute DOMString background;
};

Expand Down Expand Up @@ -2426,7 +2426,7 @@ partial interface HTMLEmbedElement {
interface HTMLFontElement : HTMLElement {
[HTMLConstructor] constructor();

[CEReactions] attribute [TreatNullAs=EmptyString] DOMString color;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString color;
[CEReactions] attribute DOMString face;
[CEReactions] attribute DOMString size;
};
Expand All @@ -2453,8 +2453,8 @@ partial interface HTMLIFrameElement {
[CEReactions] attribute DOMString frameBorder;
[CEReactions] attribute USVString longDesc;

[CEReactions] attribute [TreatNullAs=EmptyString] DOMString marginHeight;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString marginWidth;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString marginHeight;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString marginWidth;
};

partial interface HTMLImageElement {
Expand All @@ -2465,7 +2465,7 @@ partial interface HTMLImageElement {
[CEReactions] attribute unsigned long vspace;
[CEReactions] attribute USVString longDesc;

[CEReactions] attribute [TreatNullAs=EmptyString] DOMString border;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString border;
};

partial interface HTMLInputElement {
Expand Down Expand Up @@ -2506,7 +2506,7 @@ partial interface HTMLObjectElement {
[CEReactions] attribute DOMString codeBase;
[CEReactions] attribute DOMString codeType;

[CEReactions] attribute [TreatNullAs=EmptyString] DOMString border;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString border;
};

partial interface HTMLOListElement {
Expand Down Expand Up @@ -2544,9 +2544,9 @@ partial interface HTMLTableElement {
[CEReactions] attribute DOMString summary;
[CEReactions] attribute DOMString width;

[CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString cellPadding;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString cellSpacing;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString cellPadding;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString cellSpacing;
};

partial interface HTMLTableSectionElement {
Expand All @@ -2567,7 +2567,7 @@ partial interface HTMLTableCellElement {
[CEReactions] attribute boolean noWrap;
[CEReactions] attribute DOMString vAlign;

[CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor;
};

partial interface HTMLTableRowElement {
Expand All @@ -2576,7 +2576,7 @@ partial interface HTMLTableRowElement {
[CEReactions] attribute DOMString chOff;
[CEReactions] attribute DOMString vAlign;

[CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor;
};

partial interface HTMLUListElement {
Expand All @@ -2585,11 +2585,11 @@ partial interface HTMLUListElement {
};

partial interface Document {
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString fgColor;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString linkColor;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString vlinkColor;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString alinkColor;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString fgColor;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString linkColor;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString vlinkColor;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString alinkColor;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor;

[SameObject] readonly attribute HTMLCollection anchors;
[SameObject] readonly attribute HTMLCollection applets;
Expand Down
24 changes: 15 additions & 9 deletions testing/web-platform/tests/resources/idlharness.js
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,8 @@ function IdlInterface(obj, is_callback, is_mixin)


this.members = obj.members.map(function(m){return new IdlInterfaceMember(m); });
if (this.has_extended_attribute("Unforgeable")) {
if (this.has_extended_attribute("Unforgeable") ||
this.has_extended_attribute("LegacyUnforgeable")) {
this.members
.filter(function(m) { return m.special !== "static" && (m.type == "attribute" || m.type == "operation"); })
.forEach(function(m) { return m.isUnforgeable = true; });
Expand Down Expand Up @@ -1795,11 +1796,12 @@ IdlInterface.prototype.test_self = function()
}.bind(this), this.name + " interface: legacy window alias");
}

if (this.has_extended_attribute("NamedConstructor")) {
if (this.has_extended_attribute("NamedConstructor") ||
this.has_extended_attribute("LegacyFactoryFunction")) {
var constructors = this.extAttrs
.filter(function(attr) { return attr.name == "NamedConstructor"; });
.filter(function(attr) { return attr.name == "NamedConstructor" || attr.name == "LegacyFactoryFunction"; });
if (constructors.length !== 1) {
throw new IdlHarnessError("Internal error: missing support for multiple NamedConstructor extended attributes");
throw new IdlHarnessError("Internal error: missing support for multiple LegacyFactoryFunction extended attributes");
}
var constructor = constructors[0];
var min_length = minOverloadLength([constructor]);
Expand Down Expand Up @@ -2371,7 +2373,8 @@ IdlInterface.prototype.test_member_attribute = function(member)
"The prototype object must have a property " +
format_value(member.name));

if (!member.has_extended_attribute("LenientThis")) {
if (!member.has_extended_attribute("LenientThis") &&
!member.has_extended_attribute("LegacyLenientThis")) {
if (member.idlType.generic !== "Promise") {

assert_throws_js(TypeError, function() {
Expand Down Expand Up @@ -3036,7 +3039,7 @@ IdlInterface.prototype.do_interface_attribute_asserts = function(obj, member, a_
assert_true(desc.enumerable, "property should be enumerable");
if (member.isUnforgeable)
{
assert_false(desc.configurable, "[Unforgeable] property must not be configurable");
assert_false(desc.configurable, "[LegacyUnforgeable] property must not be configurable");
}
else
{
Expand All @@ -3054,7 +3057,8 @@ IdlInterface.prototype.do_interface_attribute_asserts = function(obj, member, a_



if (!member.has_extended_attribute("LenientThis")) {
if (!member.has_extended_attribute("LenientThis") &&
!member.has_extended_attribute("LegacyLenientThis")) {
if (member.idlType.generic !== "Promise") {
assert_throws_js(globalOf(desc.get).TypeError, function() {
desc.get.call({});
Expand Down Expand Up @@ -3106,7 +3110,8 @@ IdlInterface.prototype.do_interface_attribute_asserts = function(obj, member, a_



if (!member.has_extended_attribute("LenientThis")) {
if (!member.has_extended_attribute("LenientThis") &&
!member.has_extended_attribute("LegacyLenientThis")) {
assert_throws_js(globalOf(desc.set).TypeError, function() {
desc.set.call({});
}.bind(this), "calling setter on wrong object type must throw TypeError");
Expand Down Expand Up @@ -3146,7 +3151,8 @@ function IdlInterfaceMember(obj)
this.extAttrs = [];
}

this.isUnforgeable = this.has_extended_attribute("Unforgeable");
this.isUnforgeable = this.has_extended_attribute("Unforgeable") ||
this.has_extended_attribute("LegacyUnforgeable");
this.isUnscopable = this.has_extended_attribute("Unscopable");
}

Expand Down

0 comments on commit e4b7356

Please sign in to comment.