-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now it resolves the URL correctly, and returns the document's URL if the attribute is absent or empty. Closes #1482.
- Loading branch information
Showing
5 changed files
with
55 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
test/web-platform-tests/to-upstream/html/semantics/forms/the-form-element/form-action.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>form.action</title> | ||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me"> | ||
<link rel="help" href="https://html.spec.whatwg.org/multipage/forms.html#dom-fs-action"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<form id="form1" action="a.html"></form> | ||
|
||
<form id="form2" action=""></form> | ||
|
||
<form id="form3"></form> | ||
|
||
<body> | ||
<script> | ||
"use strict"; | ||
|
||
test(() => { | ||
|
||
assert_equals(document.querySelector("#form1").action, (new URL("a.html", document.URL)).href, | ||
"action should equal the correct absolute URL"); | ||
|
||
}, "An action URL should be resolved relative to the document's URL"); | ||
|
||
test(() => { | ||
|
||
assert_equals(document.querySelector("#form2").action, document.URL); | ||
|
||
}, "An empty-string action content attribute should cause the IDL attribute to return the document's URL"); | ||
|
||
test(() => { | ||
|
||
assert_equals(document.querySelector("#form3").action, document.URL); | ||
|
||
}, "A missing action content attribute should cause the IDL attribute to return the document's URL"); | ||
|
||
</script> | ||
</body> |