Remove StyleResolver::State::m_parentNode
[WebKit-https.git] / Source / WebCore / css / StyleMedia.cpp
index 461b9cd..7191dec 100644 (file)
 #include "config.h"
 #include "StyleMedia.h"
 
-#include "CSSStyleSelector.h"
 #include "Document.h"
 #include "Frame.h"
 #include "FrameView.h"
 #include "MediaList.h"
 #include "MediaQueryEvaluator.h"
+#include "StyleResolver.h"
 
 namespace WebCore {
 
@@ -60,11 +60,7 @@ bool StyleMedia::matchMedium(const String& query) const
     if (!documentElement)
         return false;
 
-    CSSStyleSelector* styleSelector = document->styleSelector();
-    if (!styleSelector)
-        return false;
-
-    RefPtr<RenderStyle> rootStyle = styleSelector->styleForElement(documentElement, 0 /*defaultParent*/, false /*allowSharing*/, true /*resolveForRootDefault*/);
+    RefPtr<RenderStyle> rootStyle = document->ensureStyleResolver().styleForElement(documentElement, document->renderStyle(), DisallowStyleSharing, MatchOnlyUserAgentRules);
 
     RefPtr<MediaQuerySet> media = MediaQuerySet::create();
     if (!media->parse(query))