[Webkit-unassigned] [Bug 45017] CSS MediaQuery tests fail

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 3 11:15:58 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=45017


Simon Fraser (smfr) <simon.fraser at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel at glazman.org




--- Comment #2 from Simon Fraser (smfr) <simon.fraser at apple.com>  2010-09-03 11:15:57 PST ---
There are several issues here.

First, we don't keep around empty CSSRules, so an empty @media rule doesn't show in sheet.cssRules. This patch fixes that:


diff --git a/WebCore/css/CSSMediaRule.cpp b/WebCore/css/CSSMediaRule.cpp
index d1c220b..9f8bb4a 100644
--- a/WebCore/css/CSSMediaRule.cpp
+++ b/WebCore/css/CSSMediaRule.cpp
@@ -40,9 +40,11 @@ CSSMediaRule::~CSSMediaRule()
     if (m_lstMedia)
         m_lstMedia->setParent(0);

-    int length = m_lstCSSRules->length();
-    for (int i = 0; i < length; i++)
-        m_lstCSSRules->item(i)->setParent(0);
+    if (m_lstCSSRules) {
+        int length = m_lstCSSRules->length();
+        for (int i = 0; i < length; i++)
+            m_lstCSSRules->item(i)->setParent(0);
+    }
 }

 unsigned CSSMediaRule::append(CSSRule* rule)
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index e20537a..4b5f620 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -5344,7 +5344,7 @@ CSSRule* CSSParser::createImportRule(const CSSParserString& url, MediaList* medi

 CSSRule* CSSParser::createMediaRule(MediaList* media, CSSRuleList* rules)
 {
-    if (!media || !rules || !m_styleSheet)
+    if (!media || !m_styleSheet)
         return 0;
     m_allowImportRules = m_allowNamespaceDeclarations = m_allowVariablesRules = false;
     RefPtr<CSSMediaRule> rule = CSSMediaRule::create(m_styleSheet, media, rules);


Secondly, the error handling described here:
http://dev.w3.org/csswg/css3-mediaqueries/#error-handling
is not implemented.

Even with that, I don't understand the test. It seems to test that:

@media screen, not(orientation)

(which does not parse)
should result in @media screen, but I don't see how that is correct behavior, from the spec.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list