| Index: third_party/WebKit/Source/core/html/FormAssociatedElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/FormAssociatedElement.cpp b/third_party/WebKit/Source/core/html/FormAssociatedElement.cpp
|
| index d012dc16fef4ec1e33ce01fc8c4c22562baf23ed..04dd245228685f3473f5cf4735ca56a5a3941902 100644
|
| --- a/third_party/WebKit/Source/core/html/FormAssociatedElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/FormAssociatedElement.cpp
|
| @@ -86,7 +86,7 @@ void FormAssociatedElement::insertedInto(ContainerNode* insertionPoint)
|
| if (!m_formWasSetByParser || !m_form || NodeTraversal::highestAncestorOrSelf(*insertionPoint) != NodeTraversal::highestAncestorOrSelf(*m_form.get()))
|
| resetFormOwner();
|
|
|
| - if (!insertionPoint->inDocument())
|
| + if (!insertionPoint->inShadowIncludingDocument())
|
| return;
|
|
|
| HTMLElement* element = toHTMLElement(this);
|
| @@ -97,7 +97,7 @@ void FormAssociatedElement::insertedInto(ContainerNode* insertionPoint)
|
| void FormAssociatedElement::removedFrom(ContainerNode* insertionPoint)
|
| {
|
| HTMLElement* element = toHTMLElement(this);
|
| - if (insertionPoint->inDocument() && element->fastHasAttribute(formAttr)) {
|
| + if (insertionPoint->inShadowIncludingDocument() && element->fastHasAttribute(formAttr)) {
|
| setFormAttributeTargetObserver(nullptr);
|
| resetFormOwner();
|
| return;
|
| @@ -113,7 +113,7 @@ HTMLFormElement* FormAssociatedElement::findAssociatedForm(const HTMLElement* el
|
| const AtomicString& formId(element->fastGetAttribute(formAttr));
|
| // 3. If the element is reassociateable, has a form content attribute, and
|
| // is itself in a Document, then run these substeps:
|
| - if (!formId.isNull() && element->inDocument()) {
|
| + if (!formId.isNull() && element->inShadowIncludingDocument()) {
|
| // 3.1. If the first element in the Document to have an ID that is
|
| // case-sensitively equal to the element's form content attribute's
|
| // value is a form element, then associate the form-associated element
|
| @@ -138,7 +138,7 @@ void FormAssociatedElement::formRemovedFromTree(const Node& formRoot)
|
|
|
| void FormAssociatedElement::associateByParser(HTMLFormElement* form)
|
| {
|
| - if (form && form->inDocument()) {
|
| + if (form && form->inShadowIncludingDocument()) {
|
| m_formWasSetByParser = true;
|
| setForm(form);
|
| form->didAssociateByParser();
|
| @@ -171,7 +171,7 @@ void FormAssociatedElement::willChangeForm()
|
|
|
| void FormAssociatedElement::didChangeForm()
|
| {
|
| - if (!m_formWasSetByParser && m_form && m_form->inDocument()) {
|
| + if (!m_formWasSetByParser && m_form && m_form->inShadowIncludingDocument()) {
|
| HTMLElement* element = toHTMLElement(this);
|
| element->document().didAssociateFormControl(element);
|
| }
|
| @@ -289,7 +289,7 @@ void FormAssociatedElement::resetFormAttributeTargetObserver()
|
| {
|
| HTMLElement* element = toHTMLElement(this);
|
| const AtomicString& formId(element->fastGetAttribute(formAttr));
|
| - if (!formId.isNull() && element->inDocument())
|
| + if (!formId.isNull() && element->inShadowIncludingDocument())
|
| setFormAttributeTargetObserver(FormAttributeTargetObserver::create(formId, this));
|
| else
|
| setFormAttributeTargetObserver(nullptr);
|
|
|