OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 union { | 60 union { |
61 struct { | 61 struct { |
62 unsigned linkMatchType : 2; | 62 unsigned linkMatchType : 2; |
63 unsigned whitelistType : 2; | 63 unsigned whitelistType : 2; |
64 }; | 64 }; |
65 // Used to make sure all memory is zero-initialized since we compute the
hash over the bytes of this object. | 65 // Used to make sure all memory is zero-initialized since we compute the
hash over the bytes of this object. |
66 void* possiblyPaddedMember; | 66 void* possiblyPaddedMember; |
67 }; | 67 }; |
68 }; | 68 }; |
69 | 69 |
70 struct MatchResult { | 70 class MatchResult { |
| 71 STACK_ALLOCATED(); |
| 72 public: |
71 MatchResult() : isCacheable(true) { } | 73 MatchResult() : isCacheable(true) { } |
72 Vector<MatchedProperties, 64> matchedProperties; | 74 Vector<MatchedProperties, 64> matchedProperties; |
73 Vector<StyleRule*, 64> matchedRules; | 75 WillBeHeapVector<RawPtrWillBeMember<StyleRule>, 64> matchedRules; |
74 MatchRanges ranges; | 76 MatchRanges ranges; |
75 bool isCacheable; | 77 bool isCacheable; |
76 | 78 |
77 void addMatchedProperties(const StylePropertySet* properties, StyleRule* = 0
, unsigned linkMatchType = SelectorChecker::MatchAll, PropertyWhitelistType = Pr
opertyWhitelistNone); | 79 void addMatchedProperties(const StylePropertySet* properties, StyleRule* = 0
, unsigned linkMatchType = SelectorChecker::MatchAll, PropertyWhitelistType = Pr
opertyWhitelistNone); |
78 }; | 80 }; |
79 | 81 |
80 inline bool operator==(const MatchRanges& a, const MatchRanges& b) | 82 inline bool operator==(const MatchRanges& a, const MatchRanges& b) |
81 { | 83 { |
82 return a.firstUARule == b.firstUARule | 84 return a.firstUARule == b.firstUARule |
83 && a.lastUARule == b.lastUARule | 85 && a.lastUARule == b.lastUARule |
(...skipping 14 matching lines...) Expand all Loading... |
98 } | 100 } |
99 | 101 |
100 inline bool operator!=(const MatchedProperties& a, const MatchedProperties& b) | 102 inline bool operator!=(const MatchedProperties& a, const MatchedProperties& b) |
101 { | 103 { |
102 return !(a == b); | 104 return !(a == b); |
103 } | 105 } |
104 | 106 |
105 } // namespace WebCore | 107 } // namespace WebCore |
106 | 108 |
107 #endif // MatchResult_h | 109 #endif // MatchResult_h |
OLD | NEW |