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

Side by Side Diff: third_party/WebKit/Source/core/css/StylePropertySet.h

Issue 2315923002: Lazy Parse CSS (Closed)
Patch Set: esprehn review Created 4 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 m_isMutable(false), 148 m_isMutable(false),
149 m_arraySize(std::min(immutableArraySize, unsigned(MaxArraySize))) {} 149 m_arraySize(std::min(immutableArraySize, unsigned(MaxArraySize))) {}
150 150
151 unsigned m_cssParserMode : 3; 151 unsigned m_cssParserMode : 3;
152 mutable unsigned m_isMutable : 1; 152 mutable unsigned m_isMutable : 1;
153 unsigned m_arraySize : 28; 153 unsigned m_arraySize : 28;
154 154
155 friend class PropertySetCSSStyleDeclaration; 155 friend class PropertySetCSSStyleDeclaration;
156 }; 156 };
157 157
158 // Used for lazily parsing properties.
159 class CSSLazyPropertyParser
160 : public GarbageCollectedFinalized<CSSLazyPropertyParser> {
161 WTF_MAKE_NONCOPYABLE(CSSLazyPropertyParser);
162
163 public:
164 CSSLazyPropertyParser() {}
165 virtual ~CSSLazyPropertyParser() {}
166 virtual StylePropertySet* parseProperties() = 0;
167 DECLARE_VIRTUAL_TRACE();
168 };
169
158 class CORE_EXPORT ImmutableStylePropertySet : public StylePropertySet { 170 class CORE_EXPORT ImmutableStylePropertySet : public StylePropertySet {
159 public: 171 public:
160 ~ImmutableStylePropertySet(); 172 ~ImmutableStylePropertySet();
161 static ImmutableStylePropertySet* create(const CSSProperty* properties, 173 static ImmutableStylePropertySet* create(const CSSProperty* properties,
162 unsigned count, 174 unsigned count,
163 CSSParserMode); 175 CSSParserMode);
164 176
165 unsigned propertyCount() const { return m_arraySize; } 177 unsigned propertyCount() const { return m_arraySize; }
166 178
167 const Member<const CSSValue>* valueArray() const; 179 const Member<const CSSValue>* valueArray() const;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 template <typename T> 329 template <typename T>
318 inline int StylePropertySet::findPropertyIndex(T property) const { 330 inline int StylePropertySet::findPropertyIndex(T property) const {
319 if (m_isMutable) 331 if (m_isMutable)
320 return toMutableStylePropertySet(this)->findPropertyIndex(property); 332 return toMutableStylePropertySet(this)->findPropertyIndex(property);
321 return toImmutableStylePropertySet(this)->findPropertyIndex(property); 333 return toImmutableStylePropertySet(this)->findPropertyIndex(property);
322 } 334 }
323 335
324 } // namespace blink 336 } // namespace blink
325 337
326 #endif // StylePropertySet_h 338 #endif // StylePropertySet_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/ElementRuleCollector.cpp ('k') | third_party/WebKit/Source/core/css/StylePropertySet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698