| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 { | 135 { |
| 136 ASSERT(cssSheet); | 136 ASSERT(cssSheet); |
| 137 if (cssSheet->mediaQueries() && !m_medium->eval(cssSheet->mediaQueries(), &m
_viewportDependentMediaQueryResults)) | 137 if (cssSheet->mediaQueries() && !m_medium->eval(cssSheet->mediaQueries(), &m
_viewportDependentMediaQueryResults)) |
| 138 return; | 138 return; |
| 139 | 139 |
| 140 Node* ownerNode = cssSheet->ownerNode(); | 140 Node* ownerNode = cssSheet->ownerNode(); |
| 141 if (!ownerNode) | 141 if (!ownerNode) |
| 142 return; | 142 return; |
| 143 | 143 |
| 144 TreeScope& treeScope = ownerNode->treeScope(); | 144 TreeScope& treeScope = ownerNode->treeScope(); |
| 145 ScopedStyleResolver& resolver = treeScope.scopedStyleResolver(); | 145 treeScope.scopedStyleResolver().addRulesFromSheet(cssSheet); |
| 146 resolver.addRulesFromSheet(cssSheet); | |
| 147 | |
| 148 RuleSet& ruleSet = cssSheet->contents()->ruleSet(); | |
| 149 | |
| 150 const MediaQueryResultList& list = ruleSet.viewportDependentMediaQueryResult
s(); | |
| 151 for (size_t i = 0; i < list.size(); ++i) | |
| 152 m_viewportDependentMediaQueryResults.append(list[i]); | |
| 153 | 146 |
| 154 // FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets fo
r the moment. | 147 // FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets fo
r the moment. |
| 155 if (ownerNode->isDocumentNode()) { | 148 if (ownerNode->isDocumentNode()) { |
| 156 CSSFontSelector* fontSelector = document().styleEngine()->fontSelector()
; | 149 CSSFontSelector* fontSelector = document().styleEngine()->fontSelector()
; |
| 150 RuleSet& ruleSet = cssSheet->contents()->ruleSet(); |
| 157 const Vector<RawPtr<StyleRuleFontFace> > fontFaceRules = ruleSet.fontFac
eRules(); | 151 const Vector<RawPtr<StyleRuleFontFace> > fontFaceRules = ruleSet.fontFac
eRules(); |
| 158 for (unsigned i = 0; i < fontFaceRules.size(); ++i) { | 152 for (unsigned i = 0; i < fontFaceRules.size(); ++i) { |
| 159 if (RefPtr<FontFace> fontFace = FontFace::create(&document(), fontFa
ceRules[i])) | 153 if (RefPtr<FontFace> fontFace = FontFace::create(&document(), fontFa
ceRules[i])) |
| 160 fontSelector->fontFaceCache()->add(fontSelector, fontFaceRules[i
], fontFace); | 154 fontSelector->fontFaceCache()->add(fontSelector, fontFaceRules[i
], fontFace); |
| 161 } | 155 } |
| 162 if (fontFaceRules.size()) | 156 if (fontFaceRules.size()) |
| 163 invalidateMatchedPropertiesCache(); | 157 invalidateMatchedPropertiesCache(); |
| 164 } | 158 } |
| 165 } | 159 } |
| 166 | 160 |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 bool StyleResolver::mediaQueryAffectedByViewportChange() const | 733 bool StyleResolver::mediaQueryAffectedByViewportChange() const |
| 740 { | 734 { |
| 741 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { | 735 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { |
| 742 if (m_medium->eval(m_viewportDependentMediaQueryResults[i]->expression()
) != m_viewportDependentMediaQueryResults[i]->result()) | 736 if (m_medium->eval(m_viewportDependentMediaQueryResults[i]->expression()
) != m_viewportDependentMediaQueryResults[i]->result()) |
| 743 return true; | 737 return true; |
| 744 } | 738 } |
| 745 return false; | 739 return false; |
| 746 } | 740 } |
| 747 | 741 |
| 748 } // namespace blink | 742 } // namespace blink |
| OLD | NEW |