From d9619853e210ad70932b7b3b2ab2633a907e1676 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Thu, 30 Apr 2015 00:02:36 +0200 Subject: [PATCH] Fix length value of interface methods --- .../dom/bindings/codegen/CodegenRust.py | 4 +- .../FileAPI/blob/Blob-constructor.html.ini | 3 - .../wpt/metadata/FileAPI/idlharness.html.ini | 3 - .../XMLHttpRequest/interfaces.html.ini | 21 ----- tests/wpt/metadata/dom/interfaces.html.ini | 78 ------------------- .../wpt/metadata/encoding/idlharness.html.ini | 6 -- .../wpt/metadata/html/dom/interfaces.html.ini | 59 +------------- .../metadata/workers/interfaces.worker.js.ini | 27 ------- 8 files changed, 6 insertions(+), 195 deletions(-) diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index a005956e02e..689587c377b 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -1224,11 +1224,11 @@ class PropertyDefiner: ",\n".join(specs) + "\n" + "];\n") % (name, specType)) -# The length of a method is the maximum of the lengths of the +# The length of a method is the minimum of the lengths of the # argument lists of all its overloads. def methodLength(method): signatures = method.signatures() - return max([len(arguments) for (retType, arguments) in signatures]) + return min(len([arg for arg in arguments if not arg.optional and not arg.variadic]) for (_, arguments) in signatures) class MethodDefiner(PropertyDefiner): """ diff --git a/tests/wpt/metadata/FileAPI/blob/Blob-constructor.html.ini b/tests/wpt/metadata/FileAPI/blob/Blob-constructor.html.ini index 814a91bbbcd..24d11eb6ab6 100644 --- a/tests/wpt/metadata/FileAPI/blob/Blob-constructor.html.ini +++ b/tests/wpt/metadata/FileAPI/blob/Blob-constructor.html.ini @@ -117,6 +117,3 @@ [Newlines should not change when endings is 'native'.] expected: FAIL - [Blob interface object] - expected: FAIL - diff --git a/tests/wpt/metadata/FileAPI/idlharness.html.ini b/tests/wpt/metadata/FileAPI/idlharness.html.ini index 6161e6bb9d2..f96868b5859 100644 --- a/tests/wpt/metadata/FileAPI/idlharness.html.ini +++ b/tests/wpt/metadata/FileAPI/idlharness.html.ini @@ -15,9 +15,6 @@ [Blob interface: attribute isClosed] expected: FAIL - [Blob interface: operation slice(long long,long long,DOMString)] - expected: FAIL - [Blob interface: operation close()] expected: FAIL diff --git a/tests/wpt/metadata/XMLHttpRequest/interfaces.html.ini b/tests/wpt/metadata/XMLHttpRequest/interfaces.html.ini index d0ae41a4f29..0a370990bef 100644 --- a/tests/wpt/metadata/XMLHttpRequest/interfaces.html.ini +++ b/tests/wpt/metadata/XMLHttpRequest/interfaces.html.ini @@ -21,33 +21,12 @@ [XMLHttpRequest interface object length] expected: FAIL - [XMLHttpRequest interface: operation open(ByteString,USVString)] - expected: FAIL - - [XMLHttpRequest interface: operation open(ByteString,USVString,boolean,USVString,USVString)] - expected: FAIL - - [XMLHttpRequest interface: operation send([object Object\],[object Object\])] - expected: FAIL - [XMLHttpRequest interface: new XMLHttpRequest() must inherit property "overrideMimeType" with the proper type (20)] expected: FAIL - [FormData interface: operation append(USVString,Blob,USVString)] - expected: FAIL - - [FormData interface: operation append(USVString,USVString)] - expected: FAIL - [FormData interface: operation getAll(USVString)] expected: FAIL - [FormData interface: operation set(USVString,Blob,USVString)] - expected: FAIL - - [FormData interface: operation set(USVString,USVString)] - expected: FAIL - [FormData interface: calling getAll(USVString) on new FormData() with too few arguments must throw TypeError] expected: FAIL diff --git a/tests/wpt/metadata/dom/interfaces.html.ini b/tests/wpt/metadata/dom/interfaces.html.ini index dc8584b084f..d09b4589404 100644 --- a/tests/wpt/metadata/dom/interfaces.html.ini +++ b/tests/wpt/metadata/dom/interfaces.html.ini @@ -21,12 +21,6 @@ [EventTarget interface object length] expected: FAIL - [EventTarget interface: operation addEventListener(DOMString,EventListener,boolean)] - expected: FAIL - - [EventTarget interface: operation removeEventListener(DOMString,EventListener,boolean)] - expected: FAIL - [NodeList interface object length] expected: FAIL @@ -99,9 +93,6 @@ [Node interface object length] expected: FAIL - [Node interface: operation cloneNode(boolean)] - expected: FAIL - [Document interface: existence and properties of interface object] expected: FAIL @@ -111,15 +102,9 @@ [Document interface: attribute origin] expected: FAIL - [Document interface: operation importNode(Node,boolean)] - expected: FAIL - [Document interface: operation createNodeIterator(Node,unsigned long,NodeFilter)] expected: FAIL - [Document interface: operation createTreeWalker(Node,unsigned long,NodeFilter)] - expected: FAIL - [Document interface: operation query(DOMString)] expected: FAIL @@ -168,12 +153,6 @@ [DOMImplementation interface object length] expected: FAIL - [DOMImplementation interface: operation createDocument(DOMString,DOMString,DocumentType)] - expected: FAIL - - [DOMImplementation interface: operation createHTMLDocument(DOMString)] - expected: FAIL - [DocumentFragment interface: existence and properties of interface object] expected: FAIL @@ -324,9 +303,6 @@ [Comment interface object length] expected: FAIL - [Range interface: operation collapse(boolean)] - expected: FAIL - [Range interface: operation deleteContents()] expected: FAIL @@ -450,9 +426,6 @@ [DOMTokenList interface object length] expected: FAIL - [DOMTokenList interface: operation toggle(DOMString,boolean)] - expected: FAIL - [DOMSettableTokenList interface: existence and properties of interface object] expected: FAIL @@ -474,54 +447,3 @@ [NodeIterator interface object length] expected: FAIL - [Document interface: operation prepend([object Object\],[object Object\])] - expected: FAIL - - [Document interface: operation append([object Object\],[object Object\])] - expected: FAIL - - [DocumentFragment interface: operation prepend([object Object\],[object Object\])] - expected: FAIL - - [DocumentFragment interface: operation append([object Object\],[object Object\])] - expected: FAIL - - [DocumentType interface: operation before([object Object\],[object Object\])] - expected: FAIL - - [DocumentType interface: operation after([object Object\],[object Object\])] - expected: FAIL - - [DocumentType interface: operation replaceWith([object Object\],[object Object\])] - expected: FAIL - - [Element interface: operation prepend([object Object\],[object Object\])] - expected: FAIL - - [Element interface: operation append([object Object\],[object Object\])] - expected: FAIL - - [Element interface: operation before([object Object\],[object Object\])] - expected: FAIL - - [Element interface: operation after([object Object\],[object Object\])] - expected: FAIL - - [Element interface: operation replaceWith([object Object\],[object Object\])] - expected: FAIL - - [CharacterData interface: operation before([object Object\],[object Object\])] - expected: FAIL - - [CharacterData interface: operation after([object Object\],[object Object\])] - expected: FAIL - - [CharacterData interface: operation replaceWith([object Object\],[object Object\])] - expected: FAIL - - [DOMTokenList interface: operation add(DOMString)] - expected: FAIL - - [DOMTokenList interface: operation remove(DOMString)] - expected: FAIL - diff --git a/tests/wpt/metadata/encoding/idlharness.html.ini b/tests/wpt/metadata/encoding/idlharness.html.ini index 28ad8fba868..62e16e8c2e5 100644 --- a/tests/wpt/metadata/encoding/idlharness.html.ini +++ b/tests/wpt/metadata/encoding/idlharness.html.ini @@ -6,15 +6,9 @@ [TextDecoder interface: attribute ignoreBOM] expected: FAIL - [TextDecoder interface: operation decode(BufferSource,TextDecodeOptions)] - expected: FAIL - [TextDecoder interface: new TextDecoder() must inherit property "ignoreBOM" with the proper type (2)] expected: FAIL [TextEncoder interface object length] expected: FAIL - [TextEncoder interface: operation encode(USVString)] - expected: FAIL - diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini index 6c68c5ffa9d..5b7b897b80f 100644 --- a/tests/wpt/metadata/html/dom/interfaces.html.ini +++ b/tests/wpt/metadata/html/dom/interfaces.html.ini @@ -5802,9 +5802,6 @@ [HTMLSelectElement interface: operation namedItem(DOMString)] expected: FAIL - [HTMLSelectElement interface: operation add([object Object\],[object Object\],[object Object\],[object Object\])] - expected: FAIL - [HTMLSelectElement interface: operation remove()] expected: FAIL @@ -6774,9 +6771,6 @@ [CanvasRenderingContext2D interface: attribute shadowColor] expected: FAIL - [CanvasRenderingContext2D interface: operation fill(CanvasFillRule)] - expected: FAIL - [CanvasRenderingContext2D interface: operation drawSystemFocusRing(Element)] expected: FAIL @@ -6795,9 +6789,6 @@ [CanvasRenderingContext2D interface: operation scrollPathIntoView(Path2D)] expected: FAIL - [CanvasRenderingContext2D interface: operation clip(CanvasFillRule)] - expected: FAIL - [CanvasRenderingContext2D interface: operation resetClip()] expected: FAIL @@ -6822,24 +6813,12 @@ [CanvasRenderingContext2D interface: operation measureText(DOMString)] expected: FAIL - [CanvasRenderingContext2D interface: operation drawImage(CanvasImageSource,unrestricted double,unrestricted double)] - expected: FAIL - - [CanvasRenderingContext2D interface: operation drawImage(CanvasImageSource,unrestricted double,unrestricted double,unrestricted double,unrestricted double)] - expected: FAIL - [CanvasRenderingContext2D interface: operation addHitRegion(HitRegionOptions)] expected: FAIL [CanvasRenderingContext2D interface: operation removeHitRegion(DOMString)] expected: FAIL - [CanvasRenderingContext2D interface: operation createImageData(ImageData)] - expected: FAIL - - [CanvasRenderingContext2D interface: operation putImageData(ImageData,double,double)] - expected: FAIL - [CanvasRenderingContext2D interface: operation setLineDash([object Object\])] expected: FAIL @@ -6861,9 +6840,6 @@ [CanvasRenderingContext2D interface: attribute direction] expected: FAIL - [CanvasRenderingContext2D interface: operation arc(unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,boolean)] - expected: FAIL - [CanvasRenderingContext2D interface: operation ellipse(unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,boolean)] expected: FAIL @@ -8706,9 +8682,6 @@ [WebSocket interface: attribute protocol] expected: FAIL - [WebSocket interface: operation close(unsigned short,DOMString)] - expected: FAIL - [WebSocket interface: attribute onmessage] expected: FAIL @@ -8835,24 +8808,6 @@ [WorkerGlobalScope interface: operation createImageBitmap(ImageBitmapSource,long,long,long,long)] expected: FAIL - [WorkerGlobalScope interface: operation setTimeout(Function,long,any)] - expected: FAIL - - [WorkerGlobalScope interface: operation setTimeout(DOMString,long,any)] - expected: FAIL - - [WorkerGlobalScope interface: operation clearTimeout(long)] - expected: FAIL - - [WorkerGlobalScope interface: operation setInterval(Function,long,any)] - expected: FAIL - - [WorkerGlobalScope interface: operation setInterval(DOMString,long,any)] - expected: FAIL - - [WorkerGlobalScope interface: operation clearInterval(long)] - expected: FAIL - [DedicatedWorkerGlobalScope interface: existence and properties of interface object] expected: FAIL @@ -9423,21 +9378,15 @@ [Location interface: window.location must have own property "reload"] expected: FAIL - [CanvasRenderingContext2D interface: operation fill(Path2D,CanvasFillRule)] + [WebSocket interface: operation send(DOMString)] expected: FAIL - [CanvasRenderingContext2D interface: operation clip(Path2D,CanvasFillRule)] + [WebSocket interface: operation send(Blob)] expected: FAIL - [CanvasRenderingContext2D interface: operation drawImage(CanvasImageSource,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double)] + [WebSocket interface: operation send(ArrayBuffer)] expected: FAIL - [CanvasRenderingContext2D interface: operation createImageData(double,double)] - expected: FAIL - - [CanvasRenderingContext2D interface: operation putImageData(ImageData,double,double,double,double,double,double)] - expected: FAIL - - [WorkerGlobalScope interface: operation importScripts(DOMString)] + [WebSocket interface: operation send(ArrayBufferView)] expected: FAIL diff --git a/tests/wpt/metadata/workers/interfaces.worker.js.ini b/tests/wpt/metadata/workers/interfaces.worker.js.ini index 4eab9abace6..900a7c63d4b 100644 --- a/tests/wpt/metadata/workers/interfaces.worker.js.ini +++ b/tests/wpt/metadata/workers/interfaces.worker.js.ini @@ -3,12 +3,6 @@ [EventTarget interface object length] expected: FAIL - [EventTarget interface: operation addEventListener(DOMString,EventListener,boolean)] - expected: FAIL - - [EventTarget interface: operation removeEventListener(DOMString,EventListener,boolean)] - expected: FAIL - [WorkerGlobalScope interface: existence and properties of interface object] expected: FAIL @@ -30,24 +24,6 @@ [WorkerGlobalScope interface: attribute ononline] expected: FAIL - [WorkerGlobalScope interface: operation setTimeout(Function,long,any)] - expected: FAIL - - [WorkerGlobalScope interface: operation setTimeout(DOMString,long,any)] - expected: FAIL - - [WorkerGlobalScope interface: operation clearTimeout(long)] - expected: FAIL - - [WorkerGlobalScope interface: operation setInterval(Function,long,any)] - expected: FAIL - - [WorkerGlobalScope interface: operation setInterval(DOMString,long,any)] - expected: FAIL - - [WorkerGlobalScope interface: operation clearInterval(long)] - expected: FAIL - [DedicatedWorkerGlobalScope interface: existence and properties of interface object] expected: FAIL @@ -144,6 +120,3 @@ [WorkerNavigator interface: self.navigator must inherit property "onLine" with the proper type (8)] expected: FAIL - [WorkerGlobalScope interface: operation importScripts(DOMString)] - expected: FAIL -