| OLD | NEW |
| 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 337 |
| 338 m_styleTree.collectFeaturesTo(m_features); | 338 m_styleTree.collectFeaturesTo(m_features); |
| 339 | 339 |
| 340 m_siblingRuleSet = makeRuleSet(m_features.siblingRules); | 340 m_siblingRuleSet = makeRuleSet(m_features.siblingRules); |
| 341 m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules); | 341 m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules); |
| 342 m_needCollectFeatures = false; | 342 m_needCollectFeatures = false; |
| 343 } | 343 } |
| 344 | 344 |
| 345 bool StyleResolver::hasRulesForId(const AtomicString& id) const | 345 bool StyleResolver::hasRulesForId(const AtomicString& id) const |
| 346 { | 346 { |
| 347 return m_features.idsInRules.contains(id.impl()); | 347 return m_features.idsInRules.contains(id); |
| 348 } | 348 } |
| 349 | 349 |
| 350 void StyleResolver::addToStyleSharingList(Element& element) | 350 void StyleResolver::addToStyleSharingList(Element& element) |
| 351 { | 351 { |
| 352 // Never add elements to the style sharing list if we're not in a recalcStyl
e, | 352 // Never add elements to the style sharing list if we're not in a recalcStyl
e, |
| 353 // otherwise we could leave stale pointers in there. | 353 // otherwise we could leave stale pointers in there. |
| 354 if (!document().inStyleRecalc()) | 354 if (!document().inStyleRecalc()) |
| 355 return; | 355 return; |
| 356 INCREMENT_STYLE_STATS_COUNTER(*this, sharedStyleCandidates); | 356 INCREMENT_STYLE_STATS_COUNTER(*this, sharedStyleCandidates); |
| 357 if (m_styleSharingList.size() >= styleSharingListSize) | 357 if (m_styleSharingList.size() >= styleSharingListSize) |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 | 634 |
| 635 static inline void resetDirectionAndWritingModeOnDocument(Document& document) | 635 static inline void resetDirectionAndWritingModeOnDocument(Document& document) |
| 636 { | 636 { |
| 637 document.setDirectionSetOnDocumentElement(false); | 637 document.setDirectionSetOnDocumentElement(false); |
| 638 document.setWritingModeSetOnDocumentElement(false); | 638 document.setWritingModeSetOnDocumentElement(false); |
| 639 } | 639 } |
| 640 | 640 |
| 641 static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAt
trValues, RuleFeatureSet& features) | 641 static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAt
trValues, RuleFeatureSet& features) |
| 642 { | 642 { |
| 643 for (size_t i = 0; i < contentAttrValues.size(); ++i) | 643 for (size_t i = 0; i < contentAttrValues.size(); ++i) |
| 644 features.attrsInRules.add(contentAttrValues[i].impl()); | 644 features.attrsInRules.add(contentAttrValues[i]); |
| 645 } | 645 } |
| 646 | 646 |
| 647 PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS
tyle* defaultParent, StyleSharingBehavior sharingBehavior, | 647 PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS
tyle* defaultParent, StyleSharingBehavior sharingBehavior, |
| 648 RuleMatchingBehavior matchingBehavior, RenderRegion* regionForStyling) | 648 RuleMatchingBehavior matchingBehavior, RenderRegion* regionForStyling) |
| 649 { | 649 { |
| 650 ASSERT(document().frame()); | 650 ASSERT(document().frame()); |
| 651 ASSERT(documentSettings()); | 651 ASSERT(documentSettings()); |
| 652 ASSERT(!hasPendingAuthorStyleSheets()); | 652 ASSERT(!hasPendingAuthorStyleSheets()); |
| 653 ASSERT(!m_needCollectFeatures); | 653 ASSERT(!m_needCollectFeatures); |
| 654 | 654 |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1433 bool StyleResolver::affectedByViewportChange() const | 1433 bool StyleResolver::affectedByViewportChange() const |
| 1434 { | 1434 { |
| 1435 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { | 1435 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { |
| 1436 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio
n) != m_viewportDependentMediaQueryResults[i]->m_result) | 1436 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio
n) != m_viewportDependentMediaQueryResults[i]->m_result) |
| 1437 return true; | 1437 return true; |
| 1438 } | 1438 } |
| 1439 return false; | 1439 return false; |
| 1440 } | 1440 } |
| 1441 | 1441 |
| 1442 } // namespace WebCore | 1442 } // namespace WebCore |
| OLD | NEW |