From cf9d7b729bd4075feb040e55843097380e931569 Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Thu, 24 Jan 2008 01:21:32 +0000 Subject: [PATCH] Fix width of images where max-width < min-width <= width (min-width should win), and other similar problems. b=413361 r+sr=bzbarsky a=schrep git-svn-id: svn://10.0.0.236/trunk@243868 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsHTMLReflowState.h | 17 +++++++++++------ mozilla/layout/reftests/bugs/413361-1-ref.html | 13 +++++++++++++ mozilla/layout/reftests/bugs/413361-1.html | 15 +++++++++++++++ mozilla/layout/reftests/bugs/reftest.list | 1 + 4 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 mozilla/layout/reftests/bugs/413361-1-ref.html create mode 100644 mozilla/layout/reftests/bugs/413361-1.html diff --git a/mozilla/layout/generic/nsHTMLReflowState.h b/mozilla/layout/generic/nsHTMLReflowState.h index 8ff992b2b56..f69a71074a6 100644 --- a/mozilla/layout/generic/nsHTMLReflowState.h +++ b/mozilla/layout/generic/nsHTMLReflowState.h @@ -59,12 +59,17 @@ struct nsStylePadding; struct nsStyleText; struct nsHypotheticalBox; -#define NS_CSS_MINMAX(_value,_min,_max) \ - ((_value) < (_min) \ - ? (_min) \ - : ((_value) > (_max) \ - ? (_max) \ - : (_value))) +template +NumericType +NS_CSS_MINMAX(NumericType aValue, NumericType aMinValue, NumericType aMaxValue) +{ + NumericType result = aValue; + if (aMaxValue < result) + result = aMaxValue; + if (aMinValue > result) + result = aMinValue; + return result; +} /** * Constant used to indicate an unconstrained size. diff --git a/mozilla/layout/reftests/bugs/413361-1-ref.html b/mozilla/layout/reftests/bugs/413361-1-ref.html new file mode 100644 index 00000000000..463d45f2a8a --- /dev/null +++ b/mozilla/layout/reftests/bugs/413361-1-ref.html @@ -0,0 +1,13 @@ + + +testcase + + + + + + diff --git a/mozilla/layout/reftests/bugs/413361-1.html b/mozilla/layout/reftests/bugs/413361-1.html new file mode 100644 index 00000000000..a38daa53da8 --- /dev/null +++ b/mozilla/layout/reftests/bugs/413361-1.html @@ -0,0 +1,15 @@ + + +testcase + + + + + + diff --git a/mozilla/layout/reftests/bugs/reftest.list b/mozilla/layout/reftests/bugs/reftest.list index dcadc1c5d30..160c4c4a769 100644 --- a/mozilla/layout/reftests/bugs/reftest.list +++ b/mozilla/layout/reftests/bugs/reftest.list @@ -662,3 +662,4 @@ random == 403134-1.html 403134-1-ref.html # bug 405377 != 409659-1c.html 409659-1-ref.html == 409659-1d.html 409659-1-ref.html == 411334-1.xml 411334-1-ref.xml +== 413361-1.html 413361-1-ref.html