From 0e1ade33850cae2ed7a7cc2a93db6907a6f83f5f Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Sun, 24 Feb 2008 18:29:11 +0000 Subject: [PATCH] Fix regression handling auto margins on absolutely positioned elements. b=419060 r+sr=roc a=blocking1.9+ git-svn-id: svn://10.0.0.236/trunk@246417 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsHTMLReflowState.cpp | 4 +- .../reftests/box-properties/reftest.list | 4 +- mozilla/layout/reftests/bugs/419060-ref.html | 34 +++++++++++++++++ mozilla/layout/reftests/bugs/419060.html | 38 +++++++++++++++++++ mozilla/layout/reftests/bugs/reftest.list | 1 + 5 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 mozilla/layout/reftests/bugs/419060-ref.html create mode 100644 mozilla/layout/reftests/bugs/419060.html diff --git a/mozilla/layout/generic/nsHTMLReflowState.cpp b/mozilla/layout/generic/nsHTMLReflowState.cpp index 8bb882f1577..b8f8efe1656 100644 --- a/mozilla/layout/generic/nsHTMLReflowState.cpp +++ b/mozilla/layout/generic/nsHTMLReflowState.cpp @@ -1276,11 +1276,11 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsPresContext* aPresContext, mComputedMargin.right = availMarginSpace - mComputedMargin.left; } else { // Just 'margin-left' is 'auto' - mComputedMargin.left = availMarginSpace - mComputedMargin.right; + mComputedMargin.left = availMarginSpace; } } else { // Just 'margin-right' is 'auto' - mComputedMargin.right = availMarginSpace - mComputedMargin.left; + mComputedMargin.right = availMarginSpace; } } diff --git a/mozilla/layout/reftests/box-properties/reftest.list b/mozilla/layout/reftests/box-properties/reftest.list index 49558c6eb4b..baa5e2075ca 100644 --- a/mozilla/layout/reftests/box-properties/reftest.list +++ b/mozilla/layout/reftests/box-properties/reftest.list @@ -16,5 +16,5 @@ == box-sizing-2.html box-sizing-2-ref.html == box-sizing-3.html box-sizing-1-ref.html == box-sizing-4.html box-sizing-4-ref.html -fails == abspos-non-replaced-width-offset-margin.html abspos-non-replaced-width-offset-margin-ref.html # bug 419060, bug 419072 -fails fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == abspos-replaced-width-offset-margin.html abspos-replaced-width-offset-margin-ref.html # bug 419060, bug 419072, bug 371316 or other image scaling issue +fails == abspos-non-replaced-width-offset-margin.html abspos-non-replaced-width-offset-margin-ref.html # bug 419072 +fails == abspos-replaced-width-offset-margin.html abspos-replaced-width-offset-margin-ref.html # bug 419072 diff --git a/mozilla/layout/reftests/bugs/419060-ref.html b/mozilla/layout/reftests/bugs/419060-ref.html new file mode 100644 index 00000000000..a18534ddad5 --- /dev/null +++ b/mozilla/layout/reftests/bugs/419060-ref.html @@ -0,0 +1,34 @@ + + + + Absolute positioning margin:auto regression + + + + + + +
+This div should be centered within its container: +
+
+ + + diff --git a/mozilla/layout/reftests/bugs/419060.html b/mozilla/layout/reftests/bugs/419060.html new file mode 100644 index 00000000000..8a339d09dd0 --- /dev/null +++ b/mozilla/layout/reftests/bugs/419060.html @@ -0,0 +1,38 @@ + + + + Absolute positioning margin:auto regression + + + + + + +
+This div should be centered within its container: +
+
+ + + diff --git a/mozilla/layout/reftests/bugs/reftest.list b/mozilla/layout/reftests/bugs/reftest.list index 2485551eaa4..30388af7fdc 100644 --- a/mozilla/layout/reftests/bugs/reftest.list +++ b/mozilla/layout/reftests/bugs/reftest.list @@ -733,3 +733,4 @@ random == 403134-1.html 403134-1-ref.html # bug 405377 == 414851-1.html 414851-1-ref.html == 416106-1.xhtml 416106-1-ref.xhtml == 417676.html 417676-ref.html +== 419060.html 419060-ref.html