Bug 1432856 - Extended focus methods in Window.webidl, Client.webidl and Element.webidl to pass CallerType. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D55811
This commit is contained in:
pbz
2020-01-16 14:38:40 +00:00
parent 80773f0b0b
commit 9ca53ea171
72 changed files with 229 additions and 126 deletions

View File

@@ -2932,7 +2932,7 @@ void HTMLInputElement::Blur(ErrorResult& aError) {
}
void HTMLInputElement::Focus(const FocusOptions& aOptions,
ErrorResult& aError) {
CallerType aCallerType, ErrorResult& aError) {
if ((mType == NS_FORM_INPUT_TIME || mType == NS_FORM_INPUT_DATE) &&
!IsExperimentalMobileType(mType)) {
if (Element* dateTimeBoxElement = GetDateTimeBoxElement()) {
@@ -2944,7 +2944,7 @@ void HTMLInputElement::Focus(const FocusOptions& aOptions,
}
}
nsGenericHTMLElement::Focus(aOptions, aError);
nsGenericHTMLElement::Focus(aOptions, aCallerType, aError);
}
#if !defined(ANDROID) && !defined(XP_MACOSX)
@@ -3798,7 +3798,8 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
FocusOptions options;
ErrorResult error;
selectedRadioButton->Focus(options, error);
selectedRadioButton->Focus(options, CallerType::System,
error);
rv = error.StealNSResult();
if (NS_SUCCEEDED(rv)) {
rv = DispatchSimulatedClick(selectedRadioButton,