mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Only fire keypress events if the key press produced a character
For example, pressing just the shift key should not producde a keypress event.
This commit is contained in:
parent
3925317c11
commit
448754d95d
Notes:
github-actions[bot]
2024-10-09 17:11:02 +00:00
Author: https://github.com/trflynn89
Commit: 448754d95d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1699
5 changed files with 62 additions and 4 deletions
|
@ -113,6 +113,16 @@ bool code_point_has_control_general_category(u32 code_point)
|
|||
return code_point_has_general_category(code_point, U_CONTROL_CHAR);
|
||||
}
|
||||
|
||||
bool code_point_has_letter_general_category(u32 code_point)
|
||||
{
|
||||
return code_point_has_general_category(code_point, GENERAL_CATEGORY_LETTER);
|
||||
}
|
||||
|
||||
bool code_point_has_number_general_category(u32 code_point)
|
||||
{
|
||||
return code_point_has_general_category(code_point, GENERAL_CATEGORY_NUMBER);
|
||||
}
|
||||
|
||||
bool code_point_has_punctuation_general_category(u32 code_point)
|
||||
{
|
||||
return code_point_has_general_category(code_point, GENERAL_CATEGORY_PUNCTUATION);
|
||||
|
@ -128,6 +138,11 @@ bool code_point_has_space_separator_general_category(u32 code_point)
|
|||
return code_point_has_general_category(code_point, U_SPACE_SEPARATOR);
|
||||
}
|
||||
|
||||
bool code_point_has_symbol_general_category(u32 code_point)
|
||||
{
|
||||
return code_point_has_general_category(code_point, GENERAL_CATEGORY_SYMBOL);
|
||||
}
|
||||
|
||||
static constexpr Property PROPERTY_ANY = UCHAR_BINARY_LIMIT + 1;
|
||||
static constexpr Property PROPERTY_ASCII = UCHAR_BINARY_LIMIT + 2;
|
||||
static constexpr Property PROPERTY_ASSIGNED = UCHAR_BINARY_LIMIT + 3;
|
||||
|
|
|
@ -18,9 +18,12 @@ Optional<GeneralCategory> general_category_from_string(StringView);
|
|||
bool code_point_has_general_category(u32 code_point, GeneralCategory general_category);
|
||||
|
||||
bool code_point_has_control_general_category(u32 code_point);
|
||||
bool code_point_has_letter_general_category(u32 code_point);
|
||||
bool code_point_has_number_general_category(u32 code_point);
|
||||
bool code_point_has_punctuation_general_category(u32 code_point);
|
||||
bool code_point_has_separator_general_category(u32 code_point);
|
||||
bool code_point_has_space_separator_general_category(u32 code_point);
|
||||
bool code_point_has_symbol_general_category(u32 code_point);
|
||||
|
||||
Optional<Property> property_from_string(StringView);
|
||||
bool code_point_has_property(u32 code_point, Property property);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue