From 39c21c098ab0df4efa637a59da5b1f39472768b3 Mon Sep 17 00:00:00 2001 From: "dbaron@dbaron.org" Date: Thu, 10 May 2007 22:58:34 -0700 Subject: [PATCH] Don't put null coords in nsStyleCoords when they have the same meaning as some other coord type. b=379741 r+sr=bzbarsky --- layout/style/nsStyleStruct.cpp | 11 +++++-- layout/style/test/Makefile.in | 1 + layout/style/test/test_bug379741.html | 46 +++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 layout/style/test/test_bug379741.html diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 624ea167f49e..be08d3d2d773 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -222,7 +222,10 @@ static nscoord CalcCoord(const nsStyleCoord& aCoord, } nsStyleMargin::nsStyleMargin() { - mMargin.Reset(); + nsStyleCoord zero(0); + NS_FOR_CSS_SIDES(side) { + mMargin.Set(side, zero); + } mHasCachedMargin = PR_FALSE; } @@ -277,7 +280,10 @@ nsChangeHint nsStyleMargin::MaxDifference() #endif nsStylePadding::nsStylePadding() { - mPadding.Reset(); + nsStyleCoord zero(0); + NS_FOR_CSS_SIDES(side) { + mPadding.Set(side, zero); + } mHasCachedPadding = PR_FALSE; } @@ -1301,6 +1307,7 @@ nsStyleContent::nsStyleContent(void) mResetCount(0), mResets(nsnull) { + mMarkerOffset.SetAutoValue(); } nsStyleContent::~nsStyleContent(void) diff --git a/layout/style/test/Makefile.in b/layout/style/test/Makefile.in index a2a05e1a6bcd..9df15410120d 100644 --- a/layout/style/test/Makefile.in +++ b/layout/style/test/Makefile.in @@ -73,6 +73,7 @@ _TEST_FILES = test_bug221428.html \ test_bug372770.html \ test_bug373293.html \ test_bug379440.html \ + test_bug379741.html \ test_inherit_storage.html \ test_inherit_computation.html \ test_initial_storage.html \ diff --git a/layout/style/test/test_bug379741.html b/layout/style/test/test_bug379741.html new file mode 100644 index 000000000000..d86ee6eb572e --- /dev/null +++ b/layout/style/test/test_bug379741.html @@ -0,0 +1,46 @@ + + + + + Test for Bug 379741 + + + + + +Mozilla Bug 379741 + +
+
+
+ + +