mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #29456 - 2shiori17:issue-29097, r=mukilan
Make HTMLInputElement.list an HTMLDataListElement <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #29097 <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because the only change is the return type. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
9f98a1ed1a
2 changed files with 4 additions and 7 deletions
|
@ -744,7 +744,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#concept-input-list
|
||||
fn suggestions_source_element(&self) -> Option<DomRoot<HTMLElement>> {
|
||||
fn suggestions_source_element(&self) -> Option<DomRoot<HTMLDataListElement>> {
|
||||
let list_string = self
|
||||
.upcast::<Element>()
|
||||
.get_string_attribute(&local_name!("list"));
|
||||
|
@ -762,10 +762,7 @@ impl HTMLInputElement {
|
|||
});
|
||||
first_with_id
|
||||
.as_ref()
|
||||
.and_then(|el| {
|
||||
el.downcast::<HTMLDataListElement>()
|
||||
.map(|data_el| data_el.upcast::<HTMLElement>())
|
||||
})
|
||||
.and_then(|el| el.downcast::<HTMLDataListElement>())
|
||||
.map(|el| DomRoot::from_ref(&*el))
|
||||
}
|
||||
|
||||
|
@ -1314,7 +1311,7 @@ impl HTMLInputElementMethods for HTMLInputElement {
|
|||
make_setter!(SetMin, "min");
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-input-list
|
||||
fn GetList(&self) -> Option<DomRoot<HTMLElement>> {
|
||||
fn GetList(&self) -> Option<DomRoot<HTMLDataListElement>> {
|
||||
self.suggestions_source_element()
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ interface HTMLInputElement : HTMLElement {
|
|||
attribute boolean indeterminate;
|
||||
// [CEReactions]
|
||||
// attribute DOMString inputMode;
|
||||
readonly attribute HTMLElement? list;
|
||||
readonly attribute HTMLDataListElement? list;
|
||||
[CEReactions]
|
||||
attribute DOMString max;
|
||||
[CEReactions, SetterThrows]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue