Bug 1729292 - Honor scroll margin of host when we're scrolling to a chrome-only-access element. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D124691
This commit is contained in:
Emilio Cobos Álvarez
2021-09-07 08:24:59 +00:00
parent e30ba548ee
commit 8bf9f725d7
3 changed files with 55 additions and 1 deletions

View File

@@ -2966,6 +2966,8 @@ void HTMLInputElement::SetCheckedInternal(bool aChecked, bool aNotify) {
void HTMLInputElement::Blur(ErrorResult& aError) {
if (CreatesDateTimeWidget()) {
if (Element* dateTimeBoxElement = GetDateTimeBoxElement()) {
// TODO(emilio, bug 1729342): This should probably use delegatesFocus
// instead.
AsyncEventDispatcher* dispatcher = new AsyncEventDispatcher(
dateTimeBoxElement, u"MozBlurInnerTextBox"_ns, CanBubble::eNo,
ChromeOnlyDispatch::eNo);
@@ -2981,6 +2983,8 @@ void HTMLInputElement::Focus(const FocusOptions& aOptions,
CallerType aCallerType, ErrorResult& aError) {
if (CreatesDateTimeWidget()) {
if (Element* dateTimeBoxElement = GetDateTimeBoxElement()) {
// TODO(emilio, bug 1729342): This should probably use delegatesFocus
// instead.
AsyncEventDispatcher* dispatcher = new AsyncEventDispatcher(
dateTimeBoxElement, u"MozFocusInnerTextBox"_ns, CanBubble::eNo,
ChromeOnlyDispatch::eNo);