| Index: third_party/WebKit/Source/core/dom/Node.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
|
| index 8983f821c4c68e0a9ee2ade29d6467b4f949a659..d840821481dcdeff1b34b99d17970879f609c8be 100644
|
| --- a/third_party/WebKit/Source/core/dom/Node.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Node.cpp
|
| @@ -2169,11 +2169,17 @@ void Node::defaultEventHandler(Event* event) {
|
| // LayoutTextControlSingleLine::scrollHeight
|
| document().updateStyleAndLayoutIgnorePendingStylesheets();
|
| LayoutObject* layoutObject = this->layoutObject();
|
| - while (layoutObject &&
|
| - (!layoutObject->isBox() ||
|
| - !toLayoutBox(layoutObject)->canBeScrolledAndHasScrollableArea()))
|
| - layoutObject = layoutObject->parent();
|
| -
|
| + while (
|
| + layoutObject &&
|
| + (!layoutObject->isBox() ||
|
| + !toLayoutBox(layoutObject)->canBeScrolledAndHasScrollableArea())) {
|
| + if (layoutObject->node() && layoutObject->node()->isDocumentNode()) {
|
| + Element* owner = toDocument(layoutObject->node())->localOwner();
|
| + layoutObject = owner ? owner->layoutObject() : nullptr;
|
| + } else {
|
| + layoutObject = layoutObject->parent();
|
| + }
|
| + }
|
| if (layoutObject) {
|
| if (LocalFrame* frame = document().frame())
|
| frame->eventHandler().startMiddleClickAutoscroll(layoutObject);
|
|
|