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

Side by Side Diff: Source/core/style/ComputedStyle.cpp

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: with missing files 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. 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 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 return empty; 1235 return empty;
1236 } 1236 }
1237 if (inherited_flags.m_textUnderline) { 1237 if (inherited_flags.m_textUnderline) {
1238 DEFINE_STATIC_LOCAL(Vector<AppliedTextDecoration>, underline, (1, Applie dTextDecoration(TextDecorationUnderline))); 1238 DEFINE_STATIC_LOCAL(Vector<AppliedTextDecoration>, underline, (1, Applie dTextDecoration(TextDecorationUnderline)));
1239 return underline; 1239 return underline;
1240 } 1240 }
1241 1241
1242 return rareInheritedData->appliedTextDecorations->vector(); 1242 return rareInheritedData->appliedTextDecorations->vector();
1243 } 1243 }
1244 1244
1245 void ComputedStyle::createVariables()
1246 {
1247 RefPtr<StyleVariableData>& variables = rareInheritedData.access()->variables ;
1248 if (!variables)
1249 variables = StyleVariableData::create();
1250 }
1251
1252 StyleVariableData* ComputedStyle::variables() const
1253 {
1254 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
1255 return rareInheritedData->variables.get();
1256 }
1257
1258 void ComputedStyle::setVariables(PassRefPtr<StyleVariableData> variableData)
1259 {
1260 rareInheritedData.access()->variables = variableData;
1261 }
1262
1245 float ComputedStyle::wordSpacing() const { return fontDescription().wordSpacing( ); } 1263 float ComputedStyle::wordSpacing() const { return fontDescription().wordSpacing( ); }
1246 float ComputedStyle::letterSpacing() const { return fontDescription().letterSpac ing(); } 1264 float ComputedStyle::letterSpacing() const { return fontDescription().letterSpac ing(); }
1247 1265
1248 bool ComputedStyle::setFontDescription(const FontDescription& v) 1266 bool ComputedStyle::setFontDescription(const FontDescription& v)
1249 { 1267 {
1250 if (inherited->font.fontDescription() != v) { 1268 if (inherited->font.fontDescription() != v) {
1251 inherited.access()->font = Font(v); 1269 inherited.access()->font = Font(v);
1252 return true; 1270 return true;
1253 } 1271 }
1254 return false; 1272 return false;
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 } 1778 }
1761 1779
1762 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) 1780 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other)
1763 { 1781 {
1764 setEmptyState(other.emptyState()); 1782 setEmptyState(other.emptyState());
1765 if (other.hasExplicitlyInheritedProperties()) 1783 if (other.hasExplicitlyInheritedProperties())
1766 setHasExplicitlyInheritedProperties(); 1784 setHasExplicitlyInheritedProperties();
1767 } 1785 }
1768 1786
1769 } // namespace blink 1787 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698