A pattern with infinite backtracking should terminate, not hang the tab
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
People
(Reporter: twisniewski, Assigned: vhilla)
References
(Depends on 1 open bug, )
Details
This seems to cause a bad tab hang on Firefox, which doesn't happen in Safari or Chrome. Fixing this would also let us pass the WPT https://wpt.fyi/results/html/semantics/forms/constraints/infinite_backtracking.html, which is one of only two in the html/semantics/forms/constraints section which we do not pass.
Reporter | ||
Comment 1•2 years ago
|
||
Actually this also appears to be part of interop2023, so marking it as such.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
:zcorpan what is your perspective on introducing a backtracking limit?
For the pattern attribute on input elements, Chromium and WebKit apply the regular expression with a backtracking limit (see bug). This does not seem to be part of the #attr-input-pattern spec, but is now enforced through this WPT.
I am unsure if this limit also applies to other situations, they mention something about regex within css in the issue content. From a quick test, it does not seem to apply when using a regex in js.
As two browsers have this behavior, it might make sense to align with them and incorporate it into the standard. But ECMAScript does not seem to define a backtracking limit, so adding it to the standard might be more involved.
Comment 3•2 years ago
|
||
Hmm, since the limit behavior isn't specified it seems to be the test should be .tentative
and not be part of Interop 2023. I'll file a test change issue.
But we can also specify the backtracking limit in HTML. Can you file an issue in whatwg/html?
Comment 4•2 years ago
|
||
Filed https://github.com/web-platform-tests/interop/issues/371
I'm not sure how CSS can hit this issue. There are substring attribute selectors but you can't write a regex with them.
Assignee | ||
Comment 5•2 years ago
|
||
Comment 6•2 years ago
|
||
The test is now removed from Interop 2023.
I'm not sure how CSS can hit this issue.
I'm still not entirely sure but I think it's with the :invalid
pseudo-class causing form validation, so the regexp is still in <input pattern>
.
Assignee | ||
Updated•1 year ago
|
Description
•