From 5235519ecea48a663bd34b371e93b9daf6e0f8a0 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 9 May 2002 20:05:25 +0000 Subject: [PATCH] make clip:inherit work. Bug 141734, r=dbaron, sr=attinasi --- content/base/src/nsRuleNode.cpp | 3 ++- content/html/style/src/nsComputedDOMStyle.cpp | 4 +--- layout/base/nsStyleConsts.h | 3 +-- layout/base/public/nsStyleConsts.h | 3 +-- layout/style/nsComputedDOMStyle.cpp | 4 +--- layout/style/nsRuleNode.cpp | 3 ++- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/content/base/src/nsRuleNode.cpp b/content/base/src/nsRuleNode.cpp index 134ffa978e7..659eb84a446 100644 --- a/content/base/src/nsRuleNode.cpp +++ b/content/base/src/nsRuleNode.cpp @@ -2823,7 +2823,8 @@ nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct, const nsCSSStruct& a if (nsnull != displayData.mClip) { if (eCSSUnit_Inherit == displayData.mClip->mTop.GetUnit()) { // if one is inherit, they all are inherited = PR_TRUE; - display->mClipFlags = NS_STYLE_CLIP_INHERIT; + display->mClipFlags = parentDisplay->mClipFlags; + display->mClip = parentDisplay->mClip; } else { PRBool fullAuto = PR_TRUE; diff --git a/content/html/style/src/nsComputedDOMStyle.cpp b/content/html/style/src/nsComputedDOMStyle.cpp index 4ef2b28614c..48ad4de0266 100644 --- a/content/html/style/src/nsComputedDOMStyle.cpp +++ b/content/html/style/src/nsComputedDOMStyle.cpp @@ -2661,9 +2661,7 @@ nsComputedDOMStyle::GetClip(nsIFrame *aFrame, NS_STYLE_CLIP_LEFT_AUTO)) { val->SetIdent(NS_LITERAL_STRING("auto")); } - else if (display->mClipFlags == NS_STYLE_CLIP_INHERIT) { - val->SetIdent(NS_LITERAL_STRING("inherit")); - } else { + else { // create the cssvalues for the sides, stick them in the rect object topVal = GetROCSSPrimitiveValue(); rightVal = GetROCSSPrimitiveValue(); diff --git a/layout/base/nsStyleConsts.h b/layout/base/nsStyleConsts.h index 47bcde99799..4fc2a2cb060 100644 --- a/layout/base/nsStyleConsts.h +++ b/layout/base/nsStyleConsts.h @@ -412,8 +412,7 @@ // See nsStylePosition.mClip #define NS_STYLE_CLIP_AUTO 0x00 -#define NS_STYLE_CLIP_INHERIT 0x01 -#define NS_STYLE_CLIP_RECT 0x02 +#define NS_STYLE_CLIP_RECT 0x01 #define NS_STYLE_CLIP_TYPE_MASK 0x0F #define NS_STYLE_CLIP_LEFT_AUTO 0x10 #define NS_STYLE_CLIP_TOP_AUTO 0x20 diff --git a/layout/base/public/nsStyleConsts.h b/layout/base/public/nsStyleConsts.h index 47bcde99799..4fc2a2cb060 100644 --- a/layout/base/public/nsStyleConsts.h +++ b/layout/base/public/nsStyleConsts.h @@ -412,8 +412,7 @@ // See nsStylePosition.mClip #define NS_STYLE_CLIP_AUTO 0x00 -#define NS_STYLE_CLIP_INHERIT 0x01 -#define NS_STYLE_CLIP_RECT 0x02 +#define NS_STYLE_CLIP_RECT 0x01 #define NS_STYLE_CLIP_TYPE_MASK 0x0F #define NS_STYLE_CLIP_LEFT_AUTO 0x10 #define NS_STYLE_CLIP_TOP_AUTO 0x20 diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 4ef2b28614c..48ad4de0266 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -2661,9 +2661,7 @@ nsComputedDOMStyle::GetClip(nsIFrame *aFrame, NS_STYLE_CLIP_LEFT_AUTO)) { val->SetIdent(NS_LITERAL_STRING("auto")); } - else if (display->mClipFlags == NS_STYLE_CLIP_INHERIT) { - val->SetIdent(NS_LITERAL_STRING("inherit")); - } else { + else { // create the cssvalues for the sides, stick them in the rect object topVal = GetROCSSPrimitiveValue(); rightVal = GetROCSSPrimitiveValue(); diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 134ffa978e7..659eb84a446 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -2823,7 +2823,8 @@ nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct, const nsCSSStruct& a if (nsnull != displayData.mClip) { if (eCSSUnit_Inherit == displayData.mClip->mTop.GetUnit()) { // if one is inherit, they all are inherited = PR_TRUE; - display->mClipFlags = NS_STYLE_CLIP_INHERIT; + display->mClipFlags = parentDisplay->mClipFlags; + display->mClip = parentDisplay->mClip; } else { PRBool fullAuto = PR_TRUE;