Index: third_party/WebKit/Source/core/css/CSSStyleSheet.cpp |
diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp |
index 9c42a7fd73527b5f3baee17b206c8704c0afef3a..ea4afe751587a5f1edde4118522c55f90b56c027 100644 |
--- a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp |
+++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp |
@@ -197,6 +197,16 @@ void CSSStyleSheet::setMediaQueries(MediaQuerySet* mediaQueries) { |
m_mediaCSSOMWrapper->reattach(m_mediaQueries.get()); |
} |
+bool CSSStyleSheet::matchesMediaQueries(const MediaQueryEvaluator& evaluator) { |
+ m_viewportDependentMediaQueryResults.clear(); |
+ m_deviceDependentMediaQueryResults.clear(); |
+ |
+ if (!m_mediaQueries) |
+ return true; |
+ return evaluator.eval(m_mediaQueries, &m_viewportDependentMediaQueryResults, |
+ &m_deviceDependentMediaQueryResults); |
+} |
+ |
unsigned CSSStyleSheet::length() const { |
return m_contents->ruleCount(); |
} |
@@ -424,6 +434,8 @@ void CSSStyleSheet::setText(const String& text) { |
DEFINE_TRACE(CSSStyleSheet) { |
visitor->trace(m_contents); |
visitor->trace(m_mediaQueries); |
+ visitor->trace(m_viewportDependentMediaQueryResults); |
+ visitor->trace(m_deviceDependentMediaQueryResults); |
visitor->trace(m_ownerNode); |
visitor->trace(m_ownerRule); |
visitor->trace(m_mediaCSSOMWrapper); |