mirror of
https://github.com/servo/servo
synced 2026-05-11 17:37:21 +02:00
This came out of a conversation with nox in IRC: https://mozilla.logbot.info/servo/20171201#c13946454-c13946594 The code I was working on which motivated this change is here: https://github.com/servo/servo/pull/19461 Previously, InputType::Text was used to represent several different values of the type attribute on an input element. If an input element doesn't have a type attribute, or its type attribute doesn't contain a recognised value, then the input's type defaults to "text". Before this change, there were a number of checks in the code which directly looked at the type attribute. If those checks matched against the value "text", then they were potentially buggy, since an input with type=invalid should also behave like an input with type=text. Rather than have every conditional which cares about the input type also have to deal with invalid input types, we can convert the type attribute to an InputType enum once, and then match against the enum. A secondary benefit is that the compiler can tell us whether we've missed branches in a match expression. While working on this I discovered that the HTMLInputElement::value_mode() method misses a case for inputs with type=hidden (this resulted in a failing WPT test passing). I've also implemented the Default trait for InputType, so we now only have one place in the code which knows that InputType::Text is the default, where previously there were several.
57 lines
1.2 KiB
INI
57 lines
1.2 KiB
INI
[clone.html]
|
|
type: testharness
|
|
[Checkbox must retain checked state.]
|
|
expected: FAIL
|
|
|
|
[Checkbox must retain unchecked state.]
|
|
expected: FAIL
|
|
|
|
[Radiobutton must retain checked state.]
|
|
expected: FAIL
|
|
|
|
[Radiobutton must retain unchecked state.]
|
|
expected: FAIL
|
|
|
|
[Text field must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[Search field must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[Phone number field must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[URL field must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[Email field must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[Password field must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[Date field must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[Month field must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[Week field must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[Time field must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[Datetime (local) field must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[Number field must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[Range control must retain changed value.]
|
|
expected: FAIL
|
|
|
|
[Color picker must retain changed value.]
|
|
expected: FAIL
|
|
|