| OLD | NEW |
| 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 25 matching lines...) Expand all Loading... |
| 36 #include "ScrollTypes.h" | 36 #include "ScrollTypes.h" |
| 37 #include "SelectorChecker.h" | 37 #include "SelectorChecker.h" |
| 38 #include "SelectorFilter.h" | 38 #include "SelectorFilter.h" |
| 39 #include "SiblingTraversalStrategies.h" | 39 #include "SiblingTraversalStrategies.h" |
| 40 #include "StyleInheritedData.h" | 40 #include "StyleInheritedData.h" |
| 41 #include "StyleScopeResolver.h" | 41 #include "StyleScopeResolver.h" |
| 42 #include "ViewportStyleResolver.h" | 42 #include "ViewportStyleResolver.h" |
| 43 #if ENABLE(CSS_FILTERS) && ENABLE(SVG) | 43 #if ENABLE(CSS_FILTERS) && ENABLE(SVG) |
| 44 #include "WebKitCSSSVGDocumentValue.h" | 44 #include "WebKitCSSSVGDocumentValue.h" |
| 45 #endif | 45 #endif |
| 46 #if ENABLE(CSS_SHADERS) | |
| 47 #include "CustomFilterConstants.h" | 46 #include "CustomFilterConstants.h" |
| 48 #endif | |
| 49 #include <wtf/HashMap.h> | 47 #include <wtf/HashMap.h> |
| 50 #include <wtf/HashSet.h> | 48 #include <wtf/HashSet.h> |
| 51 #include <wtf/RefPtr.h> | 49 #include <wtf/RefPtr.h> |
| 52 #include <wtf/Vector.h> | 50 #include <wtf/Vector.h> |
| 53 #include <wtf/text/AtomicStringHash.h> | 51 #include <wtf/text/AtomicStringHash.h> |
| 54 #include <wtf/text/StringHash.h> | 52 #include <wtf/text/StringHash.h> |
| 55 | 53 |
| 56 namespace WebCore { | 54 namespace WebCore { |
| 57 | 55 |
| 58 enum ESmartMinimumForFontSize { DoNotUseSmartMinimumForFontSize, UseSmartMinimum
ForFontFize }; | 56 enum ESmartMinimumForFontSize { DoNotUseSmartMinimumForFontSize, UseSmartMinimum
ForFontFize }; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 bool usesSiblingRules() const { return !m_ruleSets.features().siblingRules.i
sEmpty(); } | 302 bool usesSiblingRules() const { return !m_ruleSets.features().siblingRules.i
sEmpty(); } |
| 305 bool usesFirstLineRules() const { return m_ruleSets.features().usesFirstLine
Rules; } | 303 bool usesFirstLineRules() const { return m_ruleSets.features().usesFirstLine
Rules; } |
| 306 bool usesBeforeAfterRules() const { return m_ruleSets.features().usesBeforeA
fterRules; } | 304 bool usesBeforeAfterRules() const { return m_ruleSets.features().usesBeforeA
fterRules; } |
| 307 | 305 |
| 308 static bool createTransformOperations(CSSValue* inValue, RenderStyle* inStyl
e, RenderStyle* rootStyle, TransformOperations& outOperations); | 306 static bool createTransformOperations(CSSValue* inValue, RenderStyle* inStyl
e, RenderStyle* rootStyle, TransformOperations& outOperations); |
| 309 | 307 |
| 310 void invalidateMatchedPropertiesCache(); | 308 void invalidateMatchedPropertiesCache(); |
| 311 | 309 |
| 312 #if ENABLE(CSS_FILTERS) | 310 #if ENABLE(CSS_FILTERS) |
| 313 bool createFilterOperations(CSSValue* inValue, RenderStyle* inStyle, RenderS
tyle* rootStyle, FilterOperations& outOperations); | 311 bool createFilterOperations(CSSValue* inValue, RenderStyle* inStyle, RenderS
tyle* rootStyle, FilterOperations& outOperations); |
| 314 #if ENABLE(CSS_SHADERS) | |
| 315 StyleShader* styleShader(CSSValue*); | 312 StyleShader* styleShader(CSSValue*); |
| 316 StyleShader* cachedOrPendingStyleShaderFromValue(WebKitCSSShaderValue*); | 313 StyleShader* cachedOrPendingStyleShaderFromValue(WebKitCSSShaderValue*); |
| 317 bool parseCustomFilterParameterList(CSSValue*, CustomFilterParameterList&); | 314 bool parseCustomFilterParameterList(CSSValue*, CustomFilterParameterList&); |
| 318 PassRefPtr<CustomFilterParameter> parseCustomFilterParameter(const String& n
ame, CSSValue*); | 315 PassRefPtr<CustomFilterParameter> parseCustomFilterParameter(const String& n
ame, CSSValue*); |
| 319 PassRefPtr<CustomFilterParameter> parseCustomFilterArrayParameter(const Stri
ng& name, CSSValueList*); | 316 PassRefPtr<CustomFilterParameter> parseCustomFilterArrayParameter(const Stri
ng& name, CSSValueList*); |
| 320 PassRefPtr<CustomFilterParameter> parseCustomFilterNumberParameter(const Str
ing& name, CSSValueList*); | 317 PassRefPtr<CustomFilterParameter> parseCustomFilterNumberParameter(const Str
ing& name, CSSValueList*); |
| 321 PassRefPtr<CustomFilterParameter> parseCustomFilterTransformParameter(const
String& name, CSSValueList*); | 318 PassRefPtr<CustomFilterParameter> parseCustomFilterTransformParameter(const
String& name, CSSValueList*); |
| 322 PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithAtRuleRefer
enceSyntax(WebKitCSSFilterValue*); | 319 PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithAtRuleRefer
enceSyntax(WebKitCSSFilterValue*); |
| 323 PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithInlineSynta
x(WebKitCSSFilterValue*); | 320 PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithInlineSynta
x(WebKitCSSFilterValue*); |
| 324 PassRefPtr<CustomFilterOperation> createCustomFilterOperation(WebKitCSSFilte
rValue*); | 321 PassRefPtr<CustomFilterOperation> createCustomFilterOperation(WebKitCSSFilte
rValue*); |
| 325 void loadPendingShaders(); | 322 void loadPendingShaders(); |
| 326 PassRefPtr<CustomFilterProgram> lookupCustomFilterProgram(WebKitCSSShaderVal
ue* vertexShader, WebKitCSSShaderValue* fragmentShader, | 323 PassRefPtr<CustomFilterProgram> lookupCustomFilterProgram(WebKitCSSShaderVal
ue* vertexShader, WebKitCSSShaderValue* fragmentShader, |
| 327 CustomFilterProgramType, const CustomFilterProgramMixSettings&, CustomFi
lterMeshType); | 324 CustomFilterProgramType, const CustomFilterProgramMixSettings&, CustomFi
lterMeshType); |
| 328 #endif | |
| 329 #if ENABLE(SVG) | 325 #if ENABLE(SVG) |
| 330 void loadPendingSVGDocuments(); | 326 void loadPendingSVGDocuments(); |
| 331 #endif | 327 #endif |
| 332 #endif // ENABLE(CSS_FILTERS) | 328 #endif // ENABLE(CSS_FILTERS) |
| 333 | 329 |
| 334 void loadPendingResources(); | 330 void loadPendingResources(); |
| 335 | 331 |
| 336 struct RuleRange { | 332 struct RuleRange { |
| 337 RuleRange(int& firstRuleIndex, int& lastRuleIndex): firstRuleIndex(first
RuleIndex), lastRuleIndex(lastRuleIndex) { } | 333 RuleRange(int& firstRuleIndex, int& lastRuleIndex): firstRuleIndex(first
RuleIndex), lastRuleIndex(lastRuleIndex) { } |
| 338 int& firstRuleIndex; | 334 int& firstRuleIndex; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 , m_styledElement(0) | 427 , m_styledElement(0) |
| 432 , m_parentNode(0) | 428 , m_parentNode(0) |
| 433 , m_parentStyle(0) | 429 , m_parentStyle(0) |
| 434 , m_rootElementStyle(0) | 430 , m_rootElementStyle(0) |
| 435 , m_regionForStyling(0) | 431 , m_regionForStyling(0) |
| 436 , m_elementLinkState(NotInsideLink) | 432 , m_elementLinkState(NotInsideLink) |
| 437 , m_distributedToInsertionPoint(false) | 433 , m_distributedToInsertionPoint(false) |
| 438 , m_elementAffectedByClassRules(false) | 434 , m_elementAffectedByClassRules(false) |
| 439 , m_applyPropertyToRegularStyle(true) | 435 , m_applyPropertyToRegularStyle(true) |
| 440 , m_applyPropertyToVisitedLinkStyle(false) | 436 , m_applyPropertyToVisitedLinkStyle(false) |
| 441 #if ENABLE(CSS_SHADERS) | |
| 442 , m_hasPendingShaders(false) | 437 , m_hasPendingShaders(false) |
| 443 #endif | |
| 444 , m_lineHeightValue(0) | 438 , m_lineHeightValue(0) |
| 445 , m_fontDirty(false) | 439 , m_fontDirty(false) |
| 446 , m_hasUAAppearance(false) | 440 , m_hasUAAppearance(false) |
| 447 , m_backgroundData(BackgroundFillLayer) { } | 441 , m_backgroundData(BackgroundFillLayer) { } |
| 448 | 442 |
| 449 public: | 443 public: |
| 450 void initElement(Element*); | 444 void initElement(Element*); |
| 451 void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle =
0, RenderRegion* regionForStyling = 0); | 445 void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle =
0, RenderRegion* regionForStyling = 0); |
| 452 void clear(); | 446 void clear(); |
| 453 | 447 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 470 bool elementAffectedByClassRules() const { return m_elementAffectedByCla
ssRules; } | 464 bool elementAffectedByClassRules() const { return m_elementAffectedByCla
ssRules; } |
| 471 | 465 |
| 472 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToReg
ularStyle = isApply; } | 466 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToReg
ularStyle = isApply; } |
| 473 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyT
oVisitedLinkStyle = isApply; } | 467 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyT
oVisitedLinkStyle = isApply; } |
| 474 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegul
arStyle; } | 468 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegul
arStyle; } |
| 475 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToV
isitedLinkStyle; } | 469 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToV
isitedLinkStyle; } |
| 476 PendingImagePropertyMap& pendingImageProperties() { return m_pendingImag
eProperties; } | 470 PendingImagePropertyMap& pendingImageProperties() { return m_pendingImag
eProperties; } |
| 477 #if ENABLE(CSS_FILTERS) && ENABLE(SVG) | 471 #if ENABLE(CSS_FILTERS) && ENABLE(SVG) |
| 478 PendingSVGDocumentMap& pendingSVGDocuments() { return m_pendingSVGDocume
nts; } | 472 PendingSVGDocumentMap& pendingSVGDocuments() { return m_pendingSVGDocume
nts; } |
| 479 #endif | 473 #endif |
| 480 #if ENABLE(CSS_SHADERS) | |
| 481 void setHasPendingShaders(bool hasPendingShaders) { m_hasPendingShaders
= hasPendingShaders; } | 474 void setHasPendingShaders(bool hasPendingShaders) { m_hasPendingShaders
= hasPendingShaders; } |
| 482 bool hasPendingShaders() const { return m_hasPendingShaders; } | 475 bool hasPendingShaders() const { return m_hasPendingShaders; } |
| 483 #endif | |
| 484 | 476 |
| 485 void setLineHeightValue(CSSValue* value) { m_lineHeightValue = value; } | 477 void setLineHeightValue(CSSValue* value) { m_lineHeightValue = value; } |
| 486 CSSValue* lineHeightValue() { return m_lineHeightValue; } | 478 CSSValue* lineHeightValue() { return m_lineHeightValue; } |
| 487 void setFontDirty(bool isDirty) { m_fontDirty = isDirty; } | 479 void setFontDirty(bool isDirty) { m_fontDirty = isDirty; } |
| 488 bool fontDirty() const { return m_fontDirty; } | 480 bool fontDirty() const { return m_fontDirty; } |
| 489 | 481 |
| 490 void cacheBorderAndBackground(); | 482 void cacheBorderAndBackground(); |
| 491 bool hasUAAppearance() const { return m_hasUAAppearance; } | 483 bool hasUAAppearance() const { return m_hasUAAppearance; } |
| 492 BorderData borderData() const { return m_borderData; } | 484 BorderData borderData() const { return m_borderData; } |
| 493 FillLayer backgroundData() const { return m_backgroundData; } | 485 FillLayer backgroundData() const { return m_backgroundData; } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 520 EInsideLink m_elementLinkState; | 512 EInsideLink m_elementLinkState; |
| 521 | 513 |
| 522 bool m_distributedToInsertionPoint; | 514 bool m_distributedToInsertionPoint; |
| 523 | 515 |
| 524 bool m_elementAffectedByClassRules; | 516 bool m_elementAffectedByClassRules; |
| 525 | 517 |
| 526 bool m_applyPropertyToRegularStyle; | 518 bool m_applyPropertyToRegularStyle; |
| 527 bool m_applyPropertyToVisitedLinkStyle; | 519 bool m_applyPropertyToVisitedLinkStyle; |
| 528 | 520 |
| 529 PendingImagePropertyMap m_pendingImageProperties; | 521 PendingImagePropertyMap m_pendingImageProperties; |
| 530 #if ENABLE(CSS_SHADERS) | |
| 531 bool m_hasPendingShaders; | 522 bool m_hasPendingShaders; |
| 532 #endif | |
| 533 #if ENABLE(CSS_FILTERS) && ENABLE(SVG) | 523 #if ENABLE(CSS_FILTERS) && ENABLE(SVG) |
| 534 PendingSVGDocumentMap m_pendingSVGDocuments; | 524 PendingSVGDocumentMap m_pendingSVGDocuments; |
| 535 #endif | 525 #endif |
| 536 CSSValue* m_lineHeightValue; | 526 CSSValue* m_lineHeightValue; |
| 537 bool m_fontDirty; | 527 bool m_fontDirty; |
| 538 | 528 |
| 539 bool m_hasUAAppearance; | 529 bool m_hasUAAppearance; |
| 540 BorderData m_borderData; | 530 BorderData m_borderData; |
| 541 FillLayer m_backgroundData; | 531 FillLayer m_backgroundData; |
| 542 Color m_backgroundColor; | 532 Color m_backgroundColor; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 #endif | 618 #endif |
| 629 | 619 |
| 630 const StyleBuilder& m_styleBuilder; | 620 const StyleBuilder& m_styleBuilder; |
| 631 | 621 |
| 632 OwnPtr<StyleScopeResolver> m_scopeResolver; | 622 OwnPtr<StyleScopeResolver> m_scopeResolver; |
| 633 CSSToStyleMap m_styleMap; | 623 CSSToStyleMap m_styleMap; |
| 634 InspectorCSSOMWrappers m_inspectorCSSOMWrappers; | 624 InspectorCSSOMWrappers m_inspectorCSSOMWrappers; |
| 635 | 625 |
| 636 State m_state; | 626 State m_state; |
| 637 | 627 |
| 638 #if ENABLE(CSS_SHADERS) | |
| 639 OwnPtr<StyleCustomFilterProgramCache> m_customFilterProgramCache; | 628 OwnPtr<StyleCustomFilterProgramCache> m_customFilterProgramCache; |
| 640 #endif | |
| 641 | 629 |
| 642 friend class StyleBuilder; | 630 friend class StyleBuilder; |
| 643 friend bool operator==(const MatchedProperties&, const MatchedProperties&); | 631 friend bool operator==(const MatchedProperties&, const MatchedProperties&); |
| 644 friend bool operator!=(const MatchedProperties&, const MatchedProperties&); | 632 friend bool operator!=(const MatchedProperties&, const MatchedProperties&); |
| 645 friend bool operator==(const MatchRanges&, const MatchRanges&); | 633 friend bool operator==(const MatchRanges&, const MatchRanges&); |
| 646 friend bool operator!=(const MatchRanges&, const MatchRanges&); | 634 friend bool operator!=(const MatchRanges&, const MatchRanges&); |
| 647 }; | 635 }; |
| 648 | 636 |
| 649 inline bool StyleResolver::hasSelectorForAttribute(const AtomicString &attribute
Name) const | 637 inline bool StyleResolver::hasSelectorForAttribute(const AtomicString &attribute
Name) const |
| 650 { | 638 { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 675 PseudoId ignoreDynamicPseudo = NOPSEUDO; | 663 PseudoId ignoreDynamicPseudo = NOPSEUDO; |
| 676 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo,
DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches) | 664 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo,
DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches) |
| 677 return true; | 665 return true; |
| 678 } | 666 } |
| 679 return false; | 667 return false; |
| 680 } | 668 } |
| 681 | 669 |
| 682 } // namespace WebCore | 670 } // namespace WebCore |
| 683 | 671 |
| 684 #endif // StyleResolver_h | 672 #endif // StyleResolver_h |
| OLD | NEW |