Bug 765590 - CSSNameSpaceRule.type should be 10, not 0. r=dbaron

This commit is contained in:
Jignesh Kakadiya 2012-06-21 12:58:19 -07:00
parent a543ac8b3f
commit b2ead13822
4 changed files with 24 additions and 2 deletions

View File

@ -26,6 +26,7 @@ interface nsIDOMCSSRule : nsISupports
const unsigned short PAGE_RULE = 6;
const unsigned short MOZ_KEYFRAMES_RULE = 7;
const unsigned short MOZ_KEYFRAME_RULE = 8;
const unsigned short NAMESPACE_RULE = 10;
readonly attribute unsigned short type;
attribute DOMString cssText;

View File

@ -1197,8 +1197,7 @@ NameSpaceRule::Clone() const
NS_IMETHODIMP
NameSpaceRule::GetType(PRUint16* aType)
{
// XXX What should really happen here?
*aType = nsIDOMCSSRule::UNKNOWN_RULE;
*aType = nsIDOMCSSRule::NAMESPACE_RULE;
return NS_OK;
}

View File

@ -102,6 +102,7 @@ _TEST_FILES = test_acid3_test46.html \
file_bug645998-1.css \
file_bug645998-2.css \
test_bug716226.html \
test_bug765590.html \
test_cascade.html \
test_ch_ex_no_infloops.html \
test_compute_data_with_start_struct.html \

View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=765590
-->
<head>
<title>Test for Bug 765590</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style>
@namespace svg "http://www.w3.org/2000/svg";
</style>
</head>
<body>
<script>
var styleElement = document.getElementsByTagName("style")[0]
var rule = styleElement.sheet.cssRules[0];
is(rule.type, 10, "rule type should be equal 10")
is(CSSRule.NAMESPACE_RULE, 10, "NAMESPACE_RULE should be equal to 10")
</script>
</body>