Closed Bug 1660060 Opened 4 years ago Closed 4 years ago

Print dialog's validated fields (range, scale) should either tolerate or prevent whitespace

Categories

(Toolkit :: Printing, defect, P2)

defect

Tracking

()

VERIFIED FIXED
82 Branch
Tracking Status
firefox81 --- verified
firefox82 --- verified

People

(Reporter: dholbert, Assigned: mtigley)

References

Details

(Whiteboard: [print2020_v81])

Attachments

(4 files, 1 obsolete file)

STR:

  1. Open the new print UI
  2. Click "more settings" and then "scale", and put your cursor in the "Scale" textfield.
  3. Type in 100 with a leading or trailing space. (Pretend you put in the space by accident.)
  4. Try to interpret the resulting UI.

ACTUAL RESULTS:
We highlight the field as invalid, with a message saying "Scale must be a value between 10 and 200". And it looks visually like the field contains the value 100, which should be valid.

EXPECTED RESULTS:
Either:

  • we should trim whitespace in our parsing/validation
    ... or:
  • we should constrain the field to only allow the user to enter numeric input, somehow. (It is a little weird that I can type in a space character at all in this field, or a value like "aaa" for that matter...)

Similarly we reject values like "50%" (including a literal percent character) which feels like a footgun - we should either trim out or forbid the percent character just like we should do for any whitespace that is present.

(The STR produce similar "actual results" for the validated from/to "range" fields that are being added in bug 1653389, too.)

Severity: -- → S2
Priority: -- → P2
Whiteboard: [print2020_v81]
Assignee: nobody → mtigley
Status: NEW → ASSIGNED

Ideally, these number fields would disallow any character that isn't 0-9.

Blocks: 1661776
Pushed by mtigley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/21165ed01da8
Add a keypress listener to the percentScale element. r=emalysz
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch

Can you request Beta uplift.

Flags: needinfo?(mtigley)

Comment on attachment 9172441 [details]
Bug 1660060 - Add a keypress listener to the percentScale element. r?emalysz

Beta/Release Uplift Approval Request

  • User impact if declined: Users can enter whitespace which invalidates their input. This experience is inconvenient if the whitespace was accidentally entered and can result in a confusing experience for the user trying to change the page scale.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 0
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Not risky since this patch adds a small restriction for certain input (ie: non-numeric characters) from being entered and only impacts the scale input UI component.
  • String changes made/needed:
Flags: needinfo?(mtigley)
Attachment #9172441 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Comment on attachment 9172441 [details]
Bug 1660060 - Add a keypress listener to the percentScale element. r?emalysz

Approved for 81.0b4.

Attachment #9172441 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Contact: emil.ghitta
QA Whiteboard: [qa-triaged]

This issue is verified fixed using Firefox 81.0b4 (BuildId:20200829200810) and Firefox 82.0a1 (BuildId:20200831091558) on Windows 10 64bit, macOS 10.14 & Ubuntu 20.04.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

Reopening because a second patch is required to handle the start/end page range fields. Sorry, forgot to mark as "leave-open"

Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Attachment #9173384 - Attachment description: Bug 1660060 - Add a keypress listener to the CPageRangeInput element. r?emalysz → Bug 1660060 - Add a keypress listener to the PageRangeInput element. r?emalysz
Attachment #9173383 - Attachment is obsolete: true
Attachment #9173384 - Attachment description: Bug 1660060 - Add a keypress listener to the PageRangeInput element. r?emalysz → Bug 1660060 - Add a keypress handler to PrintUIControlMixin that prevents invalid input. r?emalysz
Pushed by mtigley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4e9e20d085c1
Add a keypress handler to PrintUIControlMixin that prevents invalid input. r=emalysz

Comment on attachment 9173384 [details]
Bug 1660060 - Add a keypress handler to PrintUIControlMixin that prevents invalid input. r?emalysz

Beta/Release Uplift Approval Request

  • User impact if declined: Users can enter whitespaces into the copies and page range fields, which invalidates their input. This experience is inconvenient if the whitespace was accidentally entered and can result in a confusing experience for the user trying to change inputs for these fields.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment0 except test this on the "Copies" and "Pages (Custom)" fields.
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Not risky since this patch adds a small restriction for certain input (ie: non-numeric characters) from being entered and only impacts the scale input, copies, and page range UI components.
  • String changes made/needed:
Attachment #9173384 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED

Comment on attachment 9173384 [details]
Bug 1660060 - Add a keypress handler to PrintUIControlMixin that prevents invalid input. r?emalysz

Approved for 81.0b6.

Attachment #9173384 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

This is verified fixed using Firefox 81.0b8 (BuildId:20200908191057) on Windows 10 64bit, macOS 10.14 & Ubuntu 18.04 64bit.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: