| Index: third_party/WebKit/Source/core/html/TextControlElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/TextControlElement.cpp b/third_party/WebKit/Source/core/html/TextControlElement.cpp
|
| index 309427990f1212e56ab1413748eca60b3f9a0132..f901aec61b6deaf68ccdb13351fcd86b7218aa54 100644
|
| --- a/third_party/WebKit/Source/core/html/TextControlElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/TextControlElement.cpp
|
| @@ -870,11 +870,20 @@ TextControlElement* enclosingTextControl(Node* container) {
|
| if (!container)
|
| return nullptr;
|
| Element* ancestor = container->ownerShadowHost();
|
| - return ancestor && isTextControlElement(*ancestor) &&
|
| - container->containingShadowRoot()->type() ==
|
| - ShadowRootType::UserAgent
|
| - ? toTextControlElement(ancestor)
|
| - : 0;
|
| +
|
| + if (!ancestor || !isTextControlElement(*ancestor))
|
| + return nullptr;
|
| +
|
| + // textarea.shadowRoot is considered not enclosed.
|
| + if (container->isShadowRoot() &&
|
| + toShadowRoot(container)->type() == ShadowRootType::UserAgent &&
|
| + &toShadowRoot(container)->host() == ancestor)
|
| + return nullptr;
|
| +
|
| + if (container->containingShadowRoot()->type() != ShadowRootType::UserAgent)
|
| + return nullptr;
|
| +
|
| + return toTextControlElement(ancestor);
|
| }
|
|
|
| String TextControlElement::directionForFormData() const {
|
|
|