Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Side by Side Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2484563003: Determine the layoutobject of middleClickAutoscroll by the scroll direction. (Closed)
Patch Set: Rename Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after
2162 if (enclosingLinkEventParentOrSelf()) 2162 if (enclosingLinkEventParentOrSelf())
2163 return; 2163 return;
2164 2164
2165 // Avoid that canBeScrolledAndHasScrollableArea changes layout tree 2165 // Avoid that canBeScrolledAndHasScrollableArea changes layout tree
2166 // structure. 2166 // structure.
2167 // FIXME: We should avoid synchronous layout if possible. We can 2167 // FIXME: We should avoid synchronous layout if possible. We can
2168 // remove this synchronous layout if we avoid synchronous layout in 2168 // remove this synchronous layout if we avoid synchronous layout in
2169 // LayoutTextControlSingleLine::scrollHeight 2169 // LayoutTextControlSingleLine::scrollHeight
2170 document().updateStyleAndLayoutIgnorePendingStylesheets(); 2170 document().updateStyleAndLayoutIgnorePendingStylesheets();
2171 LayoutObject* layoutObject = this->layoutObject(); 2171 LayoutObject* layoutObject = this->layoutObject();
2172 while (layoutObject && 2172 while (
2173 (!layoutObject->isBox() || 2173 layoutObject &&
2174 !toLayoutBox(layoutObject)->canBeScrolledAndHasScrollableArea())) 2174 (!layoutObject->isBox() ||
2175 layoutObject = layoutObject->parent(); 2175 !toLayoutBox(layoutObject)->canBeScrolledAndHasScrollableArea())) {
2176 2176 if (layoutObject->node() && layoutObject->node()->isDocumentNode()) {
2177 Element* owner = toDocument(layoutObject->node())->localOwner();
2178 layoutObject = owner ? owner->layoutObject() : nullptr;
2179 } else {
2180 layoutObject = layoutObject->parent();
2181 }
2182 }
2177 if (layoutObject) { 2183 if (layoutObject) {
2178 if (LocalFrame* frame = document().frame()) 2184 if (LocalFrame* frame = document().frame())
2179 frame->eventHandler().startMiddleClickAutoscroll(layoutObject); 2185 frame->eventHandler().startMiddleClickAutoscroll(layoutObject);
2180 } 2186 }
2181 } 2187 }
2182 } else if (event->type() == EventTypeNames::webkitEditableContentChanged) { 2188 } else if (event->type() == EventTypeNames::webkitEditableContentChanged) {
2183 // TODO(chongz): Remove after shipped. 2189 // TODO(chongz): Remove after shipped.
2184 // New InputEvent are dispatched in Editor::appliedEditing, etc. 2190 // New InputEvent are dispatched in Editor::appliedEditing, etc.
2185 if (!RuntimeEnabledFeatures::inputEventEnabled()) 2191 if (!RuntimeEnabledFeatures::inputEventEnabled())
2186 dispatchInputEvent(); 2192 dispatchInputEvent();
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
2487 if (node) { 2493 if (node) {
2488 std::stringstream stream; 2494 std::stringstream stream;
2489 node->printNodePathTo(stream); 2495 node->printNodePathTo(stream);
2490 LOG(INFO) << stream.str(); 2496 LOG(INFO) << stream.str();
2491 } else { 2497 } else {
2492 LOG(INFO) << "Cannot showNodePath for <null>"; 2498 LOG(INFO) << "Cannot showNodePath for <null>";
2493 } 2499 }
2494 } 2500 }
2495 2501
2496 #endif 2502 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698