Bug 841942 - Display tick marks for <input type=range> when @list/<datalist> is used r=emilio,credential-management-reviewers,sgalich

Differential Revision: https://phabricator.services.mozilla.com/D162882
This commit is contained in:
Zach Hoffman
2022-11-28 22:06:33 +00:00
parent e888fd7878
commit 67f7af1ef8
22 changed files with 264 additions and 20 deletions

View File

@@ -36,6 +36,7 @@
#include "nsIRadioVisitor.h"
#include "HTMLDataListElement.h"
#include "HTMLFormSubmissionConstants.h"
#include "mozilla/Telemetry.h"
#include "nsBaseCommandController.h"
@@ -1644,7 +1645,7 @@ void HTMLInputElement::SetValue(const nsAString& aValue, CallerType aCallerType,
}
}
nsGenericHTMLElement* HTMLInputElement::GetList() const {
HTMLDataListElement* HTMLInputElement::GetList() const {
nsAutoString dataListId;
GetAttr(kNameSpaceID_None, nsGkAtoms::list_, dataListId);
if (dataListId.IsEmpty()) {
@@ -1656,12 +1657,8 @@ nsGenericHTMLElement* HTMLInputElement::GetList() const {
return nullptr;
}
Element* element = docOrShadow->GetElementById(dataListId);
if (!element || !element->IsHTMLElement(nsGkAtoms::datalist)) {
return nullptr;
}
return static_cast<nsGenericHTMLElement*>(element);
return HTMLDataListElement::FromNodeOrNull(
docOrShadow->GetElementById(dataListId));
}
void HTMLInputElement::SetValue(Decimal aValue, CallerType aCallerType) {