Bug 586400. Cellpadding changes need to reresolve descendants. r=dbaron

This commit is contained in:
Boris Zbarsky 2010-08-25 14:54:47 -04:00
parent 4e33893936
commit 78e6d2601e
4 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
div.spacer {width:20px; height: 20px;}
table {background-color: lime;}
td {background-color: green;}
</style>
</head>
<body>
<table cellpadding="30px"><tr>
<td> <div class="spacer"></div> </td></tr>
</table>
</body>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
div.spacer {width:20px; height: 20px;}
table {background-color: lime;}
td {background-color: green;}
</style>
<script>
function testIt() {
document.body.offsetWidth;
var table = document.getElementsByTagName("TABLE")[0];
table.setAttribute("cellpadding", "30px");
}
</script>
</head>
<body onload="testIt();">
<table><tr>
<td> <div class="spacer"></div> </td></tr>
</table>
</body>
</html>

View File

@ -1494,3 +1494,4 @@ random-if(d2d) == 555388-1.html 555388-1-ref.html
== 582037-2b.html 582037-2-ref.html
== 584400-dash-length.svg 584400-dash-length-ref.svg
== 585598-2.xhtml 585598-2-ref.xhtml
== 586400-1.html 586400-1-ref.html

View File

@ -316,6 +316,13 @@ nsHTMLStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aData)
// Handle the content style rules.
if (element->IsAttributeMapped(aData->mAttribute)) {
// cellpadding on tables is special and requires reresolving all
// the cells in the table
if (aData->mAttribute == nsGkAtoms::cellpadding &&
element->IsHTML() &&
aData->mContentTag == nsGkAtoms::table) {
return eRestyle_Subtree;
}
return eRestyle_Self;
}