mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Update WebIDL.py (#32495)
* Update WebIDL.py * Update WebIDL.py * Add builtin-array.patch * Fix CodegenRust.py and Configuration.py * Fix missing downcasts * mach fmt * Update check and comment to explain why we need this check * Update Global of DissimilarOriginWindow.webidl
This commit is contained in:
parent
19067366df
commit
8eed3b442b
77 changed files with 1658 additions and 793 deletions
50
third_party/WebIDL/tests/test_constructor.py
vendored
50
third_party/WebIDL/tests/test_constructor.py
vendored
|
@ -87,7 +87,7 @@ def WebIDLTest(parser, harness):
|
|||
)
|
||||
|
||||
sigpairs = zip(method.signatures(), signatures)
|
||||
for (gotSignature, expectedSignature) in sigpairs:
|
||||
for gotSignature, expectedSignature in sigpairs:
|
||||
(gotRetType, gotArgs) = gotSignature
|
||||
(expectedRetType, expectedArgs) = expectedSignature
|
||||
|
||||
|
@ -264,7 +264,7 @@ def WebIDLTest(parser, harness):
|
|||
parser.parse(
|
||||
"""
|
||||
interface TestFuncConstructor {
|
||||
[Func="Document::IsWebAnimationsEnabled"] constructor();
|
||||
[Func="IsNotUAWidget"] constructor();
|
||||
};
|
||||
"""
|
||||
)
|
||||
|
@ -277,17 +277,19 @@ def WebIDLTest(parser, harness):
|
|||
"::TestFuncConstructor::constructor",
|
||||
"constructor",
|
||||
[("TestFuncConstructor (Wrapper)", [])],
|
||||
func=["Document::IsWebAnimationsEnabled"],
|
||||
func=["IsNotUAWidget"],
|
||||
)
|
||||
|
||||
parser = parser.reset()
|
||||
parser.parse(
|
||||
"""
|
||||
interface TestPrefChromeOnlySCFuncConstructor {
|
||||
[ChromeOnly, Pref="dom.webidl.test1", SecureContext, Func="Document::IsWebAnimationsEnabled"]
|
||||
constructor();
|
||||
};
|
||||
"""
|
||||
(
|
||||
"\n"
|
||||
" interface TestPrefChromeOnlySCFuncConstructor {\n"
|
||||
' [ChromeOnly, Pref="dom.webidl.test1", SecureContext, '
|
||||
'Func="IsNotUAWidget"]\n'
|
||||
" constructor();\n"
|
||||
" };\n"
|
||||
)
|
||||
)
|
||||
results = parser.finish()
|
||||
harness.check(len(results), 1, "Should be one production")
|
||||
|
@ -298,7 +300,7 @@ def WebIDLTest(parser, harness):
|
|||
"::TestPrefChromeOnlySCFuncConstructor::constructor",
|
||||
"constructor",
|
||||
[("TestPrefChromeOnlySCFuncConstructor (Wrapper)", [])],
|
||||
func=["Document::IsWebAnimationsEnabled"],
|
||||
func=["IsNotUAWidget"],
|
||||
pref=["dom.webidl.test1"],
|
||||
chromeOnly=True,
|
||||
secureContext=True,
|
||||
|
@ -336,7 +338,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Can't have both a constructor and a ChromeOnly constructor")
|
||||
|
@ -353,7 +355,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "HTMLConstructor should take no argument")
|
||||
|
@ -370,7 +372,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "HTMLConstructor can't be used on a callback interface")
|
||||
|
@ -388,7 +390,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Can't have both a constructor and a HTMLConstructor")
|
||||
|
@ -406,7 +408,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Can't have both a throwing constructor and a HTMLConstructor")
|
||||
|
@ -423,7 +425,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Can't have both a HTMLConstructor and a constructor operation")
|
||||
|
@ -441,7 +443,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(
|
||||
|
@ -463,7 +465,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Can't have both a ChromeOnly constructor and a HTMLConstructor")
|
||||
|
@ -481,7 +483,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(
|
||||
|
@ -502,7 +504,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(
|
||||
|
@ -523,7 +525,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(
|
||||
|
@ -544,7 +546,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(
|
||||
|
@ -567,7 +569,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Can't have a constructor operation on a partial interface")
|
||||
|
@ -588,7 +590,7 @@ def WebIDLTest(parser, harness):
|
|||
"""
|
||||
)
|
||||
results = parser.finish()
|
||||
except:
|
||||
except WebIDL.WebIDLError:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Can't have a constructor operation on a mixin")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue