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

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

Issue 1294913004: Enable HitTestCache by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix layout test Created 5 years, 4 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 | « Source/core/layout/HitTestResult.h ('k') | Source/core/layout/LayoutView.cpp » ('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) 2006, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 HitTestResult& HitTestResult::operator=(const HitTestResult& other) 105 HitTestResult& HitTestResult::operator=(const HitTestResult& other)
106 { 106 {
107 m_hitTestLocation = other.m_hitTestLocation; 107 m_hitTestLocation = other.m_hitTestLocation;
108 m_hitTestRequest = other.m_hitTestRequest; 108 m_hitTestRequest = other.m_hitTestRequest;
109 populateFromCachedResult(other); 109 populateFromCachedResult(other);
110 110
111 return *this; 111 return *this;
112 } 112 }
113 113
114 unsigned HitTestResult::equalityScore(const HitTestResult& other) const
115 {
116 return (m_hitTestRequest.equalForCacheability(other.m_hitTestRequest) << 7)
117 | ((m_innerNode == other.innerNode()) << 6)
118 | ((m_innerPossiblyPseudoNode == other.innerPossiblyPseudoNode()) << 5)
119 | ((m_pointInInnerNodeFrame == other.m_pointInInnerNodeFrame) << 4)
120 | ((m_localPoint == other.localPoint()) << 3)
121 | ((m_innerURLElement == other.URLElement()) << 2)
122 | ((m_scrollbar == other.scrollbar()) << 1)
123 | (m_isOverWidget == other.isOverWidget());
124 }
125
126 bool HitTestResult::equalForCacheability(const HitTestResult& other) const 114 bool HitTestResult::equalForCacheability(const HitTestResult& other) const
127 { 115 {
128 return m_hitTestRequest.equalForCacheability(other.m_hitTestRequest) 116 return m_hitTestRequest.equalForCacheability(other.m_hitTestRequest)
129 && m_innerNode == other.innerNode() 117 && m_innerNode == other.innerNode()
130 && m_innerPossiblyPseudoNode == other.innerPossiblyPseudoNode() 118 && m_innerPossiblyPseudoNode == other.innerPossiblyPseudoNode()
131 && m_pointInInnerNodeFrame == other.m_pointInInnerNodeFrame 119 && m_pointInInnerNodeFrame == other.m_pointInInnerNodeFrame
132 && m_localPoint == other.localPoint() 120 && m_localPoint == other.localPoint()
133 && m_innerURLElement == other.URLElement() 121 && m_innerURLElement == other.URLElement()
134 && m_scrollbar == other.scrollbar() 122 && m_scrollbar == other.scrollbar()
135 && m_isOverWidget == other.isOverWidget(); 123 && m_isOverWidget == other.isOverWidget();
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 else if (isHTMLMapElement(m_innerNode)) 523 else if (isHTMLMapElement(m_innerNode))
536 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); 524 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement();
537 525
538 if (!imageMapImageElement) 526 if (!imageMapImageElement)
539 return m_innerNode.get(); 527 return m_innerNode.get();
540 528
541 return imageMapImageElement; 529 return imageMapImageElement;
542 } 530 }
543 531
544 } // namespace blink 532 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/HitTestResult.h ('k') | Source/core/layout/LayoutView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698