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

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

Issue 18686005: Style resolution: Apply animation properties earlier in a separate pass (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
« no previous file with comments | « Source/core/css/CSSPropertyNames.in ('k') | Source/core/css/resolver/StyleResolver.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 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 333
334 void adjustRenderStyle(RenderStyle* styleToAdjust, RenderStyle* parentStyle, Element*); 334 void adjustRenderStyle(RenderStyle* styleToAdjust, RenderStyle* parentStyle, Element*);
335 void adjustGridItemPosition(RenderStyle* styleToAdjust) const; 335 void adjustGridItemPosition(RenderStyle* styleToAdjust) const;
336 336
337 bool fastRejectSelector(const RuleData&) const; 337 bool fastRejectSelector(const RuleData&) const;
338 338
339 void applyMatchedProperties(const MatchResult&, const Element*); 339 void applyMatchedProperties(const MatchResult&, const Element*);
340 340
341 enum StyleApplicationPass { 341 enum StyleApplicationPass {
342 VariableDefinitions, 342 VariableDefinitions,
343 AnimationProperties,
343 HighPriorityProperties, 344 HighPriorityProperties,
344 LowPriorityProperties 345 LowPriorityProperties
345 }; 346 };
346 template <StyleApplicationPass pass> 347 template <StyleApplicationPass pass>
348 static bool isPropertyForPass(CSSPropertyID property)
349 {
dglazkov 2013/07/10 14:43:42 Why is the body of the function in the header file
350 COMPILE_ASSERT(CSSPropertyVariable < firstCSSProperty, CSS_variable_is_b efore_first_property);
351 const CSSPropertyID firstAnimationProperty = CSSPropertyWebkitAnimation;
352 const CSSPropertyID lastAnimationProperty = CSSPropertyTransitionTimingF unction;
353 COMPILE_ASSERT(firstCSSProperty == firstAnimationProperty, CSS_first_ani mation_property_should_be_first_property);
354 const CSSPropertyID firstHighPriorityProperty = CSSPropertyColor;
355 const CSSPropertyID lastHighPriorityProperty = CSSPropertyLineHeight;
356 COMPILE_ASSERT(lastAnimationProperty + 1 == firstHighPriorityProperty, C SS_color_is_first_high_priority_property);
357 COMPILE_ASSERT(CSSPropertyLineHeight == firstHighPriorityProperty + 18, CSS_line_height_is_end_of_high_prioity_property_range);
358 COMPILE_ASSERT(CSSPropertyZoom == lastHighPriorityProperty - 1, CSS_zoom _is_before_line_height);
359 switch (pass) {
360 case VariableDefinitions:
361 return property == CSSPropertyVariable;
362 case AnimationProperties:
363 return property >= firstAnimationProperty && property <= lastAnimati onProperty;
364 case HighPriorityProperties:
365 return property >= firstHighPriorityProperty && property <= lastHigh PriorityProperty;
366 case LowPriorityProperties:
367 return property > lastHighPriorityProperty;
368 }
369 }
370 template <StyleApplicationPass pass>
347 void applyMatchedProperties(const MatchResult&, bool important, int startInd ex, int endIndex, bool inheritedOnly); 371 void applyMatchedProperties(const MatchResult&, bool important, int startInd ex, int endIndex, bool inheritedOnly);
348 template <StyleApplicationPass pass> 372 template <StyleApplicationPass pass>
349 void applyProperties(const StylePropertySet* properties, StyleRule*, bool is Important, bool inheritedOnly, PropertyWhitelistType = PropertyWhitelistNone); 373 void applyProperties(const StylePropertySet* properties, StyleRule*, bool is Important, bool inheritedOnly, PropertyWhitelistType = PropertyWhitelistNone);
350 template <StyleApplicationPass pass> 374 template <StyleApplicationPass pass>
351 void applyAnimatedProperties(const Element* target); 375 void applyAnimatedProperties(const Element* target);
352 void resolveVariables(CSSPropertyID, CSSValue*, Vector<std::pair<CSSProperty ID, String> >& knownExpressions); 376 void resolveVariables(CSSPropertyID, CSSValue*, Vector<std::pair<CSSProperty ID, String> >& knownExpressions);
353 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag e, const String& pageName); 377 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag e, const String& pageName);
354 void matchPageRulesForList(Vector<StyleRulePage*>& matchedRules, const Vecto r<StyleRulePage*>&, bool isLeftPage, bool isFirstPage, const String& pageName); 378 void matchPageRulesForList(Vector<StyleRulePage*>& matchedRules, const Vecto r<StyleRulePage*>&, bool isLeftPage, bool isFirstPage, const String& pageName);
355 Settings* documentSettings() { return m_document->settings(); } 379 Settings* documentSettings() { return m_document->settings(); }
356 380
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 PseudoId ignoreDynamicPseudo = NOPSEUDO; 472 PseudoId ignoreDynamicPseudo = NOPSEUDO;
449 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches) 473 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches)
450 return true; 474 return true;
451 } 475 }
452 return false; 476 return false;
453 } 477 }
454 478
455 } // namespace WebCore 479 } // namespace WebCore
456 480
457 #endif // StyleResolver_h 481 #endif // StyleResolver_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSPropertyNames.in ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698