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

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: Better tests. 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 2153 matching lines...) Expand 10 before | Expand all | Expand 10 after
2164 if (enclosingLinkEventParentOrSelf()) 2164 if (enclosingLinkEventParentOrSelf())
2165 return; 2165 return;
2166 2166
2167 // Avoid that canBeScrolledAndHasScrollableArea changes layout tree 2167 // Avoid that canBeScrolledAndHasScrollableArea changes layout tree
2168 // structure. 2168 // structure.
2169 // FIXME: We should avoid synchronous layout if possible. We can 2169 // FIXME: We should avoid synchronous layout if possible. We can
2170 // remove this synchronous layout if we avoid synchronous layout in 2170 // remove this synchronous layout if we avoid synchronous layout in
2171 // LayoutTextControlSingleLine::scrollHeight 2171 // LayoutTextControlSingleLine::scrollHeight
2172 document().updateStyleAndLayoutIgnorePendingStylesheets(); 2172 document().updateStyleAndLayoutIgnorePendingStylesheets();
2173 LayoutObject* layoutObject = this->layoutObject(); 2173 LayoutObject* layoutObject = this->layoutObject();
2174 while (layoutObject && 2174 while (
2175 (!layoutObject->isBox() || 2175 layoutObject &&
2176 !toLayoutBox(layoutObject)->canBeScrolledAndHasScrollableArea())) 2176 (!layoutObject->isBox() ||
2177 layoutObject = layoutObject->parent(); 2177 !toLayoutBox(layoutObject)->canBeScrolledAndHasScrollableArea())) {
2178 2178 if (layoutObject->node() && layoutObject->node()->isDocumentNode()) {
2179 Element* owner = toDocument(layoutObject->node())->localOwner();
2180 layoutObject = owner ? owner->layoutObject() : nullptr;
2181 } else {
2182 layoutObject = layoutObject->parent();
2183 }
2184 }
2179 if (layoutObject) { 2185 if (layoutObject) {
2180 if (LocalFrame* frame = document().frame()) 2186 if (LocalFrame* frame = document().frame())
2181 frame->eventHandler().startMiddleClickAutoscroll(layoutObject); 2187 frame->eventHandler().startMiddleClickAutoscroll(layoutObject);
2182 } 2188 }
2183 } 2189 }
2184 } else if (event->type() == EventTypeNames::webkitEditableContentChanged) { 2190 } else if (event->type() == EventTypeNames::webkitEditableContentChanged) {
2185 // TODO(chongz): Remove after shipped. 2191 // TODO(chongz): Remove after shipped.
2186 // New InputEvent are dispatched in Editor::appliedEditing, etc. 2192 // New InputEvent are dispatched in Editor::appliedEditing, etc.
2187 if (!RuntimeEnabledFeatures::inputEventEnabled()) 2193 if (!RuntimeEnabledFeatures::inputEventEnabled())
2188 dispatchInputEvent(); 2194 dispatchInputEvent();
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
2489 if (node) { 2495 if (node) {
2490 std::stringstream stream; 2496 std::stringstream stream;
2491 node->printNodePathTo(stream); 2497 node->printNodePathTo(stream);
2492 LOG(INFO) << stream.str(); 2498 LOG(INFO) << stream.str();
2493 } else { 2499 } else {
2494 LOG(INFO) << "Cannot showNodePath for <null>"; 2500 LOG(INFO) << "Cannot showNodePath for <null>";
2495 } 2501 }
2496 } 2502 }
2497 2503
2498 #endif 2504 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698