From 78ba77f68bbbb83e9b27bfcc242be8e4a1102c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 28 Jan 2020 21:10:26 +0000 Subject: [PATCH] Bug 1611661 - Give nsNumberControlFrame a TextInput type. r=mats LayoutFrameType::NumberControl is unused, and nsNumberControlFrame inherits now from nsTextControlFrame. There are three places that check for LayoutFrameType::TextInput. Two direct ones: * ShouldApplyOverflowCLipping * nsFontInflationData And one indirect via IsTextInputFrame, the one mentioned in comment 2. For all those three, it makes sense for nsNumberControlFrame to be handled in the same way as nsTextControlFrame. Long term we may want to get rid of the concept of frame types and just use queryFrame or some sugar of that sort, as it's error prone. But for now this fixes the bug. Differential Revision: https://phabricator.services.mozilla.com/D61088 --HG-- extra : moz-landing-system : lando --- layout/base/tests/bug1611661-ref.html | 18 +++++++++++++++ layout/base/tests/bug1611661.html | 23 +++++++++++++++++++ layout/base/tests/mochitest.ini | 2 ++ .../base/tests/test_reftests_with_caret.html | 2 ++ layout/generic/FrameClasses.py | 2 +- 5 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 layout/base/tests/bug1611661-ref.html create mode 100644 layout/base/tests/bug1611661.html diff --git a/layout/base/tests/bug1611661-ref.html b/layout/base/tests/bug1611661-ref.html new file mode 100644 index 000000000000..5c9d2d674e4b --- /dev/null +++ b/layout/base/tests/bug1611661-ref.html @@ -0,0 +1,18 @@ + + +Test reference + + +
+ +
+ diff --git a/layout/base/tests/bug1611661.html b/layout/base/tests/bug1611661.html new file mode 100644 index 000000000000..d92ae05e667f --- /dev/null +++ b/layout/base/tests/bug1611661.html @@ -0,0 +1,23 @@ + + +Can edit input type=number with a user-select: none ancestor + + +
+ +
+ diff --git a/layout/base/tests/mochitest.ini b/layout/base/tests/mochitest.ini index e61026e6978f..9356cced948c 100644 --- a/layout/base/tests/mochitest.ini +++ b/layout/base/tests/mochitest.ini @@ -357,6 +357,8 @@ support-files = bug1550869-2-ref.html bug1591282-1.html bug1591282-1-ref.html + bug1611661.html + bug1611661-ref.html image_rgrg-256x256.png input-invalid-ref.html input-maxlength-invalid-change.html diff --git a/layout/base/tests/test_reftests_with_caret.html b/layout/base/tests/test_reftests_with_caret.html index c5fcfbf5cb1b..d28b175d8230 100644 --- a/layout/base/tests/test_reftests_with_caret.html +++ b/layout/base/tests/test_reftests_with_caret.html @@ -385,6 +385,8 @@ if (navigator.platform.includes("Linux")) { [ 'bug1524266-3.html' , 'bug1524266-2-ref.html' ] , // Tries to select and delete non-editable content in a user-select subtree. [ 'bug1524266-4.html' , 'bug1524266-2-ref.html' ] , + // Tries to edit an with arrows inside a user-select: none element. + [ 'bug1611661.html' , 'bug1611661-ref.html' ] , function() {SpecialPowers.pushPrefEnv({'clear': [['layout.accessiblecaret.enabled_on_touch']]}, nextTest);} , ]); } diff --git a/layout/generic/FrameClasses.py b/layout/generic/FrameClasses.py index d1291078ef26..5bebc62c4e68 100644 --- a/layout/generic/FrameClasses.py +++ b/layout/generic/FrameClasses.py @@ -76,7 +76,7 @@ FRAME_CLASSES = [ Frame("nsMenuFrame", "Menu", NOT_LEAF), Frame("nsMenuPopupFrame", "MenuPopup", DYNAMIC_LEAF), Frame("nsMeterFrame", "Meter", LEAF), - Frame("nsNumberControlFrame", "NumberControl", LEAF), + Frame("nsNumberControlFrame", "TextInput", LEAF), Frame("nsPluginFrame", "Object", LEAF), Frame("nsPageBreakFrame", "PageBreak", LEAF), Frame("nsPageContentFrame", "PageContent", NOT_LEAF),