Bug 1461321 - input.list should work in shadow DOM, r=peterv
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/dom/Date.h"
|
||||
#include "mozilla/dom/Directory.h"
|
||||
#include "mozilla/dom/DocumentOrShadowRoot.h"
|
||||
#include "mozilla/dom/DOMPrefs.h"
|
||||
#include "mozilla/dom/HTMLFormSubmission.h"
|
||||
#include "mozilla/dom/FileSystemUtils.h"
|
||||
@@ -1717,13 +1718,12 @@ HTMLInputElement::GetList() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//XXXsmaug How should this all work in case input element is in Shadow DOM.
|
||||
nsIDocument* doc = GetUncomposedDoc();
|
||||
if (!doc) {
|
||||
DocumentOrShadowRoot* docOrShadow = GetUncomposedDocOrConnectedShadowRoot();
|
||||
if (!docOrShadow) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Element* element = doc->GetElementById(dataListId);
|
||||
Element* element = docOrShadow->GetElementById(dataListId);
|
||||
if (!element || !element->IsHTMLElement(nsGkAtoms::datalist)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user