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

Side by Side Diff: Source/core/rendering/RenderView.cpp

Issue 354613002: Add test to track the number of hit tests on various events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Apply CR feedback Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderView.h ('k') | Source/core/testing/Internals.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 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 , m_frameView(document->view()) 53 , m_frameView(document->view())
54 , m_selectionStart(0) 54 , m_selectionStart(0)
55 , m_selectionEnd(0) 55 , m_selectionEnd(0)
56 , m_selectionStartPos(-1) 56 , m_selectionStartPos(-1)
57 , m_selectionEndPos(-1) 57 , m_selectionEndPos(-1)
58 , m_pageLogicalHeight(0) 58 , m_pageLogicalHeight(0)
59 , m_pageLogicalHeightChanged(false) 59 , m_pageLogicalHeightChanged(false)
60 , m_layoutState(0) 60 , m_layoutState(0)
61 , m_renderQuoteHead(0) 61 , m_renderQuoteHead(0)
62 , m_renderCounterCount(0) 62 , m_renderCounterCount(0)
63 , m_hitTestCount(0)
63 { 64 {
64 // init RenderObject attributes 65 // init RenderObject attributes
65 setInline(false); 66 setInline(false);
66 67
67 m_minPreferredLogicalWidth = 0; 68 m_minPreferredLogicalWidth = 0;
68 m_maxPreferredLogicalWidth = 0; 69 m_maxPreferredLogicalWidth = 0;
69 70
70 setPreferredLogicalWidthsDirty(MarkOnlyThis); 71 setPreferredLogicalWidthsDirty(MarkOnlyThis);
71 72
72 setPositionState(AbsolutePosition); // to 0,0 :) 73 setPositionState(AbsolutePosition); // to 0,0 :)
73 } 74 }
74 75
75 RenderView::~RenderView() 76 RenderView::~RenderView()
76 { 77 {
77 } 78 }
78 79
79 bool RenderView::hitTest(const HitTestRequest& request, HitTestResult& result) 80 bool RenderView::hitTest(const HitTestRequest& request, HitTestResult& result)
80 { 81 {
81 return hitTest(request, result.hitTestLocation(), result); 82 return hitTest(request, result.hitTestLocation(), result);
82 } 83 }
83 84
84 bool RenderView::hitTest(const HitTestRequest& request, const HitTestLocation& l ocation, HitTestResult& result) 85 bool RenderView::hitTest(const HitTestRequest& request, const HitTestLocation& l ocation, HitTestResult& result)
85 { 86 {
86 TRACE_EVENT0("blink", "RenderView::hitTest"); 87 TRACE_EVENT0("blink", "RenderView::hitTest");
88 m_hitTestCount++;
87 89
88 // We have to recursively update layout/style here because otherwise, when t he hit test recurses 90 // We have to recursively update layout/style here because otherwise, when t he hit test recurses
89 // into a child document, it could trigger a layout on the parent document, which can destroy RenderLayers 91 // into a child document, it could trigger a layout on the parent document, which can destroy RenderLayers
90 // that are higher up in the call stack, leading to crashes. 92 // that are higher up in the call stack, leading to crashes.
91 // Note that Document::updateLayout calls its parent's updateLayout. 93 // Note that Document::updateLayout calls its parent's updateLayout.
92 // FIXME: It should be the caller's responsibility to ensure an up-to-date l ayout. 94 // FIXME: It should be the caller's responsibility to ensure an up-to-date l ayout.
93 frameView()->updateLayoutAndStyleIfNeededRecursive(); 95 frameView()->updateLayoutAndStyleIfNeededRecursive();
94 return layer()->hitTest(request, location, result); 96 return layer()->hitTest(request, location, result);
95 } 97 }
96 98
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 return viewWidth(IncludeScrollbars) / scale; 994 return viewWidth(IncludeScrollbars) / scale;
993 } 995 }
994 996
995 double RenderView::layoutViewportHeight() const 997 double RenderView::layoutViewportHeight() const
996 { 998 {
997 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; 999 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1;
998 return viewHeight(IncludeScrollbars) / scale; 1000 return viewHeight(IncludeScrollbars) / scale;
999 } 1001 }
1000 1002
1001 } // namespace WebCore 1003 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderView.h ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698