| 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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 return parentNode->renderStyle(); | 593 return parentNode->renderStyle(); |
| 594 } | 594 } |
| 595 | 595 |
| 596 void StyleResolver::updateFont(StyleResolverState& state) | 596 void StyleResolver::updateFont(StyleResolverState& state) |
| 597 { | 597 { |
| 598 state.fontBuilder().createFont(document().styleEngine()->fontSelector(), sta
te.parentStyle(), state.style()); | 598 state.fontBuilder().createFont(document().styleEngine()->fontSelector(), sta
te.parentStyle(), state.style()); |
| 599 if (state.fontBuilder().fontSizeHasViewportUnits()) | 599 if (state.fontBuilder().fontSizeHasViewportUnits()) |
| 600 state.style()->setHasViewportUnits(); | 600 state.style()->setHasViewportUnits(); |
| 601 } | 601 } |
| 602 | 602 |
| 603 PassRefPtr<StyleRuleList> StyleResolver::styleRulesForElement(Element* element,
unsigned rulesToInclude) | |
| 604 { | |
| 605 ASSERT(element); | |
| 606 StyleResolverState state(document(), element); | |
| 607 ElementRuleCollector collector(state.elementContext(), state.style()); | |
| 608 collector.setMode(SelectorChecker::CollectingStyleRules); | |
| 609 return collector.matchedStyleRuleList(); | |
| 610 } | |
| 611 | |
| 612 PassRefPtr<CSSRuleList> StyleResolver::pseudoCSSRulesForElement(Element* element
, PseudoId pseudoId, unsigned rulesToInclude) | |
| 613 { | |
| 614 ASSERT(element); | |
| 615 StyleResolverState state(document(), element); | |
| 616 ElementRuleCollector collector(state.elementContext(), state.style()); | |
| 617 collector.setMode(SelectorChecker::CollectingCSSRules); | |
| 618 return collector.matchedCSSRuleList(); | |
| 619 } | |
| 620 | |
| 621 PassRefPtr<CSSRuleList> StyleResolver::cssRulesForElement(Element* element, unsi
gned rulesToInclude) | |
| 622 { | |
| 623 return pseudoCSSRulesForElement(element, NOPSEUDO, rulesToInclude); | |
| 624 } | |
| 625 | |
| 626 // -----------------------------------------------------------------------------
-------- | 603 // -----------------------------------------------------------------------------
-------- |
| 627 // this is mostly boring stuff on how to apply a certain rule to the renderstyle
... | 604 // this is mostly boring stuff on how to apply a certain rule to the renderstyle
... |
| 628 | 605 |
| 629 bool StyleResolver::applyAnimatedProperties(StyleResolverState& state, Element*
animatingElement) | 606 bool StyleResolver::applyAnimatedProperties(StyleResolverState& state, Element*
animatingElement) |
| 630 { | 607 { |
| 631 const Element* element = state.element(); | 608 const Element* element = state.element(); |
| 632 ASSERT(element); | 609 ASSERT(element); |
| 633 | 610 |
| 634 // The animating element may be this element, or its pseudo element. It is | 611 // The animating element may be this element, or its pseudo element. It is |
| 635 // null when calculating the style for a potential pseudo element that has | 612 // null when calculating the style for a potential pseudo element that has |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 bool StyleResolver::mediaQueryAffectedByViewportChange() const | 953 bool StyleResolver::mediaQueryAffectedByViewportChange() const |
| 977 { | 954 { |
| 978 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { | 955 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { |
| 979 if (m_medium->eval(m_viewportDependentMediaQueryResults[i]->expression()
) != m_viewportDependentMediaQueryResults[i]->result()) | 956 if (m_medium->eval(m_viewportDependentMediaQueryResults[i]->expression()
) != m_viewportDependentMediaQueryResults[i]->result()) |
| 980 return true; | 957 return true; |
| 981 } | 958 } |
| 982 return false; | 959 return false; |
| 983 } | 960 } |
| 984 | 961 |
| 985 } // namespace blink | 962 } // namespace blink |
| OLD | NEW |