Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch remaining cases of void #171

Merged
merged 2 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions ed/idlpatches/DOM-Parsing.idl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 67770dc936630fe71771140e2e922905ffa48e01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= <[email protected]>
Date: Wed, 14 Apr 2021 09:07:51 +0200
Subject: [PATCH] Fix void in DOM-Parsing.idl

https://github.com/w3c/DOM-Parsing/pull/64
---
ed/idl/DOM-Parsing.idl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ed/idl/DOM-Parsing.idl b/ed/idl/DOM-Parsing.idl
index 997126292..d0d84ab69 100644
--- a/ed/idl/DOM-Parsing.idl
+++ b/ed/idl/DOM-Parsing.idl
@@ -18,7 +18,7 @@ ShadowRoot includes InnerHTML;

partial interface Element {
[CEReactions] attribute [LegacyNullToEmptyString] DOMString outerHTML;
- [CEReactions] void insertAdjacentHTML(DOMString position, DOMString text);
+ [CEReactions] undefined insertAdjacentHTML(DOMString position, DOMString text);
};

partial interface Range {
--
2.31.1.295.g9ea45b61b8-goog

227 changes: 227 additions & 0 deletions ed/idlpatches/SVG-void.idl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
From 36cbbb25c6a82b7b5ca9d694e3db56a8fc466d1d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= <[email protected]>
Date: Wed, 14 Apr 2021 09:11:50 +0200
Subject: [PATCH] Fix void in SVG specs

https://github.com/w3c/svgwg/pull/833
---
ed/idl/SVG.idl | 54 +++++++++++++++++++--------------------
ed/idl/svg-animations.idl | 16 ++++++------
2 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/ed/idl/SVG.idl b/ed/idl/SVG.idl
index e0b013bfa..5c32cba3e 100644
--- a/ed/idl/SVG.idl
+++ b/ed/idl/SVG.idl
@@ -70,8 +70,8 @@ interface SVGLength {
attribute float valueInSpecifiedUnits;
attribute DOMString valueAsString;

- void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);
- void convertToSpecifiedUnits(unsigned short unitType);
+ undefined newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);
+ undefined convertToSpecifiedUnits(unsigned short unitType);
};

[Exposed=Window]
@@ -89,8 +89,8 @@ interface SVGAngle {
attribute float valueInSpecifiedUnits;
attribute DOMString valueAsString;

- void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);
- void convertToSpecifiedUnits(unsigned short unitType);
+ undefined newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);
+ undefined convertToSpecifiedUnits(unsigned short unitType);
};

[Exposed=Window]
@@ -99,14 +99,14 @@ interface SVGNumberList {
readonly attribute unsigned long length;
readonly attribute unsigned long numberOfItems;

- void clear();
+ undefined clear();
SVGNumber initialize(SVGNumber newItem);
getter SVGNumber getItem(unsigned long index);
SVGNumber insertItemBefore(SVGNumber newItem, unsigned long index);
SVGNumber replaceItem(SVGNumber newItem, unsigned long index);
SVGNumber removeItem(unsigned long index);
SVGNumber appendItem(SVGNumber newItem);
- setter void (unsigned long index, SVGNumber newItem);
+ setter undefined (unsigned long index, SVGNumber newItem);
};

[Exposed=Window]
@@ -115,14 +115,14 @@ interface SVGLengthList {
readonly attribute unsigned long length;
readonly attribute unsigned long numberOfItems;

- void clear();
+ undefined clear();
SVGLength initialize(SVGLength newItem);
getter SVGLength getItem(unsigned long index);
SVGLength insertItemBefore(SVGLength newItem, unsigned long index);
SVGLength replaceItem(SVGLength newItem, unsigned long index);
SVGLength removeItem(unsigned long index);
SVGLength appendItem(SVGLength newItem);
- setter void (unsigned long index, SVGLength newItem);
+ setter undefined (unsigned long index, SVGLength newItem);
};

[Exposed=Window]
@@ -131,14 +131,14 @@ interface SVGStringList {
readonly attribute unsigned long length;
readonly attribute unsigned long numberOfItems;

- void clear();
+ undefined clear();
DOMString initialize(DOMString newItem);
getter DOMString getItem(unsigned long index);
DOMString insertItemBefore(DOMString newItem, unsigned long index);
DOMString replaceItem(DOMString newItem, unsigned long index);
DOMString removeItem(unsigned long index);
DOMString appendItem(DOMString newItem);
- setter void (unsigned long index, DOMString newItem);
+ setter undefined (unsigned long index, DOMString newItem);
};

