Bug 495274. Fix broken selector cloning. r+sr=dbaron

This commit is contained in:
Boris Zbarsky 2009-05-28 20:41:27 -04:00
parent 254331b604
commit 761090a98f
4 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<style>body { color: green; }</style>
</head>
<body>
This text should be green
</body>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<style>body { color: green; }</style>
<link rel="stylesheet" href='data:text/css,body > span { color: red }' type="text/css"/>
<link rel="stylesheet" href='data:text/css,body > span { color: red }' type="text/css"/>
<script>
// Force cloning of the second linked sheet
document.styleSheets[2].cssRules[0];
</script>
</head>
<body>
<div><span>This text should be green</span></div>
</body>
</html>

View File

@ -1242,3 +1242,4 @@ fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") == 488692-1.html 488692-1-ref.html # needs
== 493968-1.html 493968-1-ref.html
== 494667-1.html 494667-1-ref.html
== 494667-2.html 494667-2-ref.html
== 495274-1.html 495274-1-ref.html

View File

@ -280,6 +280,7 @@ nsCSSSelector::Clone(PRBool aDeepNext, PRBool aDeepNegations) const
result->mNameSpace = mNameSpace;
result->mTag = mTag;
result->mOperator = mOperator;
NS_IF_CLONE(mIDList);
NS_IF_CLONE(mClassList);