From 8855009f3b497b6888b83d2e8b01c8ce05d04edf Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 5 Dec 2001 14:06:34 +0000 Subject: [PATCH] Set the |inherited| bool in all cases when we inherit. Bug 113533, r=dbaron, sr=hyatt git-svn-id: svn://10.0.0.236/trunk@109737 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsRuleNode.cpp | 18 ++++++++++++++---- mozilla/layout/style/nsRuleNode.cpp | 18 ++++++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/mozilla/content/base/src/nsRuleNode.cpp b/mozilla/content/base/src/nsRuleNode.cpp index 4d70370955c..aebf404dd55 100644 --- a/mozilla/content/base/src/nsRuleNode.cpp +++ b/mozilla/content/base/src/nsRuleNode.cpp @@ -2712,6 +2712,7 @@ nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct, const nsCSSStruct& a display->mOverflow = NS_STYLE_OVERFLOW_AUTO; } else if (eCSSUnit_Inherit == displayData.mOverflow.GetUnit()) { + inherited = PR_TRUE; display->mOverflow = parentDisplay->mOverflow; } @@ -3066,6 +3067,7 @@ nsRuleNode::ComputeBackgroundData(nsStyleStruct* aStartStruct, const nsCSSStruct bg->mBackgroundRepeat = colorData.mBackRepeat.GetIntValue(); } else if (eCSSUnit_Inherit == colorData.mBackRepeat.GetUnit()) { + inherited = PR_TRUE; bg->mBackgroundRepeat = parentBG->mBackgroundRepeat; } @@ -3238,23 +3240,31 @@ nsRuleNode::ComputeBorderData(nsStyleStruct* aStartStruct, const nsCSSStruct& aD nsStyleCoord parentCoord; if (SetCoord(marginData.mBorderWidth->mLeft, coord, parentCoord, SETCOORD_LE, aContext, mPresContext, inherited)) border->mBorder.SetLeft(coord); - else if (eCSSUnit_Inherit == marginData.mBorderWidth->mLeft.GetUnit()) + else if (eCSSUnit_Inherit == marginData.mBorderWidth->mLeft.GetUnit()) { + inherited = PR_TRUE; border->mBorder.SetLeft(parentBorder->mBorder.GetLeft(coord)); + } if (SetCoord(marginData.mBorderWidth->mTop, coord, parentCoord, SETCOORD_LE, aContext, mPresContext, inherited)) border->mBorder.SetTop(coord); - else if (eCSSUnit_Inherit == marginData.mBorderWidth->mTop.GetUnit()) + else if (eCSSUnit_Inherit == marginData.mBorderWidth->mTop.GetUnit()) { + inherited = PR_TRUE; border->mBorder.SetTop(parentBorder->mBorder.GetTop(coord)); + } if (SetCoord(marginData.mBorderWidth->mRight, coord, parentCoord, SETCOORD_LE, aContext, mPresContext, inherited)) border->mBorder.SetRight(coord); - else if (eCSSUnit_Inherit == marginData.mBorderWidth->mRight.GetUnit()) + else if (eCSSUnit_Inherit == marginData.mBorderWidth->mRight.GetUnit()) { + inherited = PR_TRUE; border->mBorder.SetRight(parentBorder->mBorder.GetRight(coord)); + } if (SetCoord(marginData.mBorderWidth->mBottom, coord, parentCoord, SETCOORD_LE, aContext, mPresContext, inherited)) border->mBorder.SetBottom(coord); - else if (eCSSUnit_Inherit == marginData.mBorderWidth->mBottom.GetUnit()) + else if (eCSSUnit_Inherit == marginData.mBorderWidth->mBottom.GetUnit()) { + inherited = PR_TRUE; border->mBorder.SetBottom(parentBorder->mBorder.GetBottom(coord)); + } } // border-style: enum, none, inhert diff --git a/mozilla/layout/style/nsRuleNode.cpp b/mozilla/layout/style/nsRuleNode.cpp index 4d70370955c..aebf404dd55 100644 --- a/mozilla/layout/style/nsRuleNode.cpp +++ b/mozilla/layout/style/nsRuleNode.cpp @@ -2712,6 +2712,7 @@ nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct, const nsCSSStruct& a display->mOverflow = NS_STYLE_OVERFLOW_AUTO; } else if (eCSSUnit_Inherit == displayData.mOverflow.GetUnit()) { + inherited = PR_TRUE; display->mOverflow = parentDisplay->mOverflow; } @@ -3066,6 +3067,7 @@ nsRuleNode::ComputeBackgroundData(nsStyleStruct* aStartStruct, const nsCSSStruct bg->mBackgroundRepeat = colorData.mBackRepeat.GetIntValue(); } else if (eCSSUnit_Inherit == colorData.mBackRepeat.GetUnit()) { + inherited = PR_TRUE; bg->mBackgroundRepeat = parentBG->mBackgroundRepeat; } @@ -3238,23 +3240,31 @@ nsRuleNode::ComputeBorderData(nsStyleStruct* aStartStruct, const nsCSSStruct& aD nsStyleCoord parentCoord; if (SetCoord(marginData.mBorderWidth->mLeft, coord, parentCoord, SETCOORD_LE, aContext, mPresContext, inherited)) border->mBorder.SetLeft(coord); - else if (eCSSUnit_Inherit == marginData.mBorderWidth->mLeft.GetUnit()) + else if (eCSSUnit_Inherit == marginData.mBorderWidth->mLeft.GetUnit()) { + inherited = PR_TRUE; border->mBorder.SetLeft(parentBorder->mBorder.GetLeft(coord)); + } if (SetCoord(marginData.mBorderWidth->mTop, coord, parentCoord, SETCOORD_LE, aContext, mPresContext, inherited)) border->mBorder.SetTop(coord); - else if (eCSSUnit_Inherit == marginData.mBorderWidth->mTop.GetUnit()) + else if (eCSSUnit_Inherit == marginData.mBorderWidth->mTop.GetUnit()) { + inherited = PR_TRUE; border->mBorder.SetTop(parentBorder->mBorder.GetTop(coord)); + } if (SetCoord(marginData.mBorderWidth->mRight, coord, parentCoord, SETCOORD_LE, aContext, mPresContext, inherited)) border->mBorder.SetRight(coord); - else if (eCSSUnit_Inherit == marginData.mBorderWidth->mRight.GetUnit()) + else if (eCSSUnit_Inherit == marginData.mBorderWidth->mRight.GetUnit()) { + inherited = PR_TRUE; border->mBorder.SetRight(parentBorder->mBorder.GetRight(coord)); + } if (SetCoord(marginData.mBorderWidth->mBottom, coord, parentCoord, SETCOORD_LE, aContext, mPresContext, inherited)) border->mBorder.SetBottom(coord); - else if (eCSSUnit_Inherit == marginData.mBorderWidth->mBottom.GetUnit()) + else if (eCSSUnit_Inherit == marginData.mBorderWidth->mBottom.GetUnit()) { + inherited = PR_TRUE; border->mBorder.SetBottom(parentBorder->mBorder.GetBottom(coord)); + } } // border-style: enum, none, inhert