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

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ToT-ed again... Created 5 years, 5 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 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "core/css/CSSValueList.h" 52 #include "core/css/CSSValueList.h"
53 #include "core/css/CSSValuePool.h" 53 #include "core/css/CSSValuePool.h"
54 #include "core/css/ElementRuleCollector.h" 54 #include "core/css/ElementRuleCollector.h"
55 #include "core/css/FontFace.h" 55 #include "core/css/FontFace.h"
56 #include "core/css/MediaQueryEvaluator.h" 56 #include "core/css/MediaQueryEvaluator.h"
57 #include "core/css/PageRuleCollector.h" 57 #include "core/css/PageRuleCollector.h"
58 #include "core/css/StylePropertySet.h" 58 #include "core/css/StylePropertySet.h"
59 #include "core/css/StyleRuleImport.h" 59 #include "core/css/StyleRuleImport.h"
60 #include "core/css/StyleSheetContents.h" 60 #include "core/css/StyleSheetContents.h"
61 #include "core/css/resolver/AnimatedStyleBuilder.h" 61 #include "core/css/resolver/AnimatedStyleBuilder.h"
62 #include "core/css/resolver/CSSVariableResolver.h"
62 #include "core/css/resolver/MatchResult.h" 63 #include "core/css/resolver/MatchResult.h"
63 #include "core/css/resolver/MediaQueryResult.h" 64 #include "core/css/resolver/MediaQueryResult.h"
64 #include "core/css/resolver/ScopedStyleResolver.h" 65 #include "core/css/resolver/ScopedStyleResolver.h"
65 #include "core/css/resolver/SharedStyleFinder.h" 66 #include "core/css/resolver/SharedStyleFinder.h"
66 #include "core/css/resolver/StyleAdjuster.h" 67 #include "core/css/resolver/StyleAdjuster.h"
67 #include "core/css/resolver/StyleResolverParentScope.h" 68 #include "core/css/resolver/StyleResolverParentScope.h"
68 #include "core/css/resolver/StyleResolverState.h" 69 #include "core/css/resolver/StyleResolverState.h"
69 #include "core/css/resolver/StyleResolverStats.h" 70 #include "core/css/resolver/StyleResolverStats.h"
70 #include "core/css/resolver/ViewportStyleResolver.h" 71 #include "core/css/resolver/ViewportStyleResolver.h"
71 #include "core/dom/CSSSelectorWatch.h" 72 #include "core/dom/CSSSelectorWatch.h"
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 // Unfortunately the link status is treated like an inherited proper ty. We need to explicitly restore it. 1293 // Unfortunately the link status is treated like an inherited proper ty. We need to explicitly restore it.
1293 state.style()->setInsideLink(linkStatus); 1294 state.style()->setInsideLink(linkStatus);
1294 1295
1295 updateFont(state); 1296 updateFont(state);
1296 1297
1297 return; 1298 return;
1298 } 1299 }
1299 applyInheritedOnly = true; 1300 applyInheritedOnly = true;
1300 } 1301 }
1301 1302
1303 if (RuntimeEnabledFeatures::cssVariablesEnabled() && document().styleEngine( ).usesVariables()) {
1304 applyMatchedProperties<ResolveVariables>(state, matchResult, false, matc hResult.beginAuthor(), matchResult.endAuthor(), applyInheritedOnly);
1305 applyMatchedProperties<ResolveVariables>(state, matchResult, true, match Result.beginAuthor(), matchResult.endAuthor(), applyInheritedOnly);
1306 // TODO(leviw): stop recalculating every time
1307 CSSVariableResolver::resolveVariableDefinitions(state);
1308 }
1309
1302 // Now we have all of the matched rules in the appropriate order. Walk the r ules and apply 1310 // Now we have all of the matched rules in the appropriate order. Walk the r ules and apply
1303 // high-priority properties first, i.e., those properties that other propert ies depend on. 1311 // high-priority properties first, i.e., those properties that other propert ies depend on.
1304 // The order is (1) high-priority not important, (2) high-priority important , (3) normal not important 1312 // The order is (1) high-priority not important, (2) high-priority important , (3) normal not important
1305 // and (4) normal important. 1313 // and (4) normal important.
1306 applyMatchedProperties<HighPropertyPriority>(state, matchResult, false, matc hResult.begin(), matchResult.end(), applyInheritedOnly); 1314 applyMatchedProperties<HighPropertyPriority>(state, matchResult, false, matc hResult.begin(), matchResult.end(), applyInheritedOnly);
1307 applyMatchedProperties<HighPropertyPriority>(state, matchResult, true, match Result.beginAuthor(), matchResult.endAuthor(), applyInheritedOnly); 1315 applyMatchedProperties<HighPropertyPriority>(state, matchResult, true, match Result.beginAuthor(), matchResult.endAuthor(), applyInheritedOnly);
1308 applyMatchedProperties<HighPropertyPriority>(state, matchResult, true, match Result.beginUA(), matchResult.endUA(), applyInheritedOnly); 1316 applyMatchedProperties<HighPropertyPriority>(state, matchResult, true, match Result.beginUA(), matchResult.endUA(), applyInheritedOnly);
1309 1317
1310 if (UNLIKELY(isSVGForeignObjectElement(element))) { 1318 if (UNLIKELY(isSVGForeignObjectElement(element))) {
1311 // LayoutSVGRoot handles zooming for the whole SVG subtree, so foreignOb ject content should not be scaled again. 1319 // LayoutSVGRoot handles zooming for the whole SVG subtree, so foreignOb ject content should not be scaled again.
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 visitor->trace(m_watchedSelectorsRules); 1442 visitor->trace(m_watchedSelectorsRules);
1435 visitor->trace(m_treeBoundaryCrossingRules); 1443 visitor->trace(m_treeBoundaryCrossingRules);
1436 visitor->trace(m_styleResourceLoader); 1444 visitor->trace(m_styleResourceLoader);
1437 visitor->trace(m_styleSharingLists); 1445 visitor->trace(m_styleSharingLists);
1438 visitor->trace(m_pendingStyleSheets); 1446 visitor->trace(m_pendingStyleSheets);
1439 visitor->trace(m_document); 1447 visitor->trace(m_document);
1440 #endif 1448 #endif
1441 } 1449 }
1442 1450
1443 } // namespace blink 1451 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698