-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb/HTML: Update HTMLButtonElement.type to match spec changes
Corresponds to part of whatwg/html#9841 and then whatwg/html#11047 Adding `Auto` as a type state feels a little odd, as it's not an actual type allowed in HTML. However, it's the default state when the value is missing or invalid, which works out the same, as long as we never serialize "auto", which we don't.
- Loading branch information
Showing
6 changed files
with
149 additions
and
9 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
27 changes: 27 additions & 0 deletions
27
...mport/html/semantics/the-button-element/command-and-commandfor/button-type-reflection.txt
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,27 @@ | ||
Harness status: OK | ||
|
||
Found 21 tests | ||
|
||
18 Pass | ||
3 Fail | ||
Pass Button with id reset-in-form should reflect type correctly | ||
Pass Button with id submit-in-form should reflect type correctly | ||
Pass Button with id button-in-form should reflect type correctly | ||
Fail Button with id invalid-in-form should reflect type correctly | ||
Pass Button with id missing-in-form should reflect type correctly | ||
Pass Button with id missing-in-form-command-only should reflect type correctly | ||
Pass Button with id missing-in-form-commandfor-only should reflect type correctly | ||
Pass Button with id reset-attr-form should reflect type correctly | ||
Pass Button with id submit-attr-form should reflect type correctly | ||
Pass Button with id button-attr-form should reflect type correctly | ||
Fail Button with id invalid-attr-form should reflect type correctly | ||
Pass Button with id missing-attr-form should reflect type correctly | ||
Pass Button with id missing-attr-form-command-only should reflect type correctly | ||
Pass Button with id missing-attr-form-commandfor-only should reflect type correctly | ||
Pass Button with id reset-outside-form should reflect type correctly | ||
Pass Button with id submit-outside-form should reflect type correctly | ||
Pass Button with id button-outside-form should reflect type correctly | ||
Fail Button with id invalid-outside-form should reflect type correctly | ||
Pass Button with id missing-outside-form should reflect type correctly | ||
Pass Button with id missing-outside-form-command-only should reflect type correctly | ||
Pass Button with id missing-outside-form-commandfor-only should reflect type correctly |
64 changes: 64 additions & 0 deletions
64
...port/html/semantics/the-button-element/command-and-commandfor/button-type-reflection.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,64 @@ | ||
<!DOCTYPE html> | ||
<link rel=author href="mailto:lwarlow@igalia.com"> | ||
<script src="../../../../resources/testharness.js"></script> | ||
<script src="../../../../resources/testharnessreport.js"></script> | ||
|
||
<iframe name=foo></iframe> | ||
<form id="form" target=foo action="about:blank"> | ||
<button id=reset-in-form type=reset commandfor=mypopover command=toggle-popover>reset</button> | ||
<button id=submit-in-form type=submit commandfor=mypopover command=toggle-popover>submit</button> | ||
<button id=button-in-form type=button commandfor=mypopover command=toggle-popover>type=button</button> | ||
<button id=invalid-in-form type=invalid commandfor=mypopover command=toggle-popover>invalid</button> | ||
<button id=missing-in-form commandfor=mypopover command=toggle-popover>missing</button> | ||
<button id=missing-in-form-command-only command=toggle-popover>missing with command only</button> | ||
<button id=missing-in-form-commandfor-only commandfor=mypopover >missing with commandfor only</button> | ||
</form> | ||
|
||
<button id=reset-attr-form type=reset commandfor=mypopover command=toggle-popover form=form>reset</button> | ||
<button id=submit-attr-form type=submit commandfor=mypopover command=toggle-popover form=form>submit</button> | ||
<button id=button-attr-form type=button commandfor=mypopover command=toggle-popover form=form>type=button</button> | ||
<button id=invalid-attr-form type=invalid commandfor=mypopover command=toggle-popover form=form>invalid</button> | ||
<button id=missing-attr-form commandfor=mypopover command=toggle-popover form=form>missing</button> | ||
<button id=missing-attr-form-command-only command=toggle-popover form=form>missing with command only</button> | ||
<button id=missing-attr-form-commandfor-only commandfor=mypopover form=form>missing with commandfor only</button> | ||
|
||
<button id=reset-outside-form type=reset commandfor=mypopover command=toggle-popover>reset</button> | ||
<button id=submit-outside-form type=submit commandfor=mypopover command=toggle-popover>submit</button> | ||
<button id=button-outside-form type=button commandfor=mypopover command=toggle-popover>type=button</button> | ||
<button id=invalid-outside-form type=invalid commandfor=mypopover command=toggle-popover>invalid</button> | ||
<button id=missing-outside-form commandfor=mypopover command=toggle-popover>missing</button> | ||
<button id=missing-outside-form-command-only command=toggle-popover>missing with command only</button> | ||
<button id=missing-outside-form-commandfor-only commandfor=mypopover>missing with commandfor only</button> | ||
|
||
<script> | ||
const data = { | ||
'reset-in-form': 'reset', | ||
'submit-in-form': 'submit', | ||
'button-in-form': 'button', | ||
'invalid-in-form': 'submit', | ||
'missing-in-form': 'button', | ||
'missing-in-form-command-only': 'button', | ||
'missing-in-form-commandfor-only': 'button', | ||
'reset-attr-form': 'reset', | ||
'submit-attr-form': 'submit', | ||
'button-attr-form': 'button', | ||
'invalid-attr-form': 'submit', | ||
'missing-attr-form': 'button', | ||
'missing-attr-form-command-only': 'button', | ||
'missing-attr-form-commandfor-only': 'button', | ||
'reset-outside-form': 'reset', | ||
'submit-outside-form': 'submit', | ||
'button-outside-form': 'button', | ||
'invalid-outside-form': 'submit', | ||
'missing-outside-form': 'button', | ||
'missing-outside-form-command-only': 'button', | ||
'missing-outside-form-commandfor-only': 'button', | ||
}; | ||
|
||
Object.entries(data).map(([id, expectedType]) => { | ||
test(() => { | ||
const button = document.getElementById(id); | ||
assert_equals(button.type, expectedType, `type of ${id} should be ${expectedType}`); | ||
}, `Button with id ${id} should reflect type correctly`); | ||
}); | ||
</script> |