[Exposed=Window]
@@ -243,7 +243,7 @@ interface SVGSVGElement : SVGGraphicsElement {
boolean checkIntersection(SVGElement element, DOMRectReadOnly rect);
boolean checkEnclosure(SVGElement element, DOMRectReadOnly rect);

- void deselectAll();
+ undefined deselectAll();

SVGNumber createSVGNumber();
SVGLength createSVGLength();
@@ -259,9 +259,9 @@ interface SVGSVGElement : SVGGraphicsElement {
// Deprecated methods that have no effect when called,
// but which are kept for compatibility reasons.
unsigned long suspendRedraw(unsigned long maxWaitMilliseconds);
- void unsuspendRedraw(unsigned long suspendHandleID);
- void unsuspendRedrawAll();
- void forceRedraw();
+ undefined unsuspendRedraw(unsigned long suspendHandleID);
+ undefined unsuspendRedrawAll();
+ undefined forceRedraw();
};

SVGSVGElement includes SVGFitToViewBox;
@@ -353,12 +353,12 @@ interface SVGTransform {
[SameObject] readonly attribute DOMMatrix matrix;
readonly attribute float angle;

- void setMatrix(optional DOMMatrix2DInit matrix);
- void setTranslate(float tx, float ty);
- void setScale(float sx, float sy);
- void setRotate(float angle, float cx, float cy);
- void setSkewX(float angle);
- void setSkewY(float angle);
+ undefined setMatrix(optional DOMMatrix2DInit matrix);
+ undefined setTranslate(float tx, float ty);
+ undefined setScale(float sx, float sy);
+ undefined setRotate(float angle, float cx, float cy);
+ undefined setSkewX(float angle);
+ undefined setSkewY(float angle);
};

[Exposed=Window]
@@ -367,14 +367,14 @@ interface SVGTransformList {
readonly attribute unsigned long length;
readonly attribute unsigned long numberOfItems;

- void clear();
+ undefined clear();
SVGTransform initialize(SVGTransform newItem);
getter SVGTransform getItem(unsigned long index);
SVGTransform insertItemBefore(SVGTransform newItem, unsigned long index);
SVGTransform replaceItem(SVGTransform newItem, unsigned long index);
SVGTransform removeItem(unsigned long index);
SVGTransform appendItem(SVGTransform newItem);
- setter void (unsigned long index, SVGTransform newItem);
+ setter undefined (unsigned long index, SVGTransform newItem);

// Additional methods not common to other list interfaces.
SVGTransform createSVGTransformFromMatrix(optional DOMMatrix2DInit matrix);
@@ -466,14 +466,14 @@ interface SVGPointList {
readonly attribute unsigned long length;
readonly attribute unsigned long numberOfItems;

- void clear();
+ undefined clear();
DOMPoint initialize(DOMPoint newItem);
getter DOMPoint getItem(unsigned long index);
DOMPoint insertItemBefore(DOMPoint newItem, unsigned long index);
DOMPoint replaceItem(DOMPoint newItem, unsigned long index);
DOMPoint removeItem(unsigned long index);
DOMPoint appendItem(DOMPoint newItem);
- setter void (unsigned long index, DOMPoint newItem);
+ setter undefined (unsigned long index, DOMPoint newItem);
};

[Exposed=Window]
@@ -507,7 +507,7 @@ interface SVGTextContentElement : SVGGraphicsElement {
DOMRect getExtentOfChar(unsigned long charnum);
float getRotationOfChar(unsigned long charnum);
long getCharNumAtPosition(optional DOMPointInit point = {});
- void selectSubString(unsigned long charnum, unsigned long nchars);
+ undefined selectSubString(unsigned long charnum, unsigned long nchars);
};

[Exposed=Window]
@@ -589,8 +589,8 @@ interface SVGMarkerElement : SVGElement {
[SameObject] readonly attribute SVGAnimatedAngle orientAngle;
attribute DOMString orient;

- void setOrientToAuto();
- void setOrientToAngle(SVGAngle angle);
+ undefined setOrientToAuto();
+ undefined setOrientToAngle(SVGAngle angle);
};

SVGMarkerElement includes SVGFitToViewBox;
diff --git a/ed/idl/svg-animations.idl b/ed/idl/svg-animations.idl
index 79ef3121b..6c9579433 100644
--- a/ed/idl/svg-animations.idl
+++ b/ed/idl/svg-animations.idl
@@ -8,7 +8,7 @@ interface TimeEvent : Event {
readonly attribute WindowProxy? view;
readonly attribute long detail;

- void initTimeEvent(DOMString typeArg, Window? viewArg, long detailArg);
+ undefined initTimeEvent(DOMString typeArg, Window? viewArg, long detailArg);
};

interface SVGAnimationElement : SVGElement {
@@ -23,10 +23,10 @@ interface SVGAnimationElement : SVGElement {
float getCurrentTime();
float getSimpleDuration();

- void beginElement();
- void beginElementAt(float offset);
- void endElement();
- void endElementAt(float offset);
+ undefined beginElement();
+ undefined beginElementAt(float offset);
+ undefined endElement();
+ undefined endElementAt(float offset);
};

SVGAnimationElement includes SVGTests;
@@ -52,9 +52,9 @@ interface SVGDiscardElement : SVGAnimationElement {
};

partial interface SVGSVGElement {
- void pauseAnimations();
- void unpauseAnimations();
+ undefined pauseAnimations();
+ undefined unpauseAnimations();
boolean animationsPaused();
float getCurrentTime();
- void setCurrentTime(float seconds);
+ undefined setCurrentTime(float seconds);
};
--
2.31.1.295.g9ea45b61b8-goog

24 changes: 24 additions & 0 deletions ed/idlpatches/background-fetch.idl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 0e5625762df6bb0e0ae130e0ffaa0593a29b78ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= <[email protected]>
Date: Wed, 14 Apr 2021 09:14:10 +0200
Subject: [PATCH] Fix void in background-fetch.idl

https://github.com/WICG/background-fetch/pull/159
---
ed/idl/background-fetch.idl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ed/idl/background-fetch.idl b/ed/idl/background-fetch.idl
index 1a0ed0e43..993bd8bc2 100644
--- a/ed/idl/background-fetch.idl
+++ b/ed/idl/background-fetch.idl
@@ -85,5 +85,5 @@ dictionary BackgroundFetchEventInit : ExtendableEventInit {
[Exposed=ServiceWorker]
interface BackgroundFetchUpdateUIEvent : BackgroundFetchEvent {
constructor(DOMString type, BackgroundFetchEventInit init);
- Promise<void> updateUI(optional BackgroundFetchUIOptions options = {});
+ Promise<undefined> updateUI(optional BackgroundFetchUIOptions options = {});
};
--
2.31.1.295.g9ea45b61b8-goog

26 changes: 26 additions & 0 deletions ed/idlpatches/construct-stylesheets.idl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From a0486972f2ce5ae864ced2dfe3ebdfb46d5596da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= <[email protected]>
Date: Wed, 14 Apr 2021 09:16:31 +0200
Subject: [PATCH] Fix void in construct-stylesheets.idl

https://github.com/WICG/construct-stylesheets/pull/132
---
ed/idl/construct-stylesheets.idl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ed/idl/construct-stylesheets.idl b/ed/idl/construct-stylesheets.idl
index 7b65cb98b..249af0393 100644
--- a/ed/idl/construct-stylesheets.idl
+++ b/ed/idl/construct-stylesheets.idl
@@ -6,7 +6,7 @@
partial interface CSSStyleSheet {
constructor(optional CSSStyleSheetInit options = {});
Promise<CSSStyleSheet> replace(USVString text);
- void replaceSync(USVString text);
+ undefined replaceSync(USVString text);
};

dictionary CSSStyleSheetInit {
--
2.31.1.295.g9ea45b61b8-goog

35 changes: 35 additions & 0 deletions ed/idlpatches/filter-effects.idl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From d63180d957007dd1d822bd864d11bc7de407830a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= <[email protected]>
Date: Wed, 14 Apr 2021 09:24:11 +0200
Subject: [PATCH] Fix void in filter-effects.idl

https://github.com/w3c/fxtf-drafts/pull/421
---
ed/idl/filter-effects.idl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ed/idl/filter-effects.idl b/ed/idl/filter-effects.idl
index b17ebf678..bb0fa571f 100644
--- a/ed/idl/filter-effects.idl
+++ b/ed/idl/filter-effects.idl
@@ -206,7 +206,7 @@ interface SVGFEDropShadowElement : SVGElement {
readonly attribute SVGAnimatedNumber stdDeviationX;
readonly attribute SVGAnimatedNumber stdDeviationY;

- void setStdDeviation(float stdDeviationX, float stdDeviationY);
+ undefined setStdDeviation(float stdDeviationX, float stdDeviationY);
};

SVGFEDropShadowElement includes SVGFilterPrimitiveStandardAttributes;
@@ -229,7 +229,7 @@ interface SVGFEGaussianBlurElement : SVGElement {
readonly attribute SVGAnimatedNumber stdDeviationY;
readonly attribute SVGAnimatedEnumeration edgeMode;

- void setStdDeviation(float stdDeviationX, float stdDeviationY);
+ undefined setStdDeviation(float stdDeviationX, float stdDeviationY);
};

SVGFEGaussianBlurElement includes SVGFilterPrimitiveStandardAttributes;
--
2.31.1.295.g9ea45b61b8-goog

2 changes: 1 addition & 1 deletion packages/idl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ for (const [shortname, ast] of Object.entries(parsedFiles)) {

The following guarantees are provided by this package:
- All IDL files can be parsed by the version of [webidl2.js](https://github.com/w3c/webidl2.js/) used in `peerDependencies` in `package.json`.
- All types except `void` are defined by some specification.
- All types are defined by some specification.
- All extended attributes are defined by some specification.
- No duplicate top-level definitions or members.
- No missing or mismatched types in inheritance chains.
Expand Down
3 changes: 0 additions & 3 deletions test/idl/consistency.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,6 @@ describe('Web IDL consistency', () => {
'USVString', // https://heycam.github.io/webidl/#idl-USVString
'undefined', // https://heycam.github.io/webidl/#idl-undefined

// TODO: drop void when it has been removed from all specs
'void',

// Types defined by other specs:
'CSSOMString', // https://drafts.csswg.org/cssom/#cssomstring-type
'WindowProxy' // https://html.spec.whatwg.org/multipage/window-object.html#windowproxy
Expand Down
1 change: 0 additions & 1 deletion test/idl/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ idl.parseAll().then((all) => {
describe('WebIDL2.validate', () => {
const ignoreRules = [
'no-nointerfaceobject',
'replace-void',
'require-exposed',
];

Expand Down