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

Side by Side Diff: Source/core/layout/LayoutPart.cpp

Issue 1194473003: Make updateLayoutAndStyleForPainting() O(N) in terms of frame number in LayoutView::hitTest() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebasae layout test result because the order of the when the tracing runs changed Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/inspector/tracing/hit-test-expected.txt ('k') | Source/core/layout/LayoutView.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Simon Hausmann <hausmann@kde.org> 3 * (C) 2000 Simon Hausmann <hausmann@kde.org>
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 FrameView* childFrameView = toFrameView(widget()); 163 FrameView* childFrameView = toFrameView(widget());
164 LayoutView* childRoot = childFrameView->layoutView(); 164 LayoutView* childRoot = childFrameView->layoutView();
165 165
166 if (visibleToHitTestRequest(result.hitTestRequest()) && childRoot) { 166 if (visibleToHitTestRequest(result.hitTestRequest()) && childRoot) {
167 LayoutPoint adjustedLocation = accumulatedOffset + location(); 167 LayoutPoint adjustedLocation = accumulatedOffset + location();
168 LayoutPoint contentOffset = LayoutPoint(borderLeft() + paddingLeft(), bo rderTop() + paddingTop()) - LayoutSize(childFrameView->scrollOffset()); 168 LayoutPoint contentOffset = LayoutPoint(borderLeft() + paddingLeft(), bo rderTop() + paddingTop()) - LayoutSize(childFrameView->scrollOffset());
169 HitTestLocation newHitTestLocation(locationInContainer, -adjustedLocatio n - contentOffset); 169 HitTestLocation newHitTestLocation(locationInContainer, -adjustedLocatio n - contentOffset);
170 HitTestRequest newHitTestRequest(result.hitTestRequest().type() | HitTes tRequest::ChildFrameHitTest); 170 HitTestRequest newHitTestRequest(result.hitTestRequest().type() | HitTes tRequest::ChildFrameHitTest);
171 HitTestResult childFrameResult(newHitTestRequest, newHitTestLocation); 171 HitTestResult childFrameResult(newHitTestRequest, newHitTestLocation);
172 172
173 bool isInsideChildFrame = childRoot->hitTest(childFrameResult); 173 // The frame's layout and style must be up-to-date if we reach here.
174 bool isInsideChildFrame = childRoot->hitTestNoLayoutAndStyleUpdate(child FrameResult);
174 175
175 if (result.hitTestRequest().listBased()) { 176 if (result.hitTestRequest().listBased()) {
176 result.append(childFrameResult); 177 result.append(childFrameResult);
177 } else if (isInsideChildFrame) { 178 } else if (isInsideChildFrame) {
178 // Force the result not to be cacheable because the parent 179 // Force the result not to be cacheable because the parent
179 // frame should not cache this result; as it won't be notified of 180 // frame should not cache this result; as it won't be notified of
180 // changes in the child. 181 // changes in the child.
181 childFrameResult.setCacheable(false); 182 childFrameResult.setCacheable(false);
182 result = childFrameResult; 183 result = childFrameResult;
183 } 184 }
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 if (widget->frameRect() == newFrame) 325 if (widget->frameRect() == newFrame)
325 return false; 326 return false;
326 327
327 RefPtr<LayoutPart> protector(this); 328 RefPtr<LayoutPart> protector(this);
328 RefPtrWillBeRawPtr<Node> protectedNode(node()); 329 RefPtrWillBeRawPtr<Node> protectedNode(node());
329 widget->setFrameRect(newFrame); 330 widget->setFrameRect(newFrame);
330 return widget->frameRect().size() != newFrame.size(); 331 return widget->frameRect().size() != newFrame.size();
331 } 332 }
332 333
333 } 334 }
OLDNEW
« no previous file with comments | « LayoutTests/inspector/tracing/hit-test-expected.txt ('k') | Source/core/layout/LayoutView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698