Skip to content

Commit

Permalink
Move [Clamp], [EnforceRange], and [TreatNullAs] extended attributes t…
Browse files Browse the repository at this point in the history
…o types in our webidls
  • Loading branch information
Manishearth committed Mar 2, 2019
1 parent 86c8ebc commit d119cfd
Show file tree
Hide file tree
Showing 16 changed files with 496 additions and 497 deletions.
4 changes: 2 additions & 2 deletions components/script/dom/webidls/Blob.webidl
Expand Up @@ -13,8 +13,8 @@ interface Blob {
readonly attribute DOMString type;

// slice Blob into byte-ranged chunks
Blob slice([Clamp] optional long long start,
[Clamp] optional long long end,
Blob slice(optional [Clamp] long long start,
optional [Clamp] long long end,
optional DOMString contentType);
};

Expand Down
934 changes: 467 additions & 467 deletions components/script/dom/webidls/CSSStyleDeclaration.webidl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion components/script/dom/webidls/CharacterData.webidl
Expand Up @@ -11,7 +11,7 @@

[Abstract]
interface CharacterData : Node {
[Pure, TreatNullAs=EmptyString] attribute DOMString data;
[Pure] attribute [TreatNullAs=EmptyString] DOMString data;
[Pure] readonly attribute unsigned long length;
[Pure, Throws]
DOMString substringData(unsigned long offset, unsigned long count);
Expand Down
8 changes: 4 additions & 4 deletions components/script/dom/webidls/Document.webidl
Expand Up @@ -152,8 +152,8 @@ Document implements DocumentAndElementEventHandlers;

// https://html.spec.whatwg.org/multipage/#Document-partial
partial interface Document {
[CEReactions, TreatNullAs=EmptyString]
attribute DOMString fgColor;
[CEReactions]
attribute [TreatNullAs=EmptyString] DOMString fgColor;

// https://github.com/servo/servo/issues/8715
// [CEReactions, TreatNullAs=EmptyString]
Expand All @@ -167,8 +167,8 @@ partial interface Document {
// [CEReactions, TreatNullAs=EmptyString]
// attribute DOMString alinkColor;

[CEReactions, TreatNullAs=EmptyString]
attribute DOMString bgColor;
[CEReactions]
attribute [TreatNullAs=EmptyString] DOMString bgColor;

[SameObject]
readonly attribute HTMLCollection anchors;
Expand Down
8 changes: 4 additions & 4 deletions components/script/dom/webidls/Element.webidl
Expand Up @@ -109,10 +109,10 @@ partial interface Element {

// https://w3c.github.io/DOM-Parsing/#extensions-to-the-element-interface
partial interface Element {
[CEReactions, Throws,TreatNullAs=EmptyString]
attribute DOMString innerHTML;
[CEReactions, Throws,TreatNullAs=EmptyString]
attribute DOMString outerHTML;
[CEReactions, Throws]
attribute [TreatNullAs=EmptyString] DOMString innerHTML;
[CEReactions, Throws]
attribute [TreatNullAs=EmptyString] DOMString outerHTML;
};

// https://fullscreen.spec.whatwg.org/#api
Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/webidls/HTMLBodyElement.webidl
Expand Up @@ -11,7 +11,7 @@ HTMLBodyElement implements WindowEventHandlers;

// https://html.spec.whatwg.org/multipage/#HTMLBodyElement-partial
partial interface HTMLBodyElement {
[CEReactions, TreatNullAs=EmptyString] attribute DOMString text;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString text;

// https://github.com/servo/servo/issues/8715
//[CEReactions, TreatNullAs=EmptyString] attribute DOMString link;
Expand All @@ -22,6 +22,6 @@ partial interface HTMLBodyElement {
// https://github.com/servo/servo/issues/8717
//[CEReactions, TreatNullAs=EmptyString] attribute DOMString aLink;

[CEReactions, TreatNullAs=EmptyString] attribute DOMString bgColor;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor;
[CEReactions] attribute DOMString background;
};
2 changes: 1 addition & 1 deletion components/script/dom/webidls/HTMLElement.webidl
Expand Up @@ -46,7 +46,7 @@ interface HTMLElement : Element {
// attribute boolean spellcheck;
// void forceSpellCheck();

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

// command API
// readonly attribute DOMString? commandType;
Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/webidls/HTMLFontElement.webidl
Expand Up @@ -5,8 +5,8 @@
// https://html.spec.whatwg.org/multipage/#htmlfontelement
[HTMLConstructor]
interface HTMLFontElement : HTMLElement {
[CEReactions, TreatNullAs=EmptyString]
attribute DOMString color;
[CEReactions]
attribute [TreatNullAs=EmptyString] DOMString color;
[CEReactions]
attribute DOMString face;
[CEReactions]
Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/webidls/HTMLImageElement.webidl
Expand Up @@ -43,8 +43,8 @@ partial interface HTMLImageElement {
[CEReactions]
attribute DOMString longDesc;

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

// https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlimageelement-interface
Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/webidls/HTMLInputElement.webidl
Expand Up @@ -68,8 +68,8 @@ interface HTMLInputElement : HTMLElement {
attribute DOMString type;
[CEReactions]
attribute DOMString defaultValue;
[CEReactions, TreatNullAs=EmptyString, SetterThrows]
attribute DOMString value;
[CEReactions, SetterThrows]
attribute [TreatNullAs=EmptyString] DOMString value;
// attribute Date? valueAsDate;
// attribute unrestricted double valueAsNumber;
// attribute double valueLow;
Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/webidls/HTMLTableCellElement.webidl
Expand Up @@ -40,6 +40,6 @@ partial interface HTMLTableCellElement {
// [CEReactions]
// attribute DOMString vAlign;

[CEReactions, TreatNullAs=EmptyString]
attribute DOMString bgColor;
[CEReactions]
attribute [TreatNullAs=EmptyString] DOMString bgColor;
};
4 changes: 2 additions & 2 deletions components/script/dom/webidls/HTMLTableElement.webidl
Expand Up @@ -48,8 +48,8 @@ partial interface HTMLTableElement {
[CEReactions]
attribute DOMString width;

[CEReactions, TreatNullAs=EmptyString]
attribute DOMString bgColor;
[CEReactions]
attribute [TreatNullAs=EmptyString] DOMString bgColor;
// [CEReactions, TreatNullAs=EmptyString]
// attribute DOMString cellPadding;
// [CEReactions, TreatNullAs=EmptyString]
Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/webidls/HTMLTableRowElement.webidl
Expand Up @@ -27,6 +27,6 @@ partial interface HTMLTableRowElement {
// [CEReactions]
// attribute DOMString vAlign;

[CEReactions, TreatNullAs=EmptyString]
attribute DOMString bgColor;
[CEReactions]
attribute [TreatNullAs=EmptyString] DOMString bgColor;
};
3 changes: 1 addition & 2 deletions components/script/dom/webidls/HTMLTextAreaElement.webidl
Expand Up @@ -37,8 +37,7 @@ interface HTMLTextAreaElement : HTMLElement {
readonly attribute DOMString type;
[CEReactions]
attribute DOMString defaultValue;
[TreatNullAs=EmptyString]
attribute DOMString value;
attribute [TreatNullAs=EmptyString] DOMString value;
readonly attribute unsigned long textLength;

// readonly attribute boolean willValidate;
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/webidls/MediaList.webidl
Expand Up @@ -5,7 +5,7 @@
// https://drafts.csswg.org/cssom/#the-medialist-interface
// [LegacyArrayClass]
interface MediaList {
[TreatNullAs=EmptyString] /* stringifier */ attribute DOMString mediaText;
/* stringifier */ attribute [TreatNullAs=EmptyString] DOMString mediaText;
readonly attribute unsigned long length;
getter DOMString? item(unsigned long index);
void appendMedium(DOMString medium);
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/webidls/WebSocket.webidl
Expand Up @@ -23,7 +23,7 @@ interface WebSocket : EventTarget {
attribute EventHandler onclose;
//readonly attribute DOMString extensions;
readonly attribute DOMString protocol;
[Throws] void close([Clamp] optional unsigned short code, optional USVString reason);
[Throws] void close(optional [Clamp] unsigned short code, optional USVString reason);

//messaging
attribute EventHandler onmessage;
Expand Down

0 comments on commit d119cfd

Please sign in to comment.