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

Side by Side Diff: Source/core/css/CSSStyleRule.cpp

Issue 149513011: Pass around CSSSelector by reference instead of pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « Source/core/css/CSSSelectorList.cpp ('k') | Source/core/css/ElementRuleCollector.cpp » ('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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 Apple 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
60 { 60 {
61 if (!m_propertiesCSSOMWrapper) { 61 if (!m_propertiesCSSOMWrapper) {
62 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_styleR ule->mutableProperties(), const_cast<CSSStyleRule*>(this)); 62 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_styleR ule->mutableProperties(), const_cast<CSSStyleRule*>(this));
63 } 63 }
64 return m_propertiesCSSOMWrapper.get(); 64 return m_propertiesCSSOMWrapper.get();
65 } 65 }
66 66
67 String CSSStyleRule::generateSelectorText() const 67 String CSSStyleRule::generateSelectorText() const
68 { 68 {
69 StringBuilder builder; 69 StringBuilder builder;
70 for (const CSSSelector* selector = m_styleRule->selectorList().first(); sele ctor; selector = CSSSelectorList::next(selector)) { 70 for (const CSSSelector* selector = m_styleRule->selectorList().first(); sele ctor; selector = CSSSelectorList::next(*selector)) {
71 if (selector != m_styleRule->selectorList().first()) 71 if (selector != m_styleRule->selectorList().first())
72 builder.append(", "); 72 builder.append(", ");
73 builder.append(selector->selectorText()); 73 builder.append(selector->selectorText());
74 } 74 }
75 return builder.toString(); 75 return builder.toString();
76 } 76 }
77 77
78 String CSSStyleRule::selectorText() const 78 String CSSStyleRule::selectorText() const
79 { 79 {
80 if (hasCachedSelectorText()) { 80 if (hasCachedSelectorText()) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 void CSSStyleRule::reattach(StyleRuleBase* rule) 123 void CSSStyleRule::reattach(StyleRuleBase* rule)
124 { 124 {
125 ASSERT(rule); 125 ASSERT(rule);
126 m_styleRule = toStyleRule(rule); 126 m_styleRule = toStyleRule(rule);
127 if (m_propertiesCSSOMWrapper) 127 if (m_propertiesCSSOMWrapper)
128 m_propertiesCSSOMWrapper->reattach(m_styleRule->mutableProperties()); 128 m_propertiesCSSOMWrapper->reattach(m_styleRule->mutableProperties());
129 } 129 }
130 130
131 } // namespace WebCore 131 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSSelectorList.cpp ('k') | Source/core/css/ElementRuleCollector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698