Closed Bug 1211257 Opened 9 years ago Closed 2 years ago

RegExp pattern validation does not work correctly

Categories

(Core :: JavaScript Engine, defect)

41 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: rej-scheijen, Unassigned)

Details

(Keywords: parity-chrome, parity-opera)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0
Build ID: 20150918100310

Steps to reproduce:

When creating a form with with a pattern validation (Dutch postall check) I noticed that the pattern validation was not working correctly.
It did on Chromium and on Opera.
The problem seems to be in the {[amount]} operator

This works : [1-9][0-9][0-9][0-9]\s?\w\w
This does not : [1-9][0-9]{3}\s?\w{2}


Actual results:

The value in the field was marked invalid (my own postal code)

Happens in Firefox 41
Happens in nightly build


Expected results:

The value should have been marked as valid.
All combinations with a {[amount]} operator in it seems to be faulty
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Summary: pattern validation does not work correctly → RegExp pattern validation does not work correctly
Whiteboard: [parity-chrome][parity-opera]
Can you post a testcase, including input data and the actual JavaScript code?
Flags: needinfo?(rej-scheijen)
In particular, what actual string are you typing in?

When I try this testcase: data:text/html,<input pattern="[1-9][0-9]{3}\s?\w{2}">

and type in "1234ab", it's correctly flagged as valid...
Hmmm never mind.
This will be a bugreport for the template parser of the framework.
For some reason he thinks that the {3} and {2} are unused template variables and removes them just before sending the page.
Flags: needinfo?(rej-scheijen)
How did things work in Chrome/Opera then?
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Whiteboard: [parity-chrome][parity-opera]
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.