Bug 1517385 - Add the pref to control the transition-duration. r=TYLin

Differential Revision: https://phabricator.services.mozilla.com/D96506
This commit is contained in:
lonocvb 2020-11-12 07:31:02 +00:00
Родитель 5a1a34953a
Коммит 591d8456eb
5 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -302,7 +302,10 @@ void AccessibleCaret::SetCaretElementStyle(const nsRect& aRect,
styleStr.AppendLiteral("px; margin-left: ");
styleStr.AppendFloat(StaticPrefs::layout_accessiblecaret_margin_left() /
aZoomLevel);
styleStr.AppendLiteral("px");
styleStr.AppendLiteral("px; transition-duration: ");
styleStr.AppendFloat(
StaticPrefs::layout_accessiblecaret_transition_duration());
styleStr.AppendLiteral("ms");
CaretElement().SetAttr(kNameSpaceID_None, nsGkAtoms::style, styleStr, true);
AC_LOG("%s: %s", __FUNCTION__, NS_ConvertUTF16toUTF8(styleStr).get());

Просмотреть файл

@ -49,6 +49,9 @@ class AccessibleCaretCursorModeTestCase(MarionetteTestCase):
self.prefs = {
self.caret_tested_pref: True,
self.hide_carets_for_mouse: False,
# To disable transition, or the caret may not be the desired
# location yet, we cannot press a caret successfully.
"layout.accessiblecaret.transition-duration": "0.0",
}
self.marionette.set_prefs(self.prefs)
self.actions = CaretActions(self.marionette)

Просмотреть файл

@ -56,6 +56,9 @@ class AccessibleCaretSelectionModeTestCase(MarionetteTestCase):
self.prefs = {
"layout.word_select.eat_space_to_next_word": False,
self.carets_tested_pref: True,
# To disable transition, or the caret may not be the desired
# location yet, we cannot press a caret successfully.
"layout.accessiblecaret.transition-duration": "0.0",
}
self.marionette.set_prefs(self.prefs)
self.actions = CaretActions(self.marionette)

Просмотреть файл

@ -412,7 +412,6 @@ parsererror|sourcetext {
div:-moz-native-anonymous.moz-accessiblecaret {
/* Add transition effect to make caret size changing smoother. */
transition-duration: 250ms;
transition-property: width, height, margin-left;
position: absolute;

Просмотреть файл

@ -5823,6 +5823,11 @@
value: -18.5f
mirror: always
- name: layout.accessiblecaret.transition-duration
type: float
value: 250.0f
mirror: always
# Simulate long tap events to select words. Mainly used in manual testing
# with mouse.
- name: layout.accessiblecaret.use_long_tap_injector