mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1046140 - bail if getSubpropertiesForCSSProperty param is a CSS variable. r=bz
This commit is contained in:
parent
5f8282be5b
commit
6a87478ab4
@ -609,7 +609,8 @@ inDOMUtils::GetSubpropertiesForCSSProperty(const nsAString& aProperty,
|
||||
nsCSSProperty propertyID =
|
||||
nsCSSProps::LookupProperty(aProperty, nsCSSProps::eEnabledForAllContent);
|
||||
|
||||
if (propertyID == eCSSProperty_UNKNOWN) {
|
||||
if (propertyID == eCSSProperty_UNKNOWN ||
|
||||
propertyID == eCSSPropertyExtra_variable) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ support-files = bug856317.css
|
||||
[test_bug856317.html]
|
||||
[test_bug877690.html]
|
||||
[test_bug1006595.html]
|
||||
[test_bug1046140.html]
|
||||
[test_color_to_rgba.html]
|
||||
[test_css_property_is_valid.html]
|
||||
[test_get_all_style_sheets.html]
|
||||
|
34
layout/inspector/tests/test_bug1046140.html
Normal file
34
layout/inspector/tests/test_bug1046140.html
Normal file
@ -0,0 +1,34 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1046140
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1046140</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript">
|
||||
|
||||
var utils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"]
|
||||
.getService(SpecialPowers.Ci.inIDOMUtils);
|
||||
|
||||
try {
|
||||
utils.getSubpropertiesForCSSProperty("--foo");
|
||||
ok(false, "expected an exception");
|
||||
} catch(e) {
|
||||
ok(true, "getSubpropertiesForCSSProperty throws when passed a CSS variable");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1046140">Mozilla Bug 1046140</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user