aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-07-26 18:42:58 -0500
committerGitHub <noreply@github.com>2016-07-26 18:42:58 -0500
commit78e9b84a8b3400031cd13ec3ed4bc104dbcdd6e6 (patch)
tree2ff1329595090359d409ac61982952937b32c460
parent0be8e6857f4f767129dd694bf1e7e86060d307a4 (diff)
parent9b7e38e95d4872b446a2f7c69d97ec9cf0a2f0cc (diff)
downloadservo-78e9b84a8b3400031cd13ec3ed4bc104dbcdd6e6.tar.gz
servo-78e9b84a8b3400031cd13ec3ed4bc104dbcdd6e6.zip
Auto merge of #12598 - vrod:add-test-dialog-open, r=KiChjang
Write a test for HTMLDialogElement#open <!-- Please describe your changes on the following line: --> Write a test for HTMLDialogElement#open. --- <!-- 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 #12574. - [X] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12598) <!-- Reviewable:end -->
-rw-r--r--tests/wpt/metadata/MANIFEST.json6
-rw-r--r--tests/wpt/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html30
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json
index cb936f17478..765b201622d 100644
--- a/tests/wpt/metadata/MANIFEST.json
+++ b/tests/wpt/metadata/MANIFEST.json
@@ -37205,6 +37205,12 @@
"deleted_reftests": {},
"items": {
"testharness": {
+ "html/semantics/interactive-elements/the-dialog-element/dialog-open.html": [
+ {
+ "path": "html/semantics/interactive-elements/the-dialog-element/dialog-open.html",
+ "url": "/html/semantics/interactive-elements/the-dialog-element/dialog-open.html"
+ }
+ ],
"html/semantics/scripting-1/the-script-element/script-charset-03.html": [
{
"path": "html/semantics/scripting-1/the-script-element/script-charset-03.html",
diff --git a/tests/wpt/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html b/tests/wpt/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html
new file mode 100644
index 00000000000..4719f63b853
--- /dev/null
+++ b/tests/wpt/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>dialog element: open</title>
+<link rel=help href="https://html.spec.whatwg.org/multipage/forms.html#dom-dialog-open">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<dialog id="d1">
+ <p>foobar</p>
+ <button>OK</button>
+</dialog>
+<dialog id="d2" open>
+ <p>foobar</p>
+ <button>OK</button>
+</dialog>
+<script>
+ var d1 = document.getElementById('d1');
+ var d2 = document.getElementById('d2');
+
+ test(function(){
+ assert_false(d1.open);
+ assert_true(d2.open);
+ }, "On getting, the IDL open attribute must return true if the content open attribute is set, and false if it is absent.");
+
+ test(function(){
+ d1.open = true;
+ assert_true(d1.hasAttribute("open"));
+ d2.open = false;
+ assert_false(d2.hasAttribute("open"));
+ }, "On setting, the content open attribute must be removed if the IDL open attribute is set to false, and must be present if the IDL open attribute is set to true.");
+</script>