Auto merge of #11155 - emilio:codegen-dict-keyword, r=Ms2ger

codegen: Fix dictionary handling and semantics

Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data:
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #11152 (github issue number if applicable).

Either:
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process.

Fixes #11152

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11155)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-13 02:47:08 -07:00
commit 221db56b08
11 changed files with 183 additions and 21 deletions

View file

@ -11,3 +11,4 @@
[Using special character in fileName]
expected: FAIL

View file

@ -1,9 +1,41 @@
[DOMParser-parseFromString-xml.html]
type: testharness
expected: TIMEOUT
[Should return an error document for XML wellformedness errors in type text/xml]
expected: FAIL
[Should parse correctly in type application/xml]
expected: TIMEOUT
expected: FAIL
[XMLDocument interface for correctly parsed document with type application/xml]
expected: FAIL
[Should return an error document for XML wellformedness errors in type application/xml]
expected: FAIL
[XMLDocument interface for incorrectly parsed document with type application/xml]
expected: FAIL
[Should parse correctly in type application/xhtml+xml]
expected: FAIL
[XMLDocument interface for correctly parsed document with type application/xhtml+xml]
expected: FAIL
[Should return an error document for XML wellformedness errors in type application/xhtml+xml]
expected: FAIL
[XMLDocument interface for incorrectly parsed document with type application/xhtml+xml]
expected: FAIL
[Should parse correctly in type image/svg+xml]
expected: FAIL
[XMLDocument interface for correctly parsed document with type image/svg+xml]
expected: FAIL
[Should return an error document for XML wellformedness errors in type image/svg+xml]
expected: FAIL
[XMLDocument interface for incorrectly parsed document with type image/svg+xml]
expected: FAIL

View file

@ -1,6 +1,5 @@
[Document-defaultView.html]
type: testharness
expected: TIMEOUT
[Document created with the Document constructor]
expected: FAIL
@ -11,5 +10,8 @@
expected: FAIL
[Document created with XML DOMParser]
expected: TIMEOUT
expected: FAIL
[Document created with HTML DOMParser]
expected: FAIL

View file

@ -6064,6 +6064,12 @@
"url": "/_mozilla/mozilla/bad_cert_detected.html"
}
],
"mozilla/binding_keyword.html": [
{
"path": "mozilla/binding_keyword.html",
"url": "/_mozilla/mozilla/binding_keyword.html"
}
],
"mozilla/blob.html": [
{
"path": "mozilla/blob.html",

View file

@ -0,0 +1,3 @@
[binding_keyword.html]
type: testharness
prefs: [dom.testbinding.enabled:true]

View file

@ -0,0 +1,17 @@
<!doctype html>
<meta charset="utf-8">
<title>Test for conversions from and to dictionary properties with keywords</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
var t = new TestBinding();
var dict = t.receiveTestDictionaryWithSuccessOnKeyword();
assert_equals(dict.type, "success");
assert_equals(dict.nonRequiredNullable, undefined);
assert_equals(dict.nonRequiredNullable2, null);
assert_true(t.dictMatchesPassedValues(dict));
}, "Conversion of dictionary elements with rust keywords, and null non-required nullable properties works")
</script>

View file

@ -61,4 +61,10 @@ test(function() {
assert_equals(htmldoc.documentElement.localName, "html");
assert_equals(htmldoc.documentElement.namespaceURI, "http://www.w3.org/1999/xhtml");
}, "DOMParser parses HTML tag soup with no problems");
test(function() {
assert_throws(new TypeError(), function() {
new DOMParser().parseFromString("", "text/foo-this-is-invalid");
})
}, "DOMParser throws on an invalid enum value")
</script>