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

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

Issue 1406993009: Revert "CSS Custom Properties (Variables)" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 * 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 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 return empty; 1262 return empty;
1263 } 1263 }
1264 if (inherited_flags.m_textUnderline) { 1264 if (inherited_flags.m_textUnderline) {
1265 DEFINE_STATIC_LOCAL(Vector<AppliedTextDecoration>, underline, (1, Applie dTextDecoration(TextDecorationUnderline))); 1265 DEFINE_STATIC_LOCAL(Vector<AppliedTextDecoration>, underline, (1, Applie dTextDecoration(TextDecorationUnderline)));
1266 return underline; 1266 return underline;
1267 } 1267 }
1268 1268
1269 return rareInheritedData->appliedTextDecorations->vector(); 1269 return rareInheritedData->appliedTextDecorations->vector();
1270 } 1270 }
1271 1271
1272 StyleVariableData* ComputedStyle::variables() const
1273 {
1274 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
1275 return rareInheritedData->variables.get();
1276 }
1277
1278 void ComputedStyle::setVariable(const AtomicString& name, PassRefPtr<CSSVariable Data> value)
1279 {
1280 RefPtr<StyleVariableData>& variables = rareInheritedData.access()->variables ;
1281 if (!variables)
1282 variables = StyleVariableData::create();
1283 else if (!variables->hasOneRef())
1284 variables = variables->copy();
1285 variables->setVariable(name, value);
1286 }
1287
1288 void ComputedStyle::removeVariable(const AtomicString& name)
1289 {
1290 RefPtr<StyleVariableData>& variables = rareInheritedData.access()->variables ;
1291 if (!variables)
1292 return;
1293 if (!variables->hasOneRef())
1294 variables = variables->copy();
1295 variables->removeVariable(name);
1296 }
1297
1298 float ComputedStyle::wordSpacing() const { return fontDescription().wordSpacing( ); } 1272 float ComputedStyle::wordSpacing() const { return fontDescription().wordSpacing( ); }
1299 float ComputedStyle::letterSpacing() const { return fontDescription().letterSpac ing(); } 1273 float ComputedStyle::letterSpacing() const { return fontDescription().letterSpac ing(); }
1300 1274
1301 bool ComputedStyle::setFontDescription(const FontDescription& v) 1275 bool ComputedStyle::setFontDescription(const FontDescription& v)
1302 { 1276 {
1303 if (inherited->font.fontDescription() != v) { 1277 if (inherited->font.fontDescription() != v) {
1304 inherited.access()->font = Font(v); 1278 inherited.access()->font = Font(v);
1305 return true; 1279 return true;
1306 } 1280 }
1307 return false; 1281 return false;
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1817 } 1791 }
1818 1792
1819 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) 1793 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other)
1820 { 1794 {
1821 setEmptyState(other.emptyState()); 1795 setEmptyState(other.emptyState());
1822 if (other.hasExplicitlyInheritedProperties()) 1796 if (other.hasExplicitlyInheritedProperties())
1823 setHasExplicitlyInheritedProperties(); 1797 setHasExplicitlyInheritedProperties();
1824 } 1798 }
1825 1799
1826 } // namespace blink 1800 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/core/style/StyleRareInheritedData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698