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

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

Issue 21625003: StyleBuilder should not know about StyleResolver. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 * 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 LowPriorityProperties 297 LowPriorityProperties
298 }; 298 };
299 template <StyleResolver::StyleApplicationPass pass> 299 template <StyleResolver::StyleApplicationPass pass>
300 static inline bool isPropertyForPass(CSSPropertyID); 300 static inline bool isPropertyForPass(CSSPropertyID);
301 template <StyleApplicationPass pass> 301 template <StyleApplicationPass pass>
302 void applyMatchedProperties(StyleResolverState&, const MatchResult&, bool im portant, int startIndex, int endIndex, bool inheritedOnly); 302 void applyMatchedProperties(StyleResolverState&, const MatchResult&, bool im portant, int startIndex, int endIndex, bool inheritedOnly);
303 template <StyleApplicationPass pass> 303 template <StyleApplicationPass pass>
304 void applyProperties(StyleResolverState&, const StylePropertySet* properties , StyleRule*, bool isImportant, bool inheritedOnly, PropertyWhitelistType = Prop ertyWhitelistNone); 304 void applyProperties(StyleResolverState&, const StylePropertySet* properties , StyleRule*, bool isImportant, bool inheritedOnly, PropertyWhitelistType = Prop ertyWhitelistNone);
305 template <StyleApplicationPass pass> 305 template <StyleApplicationPass pass>
306 void applyAnimatedProperties(StyleResolverState&, const Element*, const Docu mentTimeline*); 306 void applyAnimatedProperties(StyleResolverState&, const Element*, const Docu mentTimeline*);
307 void resolveVariables(StyleResolverState&, CSSPropertyID, CSSValue*, Vector< std::pair<CSSPropertyID, String> >& knownExpressions);
308 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag e, const String& pageName); 307 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag e, const String& pageName);
309 void matchPageRulesForList(Vector<StyleRulePage*>& matchedRules, const Vecto r<StyleRulePage*>&, bool isLeftPage, bool isFirstPage, const String& pageName); 308 void matchPageRulesForList(Vector<StyleRulePage*>& matchedRules, const Vecto r<StyleRulePage*>&, bool isLeftPage, bool isFirstPage, const String& pageName);
310 void collectViewportRules(); 309 void collectViewportRules();
311 Settings* documentSettings() { return m_document->settings(); } 310 Settings* documentSettings() { return m_document->settings(); }
312 311
313 bool isLeftPage(int pageIndex) const; 312 bool isLeftPage(int pageIndex) const;
314 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); } 313 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); }
315 bool isFirstPage(int pageIndex) const; 314 bool isFirstPage(int pageIndex) const;
316 String pageName(int pageIndex) const; 315 String pageName(int pageIndex) const;
317 316
318 DocumentRuleSets m_ruleSets; 317 DocumentRuleSets m_ruleSets;
319 318
320 // FIXME: This likely belongs on RuleSet. 319 // FIXME: This likely belongs on RuleSet.
321 typedef HashMap<StringImpl*, RefPtr<StyleRuleKeyframes> > KeyframesRuleMap; 320 typedef HashMap<StringImpl*, RefPtr<StyleRuleKeyframes> > KeyframesRuleMap;
322 KeyframesRuleMap m_keyframesRuleMap; 321 KeyframesRuleMap m_keyframesRuleMap;
323 322
324 static RenderStyle* s_styleNotYetAvailable; 323 static RenderStyle* s_styleNotYetAvailable;
325 324
326 void cacheBorderAndBackground(); 325 void cacheBorderAndBackground();
327 326
328 void applyProperty(StyleResolverState&, CSSPropertyID, CSSValue*);
329
330 MatchedPropertiesCache m_matchedPropertiesCache; 327 MatchedPropertiesCache m_matchedPropertiesCache;
331 328
332 OwnPtr<MediaQueryEvaluator> m_medium; 329 OwnPtr<MediaQueryEvaluator> m_medium;
333 RefPtr<RenderStyle> m_rootDefaultStyle; 330 RefPtr<RenderStyle> m_rootDefaultStyle;
334 331
335 Document* m_document; 332 Document* m_document;
336 SelectorFilter m_selectorFilter; 333 SelectorFilter m_selectorFilter;
337 334
338 bool m_matchAuthorAndUserStyles; 335 bool m_matchAuthorAndUserStyles;
339 336
(...skipping 10 matching lines...) Expand all
350 OwnPtr<RuleSet> m_siblingRuleSet; 347 OwnPtr<RuleSet> m_siblingRuleSet;
351 OwnPtr<RuleSet> m_uncommonAttributeRuleSet; 348 OwnPtr<RuleSet> m_uncommonAttributeRuleSet;
352 349
353 InspectorCSSOMWrappers m_inspectorCSSOMWrappers; 350 InspectorCSSOMWrappers m_inspectorCSSOMWrappers;
354 351
355 StyleResourceLoader m_styleResourceLoader; 352 StyleResourceLoader m_styleResourceLoader;
356 353
357 #ifdef STYLE_STATS 354 #ifdef STYLE_STATS
358 static StyleSharingStats m_styleSharingStats; 355 static StyleSharingStats m_styleSharingStats;
359 #endif 356 #endif
360
361 friend void StyleBuilder::oldApplyProperty(CSSPropertyID, StyleResolver*, St yleResolverState&, CSSValue*, bool isInitial, bool isInherit);
362
363 }; 357 };
364 358
365 inline bool checkRegionSelector(const CSSSelector* regionSelector, Element* regi onElement) 359 inline bool checkRegionSelector(const CSSSelector* regionSelector, Element* regi onElement)
366 { 360 {
367 if (!regionSelector || !regionElement) 361 if (!regionSelector || !regionElement)
368 return false; 362 return false;
369 363
370 SelectorChecker selectorChecker(regionElement->document(), SelectorChecker:: QueryingRules); 364 SelectorChecker selectorChecker(regionElement->document(), SelectorChecker:: QueryingRules);
371 for (const CSSSelector* s = regionSelector; s; s = CSSSelectorList::next(s)) { 365 for (const CSSSelector* s = regionSelector; s; s = CSSSelectorList::next(s)) {
372 SelectorChecker::SelectorCheckingContext selectorCheckingContext(s, regi onElement, SelectorChecker::VisitedMatchDisabled); 366 SelectorChecker::SelectorCheckingContext selectorCheckingContext(s, regi onElement, SelectorChecker::VisitedMatchDisabled);
373 PseudoId ignoreDynamicPseudo = NOPSEUDO; 367 PseudoId ignoreDynamicPseudo = NOPSEUDO;
374 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches) 368 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches)
375 return true; 369 return true;
376 } 370 }
377 return false; 371 return false;
378 } 372 }
379 373
380 } // namespace WebCore 374 } // namespace WebCore
381 375
382 #endif // StyleResolver_h 376 #endif // StyleResolver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698