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

Side by Side Diff: Source/core/css/VariablesIterator.h

Issue 119533003: Clear mutable inline style when it is empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed typo. Created 7 years 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 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 */ 18 */
19 19
20 #ifndef VariablesIterator_h 20 #ifndef VariablesIterator_h
21 #define VariablesIterator_h 21 #define VariablesIterator_h
22 22
23 #include "core/css/CSSVariablesIterator.h" 23 #include "core/css/CSSVariablesIterator.h"
24 #include "wtf/Vector.h" 24 #include "wtf/Vector.h"
25 #include "wtf/text/AtomicString.h" 25 #include "wtf/text/AtomicString.h"
26 26
27 namespace WebCore { 27 namespace WebCore {
28 28
29 class MutableStylePropertySet; 29 class MutableStylePropertySet;
30 class StylePropertySet;
30 31
31 class AbstractVariablesIterator : public CSSVariablesIterator { 32 class AbstractVariablesIterator : public CSSVariablesIterator {
32 public: 33 public:
33 virtual ~AbstractVariablesIterator() { } 34 virtual ~AbstractVariablesIterator() { }
34 35
35 protected: 36 protected:
36 void takeRemainingNames(Vector<AtomicString>& remainingNames) { m_remainingN ames.swap(remainingNames); } 37 void takeRemainingNames(Vector<AtomicString>& remainingNames) { m_remainingN ames.swap(remainingNames); }
37 38
39 virtual void initRemainingNames(const StylePropertySet*);
40
38 private: 41 private:
39 virtual void advance() OVERRIDE; 42 virtual void advance() OVERRIDE;
40 virtual bool atEnd() const OVERRIDE { return m_remainingNames.isEmpty(); } 43 virtual bool atEnd() const OVERRIDE { return m_remainingNames.isEmpty(); }
41 virtual AtomicString name() const OVERRIDE { return m_remainingNames.last(); } 44 virtual AtomicString name() const OVERRIDE { return m_remainingNames.last(); }
42 virtual String value() const OVERRIDE; 45 virtual String value() const OVERRIDE;
43 virtual void addedVariable(const AtomicString& name) OVERRIDE; 46 virtual void addedVariable(const AtomicString& name) OVERRIDE;
44 virtual void removedVariable(const AtomicString& name) OVERRIDE; 47 virtual void removedVariable(const AtomicString& name) OVERRIDE;
45 virtual void clearedVariables() OVERRIDE; 48 virtual void clearedVariables() OVERRIDE;
46 49
47 virtual MutableStylePropertySet* propertySet() const = 0; 50 virtual MutableStylePropertySet* propertySet() const = 0;
48 51
49 Vector<AtomicString> m_remainingNames; 52 Vector<AtomicString> m_remainingNames;
50 Vector<AtomicString> m_newNames; 53 Vector<AtomicString> m_newNames;
51 }; 54 };
52 55
53 class VariablesIterator : public AbstractVariablesIterator { 56 class VariablesIterator : public AbstractVariablesIterator {
54 public: 57 public:
55 static PassRefPtr<VariablesIterator> create(MutableStylePropertySet*); 58 static PassRefPtr<VariablesIterator> create(MutableStylePropertySet*);
56 59
57 private: 60 private:
58 explicit VariablesIterator(MutableStylePropertySet* propertySet) : m_propert ySet(propertySet) { } 61 explicit VariablesIterator(MutableStylePropertySet*);
59
60 virtual MutableStylePropertySet* propertySet() const OVERRIDE { return m_pro pertySet.get(); } 62 virtual MutableStylePropertySet* propertySet() const OVERRIDE { return m_pro pertySet.get(); }
61 63
62 RefPtr<MutableStylePropertySet> m_propertySet; 64 RefPtr<MutableStylePropertySet> m_propertySet;
63 }; 65 };
64 66
65 } // namespace WebCore 67 } // namespace WebCore
66 68
67 #endif // VariablesIterator_h 69 #endif // VariablesIterator_h
OLDNEW
« no previous file with comments | « Source/core/css/PropertySetCSSStyleDeclaration.cpp ('k') | Source/core/css/VariablesIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698