https://bugs.webkit.org/show_bug.cgi?id=90459
Reviewed by Andreas Kling.
Source/WebCore:
Create StyleRuleMedia with a non-NULL MediaQuerySet. The respective NULL checks for it were all over the code,
except the copy constructor. Added the check, just in case.
* css/CSSParser.cpp:
(WebCore::CSSParser::createMediaRule):
* css/StyleRule.cpp:
(WebCore::StyleRuleMedia::StyleRuleMedia):
LayoutTests:
* inspector/styles/get-set-stylesheet-text-expected.txt:
* inspector/styles/resources/get-set-stylesheet-text.css:
(@media):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121764
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-07-03 Alexander Pavlov <apavlov@chromium.org>
+
+ [REGRESSION] Crash when copying a StyleRuleMedia with a NULL m_mediaQueries
+ https://bugs.webkit.org/show_bug.cgi?id=90459
+
+ Reviewed by Andreas Kling.
+
+ * inspector/styles/get-set-stylesheet-text-expected.txt:
+ * inspector/styles/resources/get-set-stylesheet-text.css:
+ (@media):
+
2012-07-03 Andrey Kosyakov <caseq@chromium.org>
Web Inspector: display time intervals measured with console.time() and console.timeEnd() in Timeline
color: "badcolor" ! important /* good property with strange value */;
}
+@media {
+ /* @media rule with an empty media list */
+}
+
/* comment before selector */body.main1/* comment after selector */{/* comment */color: #F00BAA;zoo:moo /* not an !important unrecognized property */}/* comment */
body.main2{background: green /* value !important comment */ !important /* no semicolon, very !important */}
color: "badcolor" ! important /* good property with strange value */;
}
+@media {
+ /* @media rule with an empty media list */
+}
+
/* comment before selector */body.main1/* comment after selector */{/* comment */color: #F00BAA;zoo:moo /* not an !important unrecognized property */}/* comment */
body.main2{background: green /* value !important comment */ !important /* no semicolon, very !important */}
+2012-07-03 Alexander Pavlov <apavlov@chromium.org>
+
+ [REGRESSION] Crash when copying a StyleRuleMedia with a NULL m_mediaQueries
+ https://bugs.webkit.org/show_bug.cgi?id=90459
+
+ Reviewed by Andreas Kling.
+
+ Create StyleRuleMedia with a non-NULL MediaQuerySet. The respective NULL checks for it were all over the code,
+ except the copy constructor. Added the check, just in case.
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::createMediaRule):
+ * css/StyleRule.cpp:
+ (WebCore::StyleRuleMedia::StyleRuleMedia):
+
2012-07-03 Andrey Kosyakov <caseq@chromium.org>
Web Inspector: display time intervals measured with console.time() and console.timeEnd() in Timeline
m_allowImportRules = m_allowNamespaceDeclarations = false;
RefPtr<StyleRuleMedia> rule;
if (rules)
- rule = StyleRuleMedia::create(media, *rules);
+ rule = StyleRuleMedia::create(media ? media : MediaQuerySet::create(), *rules);
else {
RuleList emptyRules;
- rule = StyleRuleMedia::create(media, emptyRules);
+ rule = StyleRuleMedia::create(media ? media : MediaQuerySet::create(), emptyRules);
}
StyleRuleMedia* result = rule.get();
m_parsedRules.append(rule.release());
StyleRuleMedia::StyleRuleMedia(const StyleRuleMedia& o)
: StyleRuleBlock(o)
- , m_mediaQueries(o.m_mediaQueries->copy())
{
+ if (o.m_mediaQueries)
+ m_mediaQueries = o.m_mediaQueries->copy();
}
StyleRuleRegion::StyleRuleRegion(Vector<OwnPtr<CSSParserSelector> >* selectors, Vector<RefPtr<StyleRuleBase> >& adoptRules)