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

Unified Diff: Source/core/events/MouseRelatedEvent.cpp

Issue 215843002: Dispel the myth that enclosingLayer can return zero (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/MouseRelatedEvent.cpp
diff --git a/Source/core/events/MouseRelatedEvent.cpp b/Source/core/events/MouseRelatedEvent.cpp
index 842e0853c682345c0cf88f15c3b8fa87ee86d8f0..2da77c38f307d290c4c363c7c88e30b40c964d4c 100644
--- a/Source/core/events/MouseRelatedEvent.cpp
+++ b/Source/core/events/MouseRelatedEvent.cpp
@@ -160,11 +160,9 @@ void MouseRelatedEvent::computeRelativePosition()
while (n && !n->renderer())
n = n->parentNode();
- RenderLayer* layer;
- if (n && (layer = n->renderer()->enclosingLayer())) {
- for (; layer; layer = layer->parent()) {
+ if (n) {
+ for (RenderLayer* layer = n->renderer()->enclosingLayer(); layer; layer = layer->parent())
m_layerLocation -= toLayoutSize(layer->location());
- }
}
m_hasCachedRelativePosition = true;
« no previous file with comments | « no previous file | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698