Closed
Bug 1430575
Opened 8 years ago
Closed 8 years ago
Unable clear <input type=number> after typing invalid data into it
Categories
(Remote Protocol :: Marionette, defect, P1)
Tracking
(firefox-esr52 unaffected, firefox57 unaffected, firefox58 unaffected, firefox59 fixed)
RESOLVED
FIXED
mozilla59
| Tracking | Status | |
|---|---|---|
| firefox-esr52 | --- | unaffected |
| firefox57 | --- | unaffected |
| firefox58 | --- | unaffected |
| firefox59 | --- | fixed |
People
(Reporter: barancev, Assigned: ato)
References
(Blocks 1 open bug, )
Details
(Keywords: regression)
Attachments
(3 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36
Steps to reproduce:
Detected in Firefox Nightly 59.0a1 (2018-01-14) (64-bit)
Regression issue, may be caused by https://bugzilla.mozilla.org/show_bug.cgi?id=1354211
driver.get("https://output.jsbin.com/serilo");
WebElement numInput = driver.findElement(By.id("num"));
numInput.sendKeys("test");
numInput.clear();
numInput.sendKeys("33");
assertEquals(numInput.getAttribute("value"), "33");
Actual results:
getAttribute returns empty value, but visually the field contains text "test33"
Expected results:
getAttribute should return value "33"
Comment 1•8 years ago
|
||
Andreas, can you please have a look?
Blocks: 1354211
Status: UNCONFIRMED → NEW
status-firefox58:
--- → unaffected
status-firefox59:
--- → affected
Component: General → Marionette
Ever confirmed: true
Flags: needinfo?(ato)
Keywords: regression
| Assignee | ||
Comment 2•8 years ago
|
||
This appears to be a bug in the WebDriver standard. We abort
modifying the element if it is empty, which for an <input> is if its
value property is equal to "" (empty string).
The complication is that whilst it is allowed to enter invalid
characters to an <input type=number> in Gecko, it is not in Chrome.
This means this particular WebDriver bug will only occur in Gecko
because the value property isn’t updated when the input is
invalid.
As far as I know there is no way with current web platform APIs to
access the current (invalid) input of <input type=number>. But we
can additionaly make a check of its ValidityState [1], since the
value === "" check is not sufficient.
I filed [2] against the WebDriver specification.
Regarding the above test case, you should be getting the input’s
_property_ rather than the value, but I corrected this in my own
test case.
[1] https://html.spec.whatwg.org/#validitystate
Assignee: nobody → ato
Blocks: webdriver
Status: NEW → ASSIGNED
Flags: needinfo?(ato)
OS: Unspecified → All
Hardware: Unspecified → All
Summary: Can't clear number input after typing invalid data into it → Unable clear <input type=number> after typing invalid data into it
| Reporter | ||
Comment 4•8 years ago
|
||
I want to make a note that it works in the current Release (57) and used to work in 59 before the mentioned change https://bugzilla.mozilla.org/show_bug.cgi?id=1354211. So I suppose it is technically possible to implement "old" behaviour. But, yes, it should be coherrent with the specification.
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 9•8 years ago
|
||
try because try-from-mozreview is broken: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f4e3e746960f0d2a3e65f3f076afaa412b7ad810
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
Comment 17•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8942692 [details]
Bug 1430575 - Adjust editable definition to match WebDriver.
https://reviewboard.mozilla.org/r/212954/#review218654
Attachment #8942692 -
Flags: review?(dburns) → review+
Comment 18•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8942693 [details]
Bug 1430575 - Document interaction.clearElement.
https://reviewboard.mozilla.org/r/212956/#review218656
::: testing/marionette/interaction.js:295
(Diff revision 2)
> };
>
> +/**
> + * Clears the form control or the editable element, if required.
> + *
> + * Before attempting to clear the element, it will be attempted
s/attempted scrolled into view/attempt to scroll into view
::: testing/marionette/interaction.js:300
(Diff revision 2)
> + * Before attempting to clear the element, it will be attempted
> + * scrolled into view if it is not already in the viewport.
> + *
> + * If the element is a submittable form control and it is empty
> + * (it has no value or it has no files associated with it, in the
> + * case it is a <code><input type=file>> element) or it is an
closing `</code>` is missing which could explain the `>` next to `type=file`
Attachment #8942693 -
Flags: review?(dburns) → review+
Comment 19•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8942694 [details]
Bug 1430575 - Add element.satisfiesContraints.
https://reviewboard.mozilla.org/r/212958/#review218664
::: testing/marionette/element.js:964
(Diff revision 2)
> + * True if it satisfies all its constraints.
> + *
> + * @throws {InvalidElementStateError}
> + * If <var>el</var> is not a mutable form control element.
> + */
> +element.satisfiesConstraints = function(el) {
I don't like this this method name as it looks like it should be used as `element.satisiesConstraints(el, constraint);`
As the method is so small why can't this just be in method where you call `element.satisfiesConstraints(el);` in your other patch
Attachment #8942694 -
Flags: review?(dburns) → review-
| Assignee | ||
Comment 20•8 years ago
|
||
| mozreview-review-reply | ||
Comment on attachment 8942694 [details]
Bug 1430575 - Add element.satisfiesContraints.
https://reviewboard.mozilla.org/r/212958/#review218664
> I don't like this this method name as it looks like it should be used as `element.satisiesConstraints(el, constraint);`
>
> As the method is so small why can't this just be in method where you call `element.satisfiesConstraints(el);` in your other patch
I agree. Merging it with clearResettableElement in
testing/marionette/interaction.js makes the code flow much nicer.
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•8 years ago
|
Attachment #8942694 -
Attachment is obsolete: true
Comment 24•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8942695 [details]
Bug 1430575 - Add validity state check for WebDriver:ElementClear.
https://reviewboard.mozilla.org/r/212960/#review219316
Attachment #8942695 -
Flags: review?(dburns) → review+
Comment 25•8 years ago
|
||
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2f1762f3233a
Adjust editable definition to match WebDriver. r=automatedtester
https://hg.mozilla.org/integration/autoland/rev/7220cf5de9a8
Document interaction.clearElement. r=automatedtester
https://hg.mozilla.org/integration/autoland/rev/949cf88764e6
Add validity state check for WebDriver:ElementClear. r=automatedtester
Comment 26•8 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/2f1762f3233a
https://hg.mozilla.org/mozilla-central/rev/7220cf5de9a8
https://hg.mozilla.org/mozilla-central/rev/949cf88764e6
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Updated•8 years ago
|
status-firefox57:
--- → unaffected
status-firefox-esr52:
--- → unaffected
Updated•3 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•