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

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

Issue 20061003: Move isValid/isCurrentColor from Color to StyleColor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 bool isInitial = value->isInitialValue() || (!state.parentNode() && value->i sInheritedValue()); 1378 bool isInitial = value->isInitialValue() || (!state.parentNode() && value->i sInheritedValue());
1379 1379
1380 ASSERT(!isInherit || !isInitial); // isInherit -> !isInitial && isInitial -> !isInherit 1380 ASSERT(!isInherit || !isInitial); // isInherit -> !isInitial && isInitial -> !isInherit
1381 ASSERT(!isInherit || (state.parentNode() && state.parentStyle())); // isInhe rit -> (state.parentNode() && state.parentStyle()) 1381 ASSERT(!isInherit || (state.parentNode() && state.parentStyle())); // isInhe rit -> (state.parentNode() && state.parentStyle())
1382 1382
1383 if (!state.applyPropertyToRegularStyle() && (!state.applyPropertyToVisitedLi nkStyle() || !isValidVisitedLinkProperty(id))) { 1383 if (!state.applyPropertyToRegularStyle() && (!state.applyPropertyToVisitedLi nkStyle() || !isValidVisitedLinkProperty(id))) {
1384 // Limit the properties that can be applied to only the ones honored by :visited. 1384 // Limit the properties that can be applied to only the ones honored by :visited.
1385 return; 1385 return;
1386 } 1386 }
1387 1387
1388 CSSPrimitiveValue* primitiveValue = value->isPrimitiveValue() ? toCSSPrimiti veValue(value) : 0;
1389 if (primitiveValue && primitiveValue->getValueID() == CSSValueCurrentcolor)
1390 state.style()->setHasCurrentColor();
1391
1392 if (isInherit && !state.parentStyle()->hasExplicitlyInheritedProperties() && !CSSProperty::isInheritedProperty(id)) 1388 if (isInherit && !state.parentStyle()->hasExplicitlyInheritedProperties() && !CSSProperty::isInheritedProperty(id))
1393 state.parentStyle()->setHasExplicitlyInheritedProperties(); 1389 state.parentStyle()->setHasExplicitlyInheritedProperties();
1394 1390
1395 if (id == CSSPropertyVariable) { 1391 if (id == CSSPropertyVariable) {
1396 ASSERT_WITH_SECURITY_IMPLICATION(value->isVariableValue()); 1392 ASSERT_WITH_SECURITY_IMPLICATION(value->isVariableValue());
1397 CSSVariableValue* variable = toCSSVariableValue(value); 1393 CSSVariableValue* variable = toCSSVariableValue(value);
1398 ASSERT(!variable->name().isEmpty()); 1394 ASSERT(!variable->name().isEmpty());
1399 ASSERT(!variable->value().isEmpty()); 1395 ASSERT(!variable->value().isEmpty());
1400 state.style()->setVariable(variable->name(), variable->value()); 1396 state.style()->setVariable(variable->name(), variable->value());
1401 return; 1397 return;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 fprintf(stderr, "This recalc style:\n"); 1440 fprintf(stderr, "This recalc style:\n");
1445 printStyleStats(m_searches, m_elementsEligibleForSharing, m_stylesShared, m_ searchFoundSiblingForSharing, m_searchesMissedSharing); 1441 printStyleStats(m_searches, m_elementsEligibleForSharing, m_stylesShared, m_ searchFoundSiblingForSharing, m_searchesMissedSharing);
1446 1442
1447 fprintf(stderr, "Total:\n"); 1443 fprintf(stderr, "Total:\n");
1448 printStyleStats(m_totalSearches, m_totalElementsEligibleForSharing, m_totalS tylesShared, m_totalSearchFoundSiblingForSharing, m_totalSearchesMissedSharing); 1444 printStyleStats(m_totalSearches, m_totalElementsEligibleForSharing, m_totalS tylesShared, m_totalSearchFoundSiblingForSharing, m_totalSearchesMissedSharing);
1449 fprintf(stderr, "----------------------------------------------------------- ---------------------\n"); 1445 fprintf(stderr, "----------------------------------------------------------- ---------------------\n");
1450 } 1446 }
1451 #endif 1447 #endif
1452 1448
1453 } // namespace WebCore 1449 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698