Bug 827591 - Be more careful changing declarations on page rules. r=dbaron

This commit is contained in:
Brendan Dahl 2013-01-09 10:33:09 -08:00
parent 7cc38ffb42
commit 0dd6b2e3a8
3 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<style>
@page {}
</style>
<script>
function boom()
{
document.styleSheets[0].cssRules[0].style.paddingLeft = "initial";
}
</script>
</head>
<body onload="boom();"></body>
</html>

View File

@ -84,3 +84,4 @@ load 806310-1.html
load 812824.html
load 822842.html
load 822766-1.html
load 827591-1.html

View File

@ -2595,7 +2595,11 @@ void
nsCSSPageRule::ChangeDeclaration(css::Declaration* aDeclaration)
{
mImportantRule = nullptr;
mDeclaration = aDeclaration;
// Be careful to not assign to an nsAutoPtr if we would be assigning
// the thing it already holds.
if (aDeclaration != mDeclaration) {
mDeclaration = aDeclaration;
}
nsCSSStyleSheet* sheet = GetStyleSheet();
if (sheet) {