Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
REGRESSION (r290124): Unable to insert decimal point when typing in a…
… number text field in QQ app https://bugs.webkit.org/show_bug.cgi?id=240761 rdar://91882650 Reviewed by Chris Dumez and Tim Horton. After the changes in r290124, we no longer treat strings that end with a full stop (e.g. "1.") as valid floating point numbers, per section 2.5.4.3 of the HTML spec (Real numbers), which states that a decimal number that contains a full stop character (".") must be succeeded by one or more digit characters. The HTML spec later references this when describing how to sanitize the value of number inputs -- namely, we return the value of the input if it's a valid floating point number, and otherwise return the empty string. However, the QQ app still relies on the fact that strings of the form are "<n>." are valid floating point numbers; this is because the app installs a `keyup` event handler that asks for the input's value, removes all non-digit and non- full-stop characters, and then sets the text field's value to this new string. Because strings ending with a period are no longer valid floating point numbers, it's now very difficult to type decimals of the form `"N.N"` into some text fields in the QQ app, since the input is cleared out each time the user types "." at the end of the field. This new behavior (more or less) matches Chrome and Firefox; to maintain consistent behavior with other browsers without breaking binary compatibility, we guard this new behavior with a linked-on-or-after check. * Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h: * Source/WebCore/html/parser/HTMLParserIdioms.cpp: (WebCore::parseToDoubleForNumberType): Canonical link: https://commits.webkit.org/250843@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294617 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information