Bug 185942 - :out-of-range pseudo class doesn't match if value reaches a certain amount of characters
Summary: :out-of-range pseudo class doesn't match if value reaches a certain amount of...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 11
Hardware: All All
: P2 Minor
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-24 05:11 PDT by m.renty
Modified: 2023-05-28 06:35 PDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description m.renty 2018-05-24 05:11:35 PDT
When using the :out-of-range pseudo class I noticed it didn't match anymore when it reached a certain threshold of used characters.
I've tested this both on Safari 11.1 and Safari Mobile.

You can reproduce it using this codepen I made https://codepen.io/mrenty/pen/QrRZwP.
If you type "111111111111111111111111111111111111111" it is invalid as expected, but if you add an extra number it becomes in range.
Comment 1 Alexey Proskuryakov 2018-05-26 19:12:05 PDT
Presumably when it gets so large that it fails to parse as a number.
Comment 2 Radar WebKit Bug Importer 2018-05-26 19:12:19 PDT
<rdar://problem/40583017>
Comment 3 Ahmad Saleem 2022-08-07 04:54:09 PDT
I am able to reproduce this bug in Safari 15.6 on macOS 12.5 using attached CodePen from Comment 0 and pasting "111111111111111111111111111111111111111" and then adding "1" makes it in range and change background to "green", while all other browsers (Chrome Canary 106 and Firefox Nightly 105) keeps it "red" to show "out of range". Thanks!
Comment 4 Ryosuke Niwa 2022-08-07 14:03:39 PDT
(In reply to Alexey Proskuryakov from comment #1)
> Presumably when it gets so large that it fails to parse as a number.

This is exactly what's happening. sanitizeValue turns a very long integer into an empty string and that parses as a valid value.
Comment 5 Ahmad Saleem 2023-05-28 06:35:17 PDT
Fixed in even Safari 16.5.

Marking as 'RESOLVED CONFIGURATION CHANGED'. Thanks!