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

Side by Side Diff: Source/core/css/resolver/MatchResult.h

Issue 1162583002: Use begin/end istead of first/last for rule ranges. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/ElementRuleCollector.cpp ('k') | Source/core/css/resolver/StyleResolver.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) 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MatchedProperties); 58 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MatchedProperties);
59 59
60 namespace blink { 60 namespace blink {
61 61
62 class MatchResult { 62 class MatchResult {
63 STACK_ALLOCATED(); 63 STACK_ALLOCATED();
64 public: 64 public:
65 void addMatchedProperties(const StylePropertySet* properties, unsigned linkM atchType = CSSSelector::MatchAll, PropertyWhitelistType = PropertyWhitelistNone) ; 65 void addMatchedProperties(const StylePropertySet* properties, unsigned linkM atchType = CSSSelector::MatchAll, PropertyWhitelistType = PropertyWhitelistNone) ;
66 66
67 int firstRule() const { return 0; } 67 unsigned begin() const { return 0; }
68 int lastRule() const { return matchedProperties.size() - 1; } 68 unsigned end() const { return matchedProperties.size(); }
69 int firstUARule() const { return lastUARuleIndex == -1 ? -1 : 0; } 69 unsigned beginUA() const { return 0; }
70 int lastUARule() const { return lastUARuleIndex; } 70 unsigned endUA() const { return uaEnd; }
71 int firstAuthorRule() const { return lastUARuleIndex + 1; } 71 unsigned beginAuthor() const { return uaEnd; }
72 int lastAuthorRule() const { return lastRule(); } 72 unsigned endAuthor() const { return matchedProperties.size(); }
73 73
74 WillBeHeapVector<MatchedProperties, 64> matchedProperties; 74 WillBeHeapVector<MatchedProperties, 64> matchedProperties;
75 int lastUARuleIndex = -1; 75 unsigned uaEnd = 0;
76 bool isCacheable = true; 76 bool isCacheable = true;
77 }; 77 };
78 78
79 inline bool operator==(const MatchedProperties& a, const MatchedProperties& b) 79 inline bool operator==(const MatchedProperties& a, const MatchedProperties& b)
80 { 80 {
81 return a.properties == b.properties && a.m_types.linkMatchType == b.m_types. linkMatchType; 81 return a.properties == b.properties && a.m_types.linkMatchType == b.m_types. linkMatchType;
82 } 82 }
83 83
84 inline bool operator!=(const MatchedProperties& a, const MatchedProperties& b) 84 inline bool operator!=(const MatchedProperties& a, const MatchedProperties& b)
85 { 85 {
86 return !(a == b); 86 return !(a == b);
87 } 87 }
88 88
89 } // namespace blink 89 } // namespace blink
90 90
91 #endif // MatchResult_h 91 #endif // MatchResult_h
OLDNEW
« no previous file with comments | « Source/core/css/ElementRuleCollector.cpp ('k') | Source/core/css/resolver/StyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698