Closed Bug 1660991 Opened 4 years ago Closed 4 years ago

Page range validates the . (dot) before and after the numeric value

Categories

(Toolkit :: Printing, defect, P3)

defect

Tracking

()

VERIFIED FIXED
82 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox80 --- unaffected
firefox81 --- fixed
firefox82 --- verified

People

(Reporter: emilghitta, Assigned: mtigley)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: [print2020_v81] [old-ui-] [Fixed by 1660060])

Attachments

(2 files, 1 obsolete file)

Attached image badRange.png

Affected versions

  • 82.0a1 (BuildId:20200824215021)
  • 81.0b1 (BuildId:20200824150741)

Affected platforms

  • Windows 10 64bit
  • macOS 10.14
  • Ubuntu 20.04 64bit

Steps to reproduce

  1. Launch Firefox.
  2. Open any webpage.
  3. Hit CTRL + P.
  4. Choose the “Custom” option from the “Pages” dropdown menu.
    Input a numeric value that starts with a dot (ex: .3 for a webpage that prints at least 3 pages).

Expected result

  • The following error message is displayed: “Range must be a number between 1 and 5.”

Actual result

  • The dot is validated and the following error is displayed: “The “from” page number must be smaller than the “to” page number”.

Regression Window

Additional Information

  • For further information regarding this issue please observe the attached screenshots.
  • The same outcome seems to happen if you put - in front of the numeric value.
  • On a different note, it seems that the dot is being validated after the numeric value as well.

Hi Emma!

It seems that mozregression pointed out Bug 1653389, show clearer error message if the start range is greater than the end range r=fluent-reviewers,mstriemer,flod for causing the regression where the incorrect error message is displayed if the dot is placed before the numeric value inside the to section.

Can you please take a look?

Thank you!

Also, it seems that 81.0b1 (Build:20200824150741) seems to be affected as well...so I'm wondering if Bug 1653389 has already entered beta somehow. (graph view)

Flags: needinfo?(emalysz)
Whiteboard: [print2020_v81] [old-ui-]
Attached image goodRange.png

Attaching the error message that was displayed before Bug 1653389

Blocks: 133787, 1658287

I mean, 1 is bigger than 0.1, so the error message is technically correct… 😉
But yeah, we probably want to change that.

Severity: -- → S4
Priority: -- → P3

ofc :D ...But we might want to invalidate decimal values.

Todo: "1.2" should be given the correct error message

Attachment #9172265 - Attachment description: Bug 1660991, introduce pattern to start and end page range inputs to invalidate . → Bug 1660991, introduce pattern to start and end page range inputs to improve validation

I think this should be fixed by disallowing non-numeric characters in our number fields, which is bug 1660060.

Depends on: 1660060

Yeah, I originally thought we could introduce a pattern to allow 0-9 chars (and maybe whitespaces) like we do for some number validations https://searchfox.org/mozilla-central/source/browser/extensions/formautofill/test/fixtures/third_party/QVC/PaymentMethod.html#92 , but it looks like that's only possible in text fields. And if we change it to that, then we miss out on all the number validation we already have implemented.

Micah had mentioned looking at the key presses for bug 1660060. I guess nothing needs to be done for this, and we can close out once that bug is resolved

Flags: needinfo?(emalysz)
Attachment #9172265 - Attachment is obsolete: true
Has Regression Range: --- → yes
Has STR: --- → yes

(In reply to Mark Striemer [:mstriemer] from comment #6)

I think this should be fixed by disallowing non-numeric characters in our number fields, which is bug 1660060.

This is fixed, and indeed I get the expected result now. Emil, can you verify this is fixed?

Flags: needinfo?(emil.ghitta)

I can confirm that this issue is verified fixed using Firefox 82.0a1 (BuildId:20200902215721) on Windows 10 64bit, macOS 10.14 and Ubuntu 18.04 64bit.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Whiteboard: [print2020_v81] [old-ui-] → [print2020_v81] [old-ui-] [Fixed by 1660060]
Status: RESOLVED → VERIFIED
Flags: needinfo?(emil.ghitta)
Assignee: nobody → mtigley
Target Milestone: --- → 82 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: