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. |
| 4 * All rights reserved. |
4 * Copyright (C) 2013 Google Inc. All rights reserved. | 5 * Copyright (C) 2013 Google Inc. All rights reserved. |
5 * | 6 * |
6 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
10 * | 11 * |
11 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
(...skipping 28 matching lines...) Expand all Loading... |
42 | 43 |
43 DECLARE_TRACE(); | 44 DECLARE_TRACE(); |
44 | 45 |
45 Member<StylePropertySet> properties; | 46 Member<StylePropertySet> properties; |
46 | 47 |
47 union { | 48 union { |
48 struct { | 49 struct { |
49 unsigned linkMatchType : 2; | 50 unsigned linkMatchType : 2; |
50 unsigned whitelistType : 2; | 51 unsigned whitelistType : 2; |
51 } m_types; | 52 } m_types; |
52 // Used to make sure all memory is zero-initialized since we compute the has
h over the bytes of this object. | 53 // Used to make sure all memory is zero-initialized since we compute the |
| 54 // hash over the bytes of this object. |
53 void* possiblyPaddedMember; | 55 void* possiblyPaddedMember; |
54 }; | 56 }; |
55 }; | 57 }; |
56 | 58 |
57 } // namespace blink | 59 } // namespace blink |
58 | 60 |
59 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MatchedProperties); | 61 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MatchedProperties); |
60 | 62 |
61 namespace blink { | 63 namespace blink { |
62 | 64 |
63 using MatchedPropertiesVector = HeapVector<MatchedProperties, 64>; | 65 using MatchedPropertiesVector = HeapVector<MatchedProperties, 64>; |
64 | 66 |
65 // MatchedPropertiesRange is used to represent a subset of the matched propertie
s from | 67 // MatchedPropertiesRange is used to represent a subset of the matched |
66 // a given origin, for instance UA rules, author rules, or a shadow tree scope.
This is | 68 // properties from a given origin, for instance UA rules, author rules, or a |
67 // needed because rules from different origins are applied in the opposite order
for | 69 // shadow tree scope. This is needed because rules from different origins are |
68 // !important rules, yet in the same order as for normal rules within the same o
rigin. | 70 // applied in the opposite order for !important rules, yet in the same order as |
| 71 // for normal rules within the same origin. |
69 | 72 |
70 class MatchedPropertiesRange { | 73 class MatchedPropertiesRange { |
71 public: | 74 public: |
72 MatchedPropertiesRange(MatchedPropertiesVector::const_iterator begin, | 75 MatchedPropertiesRange(MatchedPropertiesVector::const_iterator begin, |
73 MatchedPropertiesVector::const_iterator end) | 76 MatchedPropertiesVector::const_iterator end) |
74 : m_begin(begin), m_end(end) {} | 77 : m_begin(begin), m_end(end) {} |
75 | 78 |
76 MatchedPropertiesVector::const_iterator begin() const { return m_begin; } | 79 MatchedPropertiesVector::const_iterator begin() const { return m_begin; } |
77 MatchedPropertiesVector::const_iterator end() const { return m_end; } | 80 MatchedPropertiesVector::const_iterator end() const { return m_end; } |
78 | 81 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 a.m_types.linkMatchType == b.m_types.linkMatchType; | 189 a.m_types.linkMatchType == b.m_types.linkMatchType; |
187 } | 190 } |
188 | 191 |
189 inline bool operator!=(const MatchedProperties& a, const MatchedProperties& b) { | 192 inline bool operator!=(const MatchedProperties& a, const MatchedProperties& b) { |
190 return !(a == b); | 193 return !(a == b); |
191 } | 194 } |
192 | 195 |
193 } // namespace blink | 196 } // namespace blink |
194 | 197 |
195 #endif // MatchResult_h | 198 #endif // MatchResult_h |
OLD | NEW |