зеркало из https://github.com/mozilla/gecko-dev.git
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
This commit is contained in:
Родитель
aa74ff0ce7
Коммит
04efaeaee5
|
@ -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 <class NumericType>
|
||||
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.
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
<title>testcase</title>
|
||||
<style>
|
||||
img{
|
||||
width: 252px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<img src="mozilla-banner.gif" alt="">
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
<title>testcase</title>
|
||||
<style>
|
||||
img{
|
||||
max-width: 126px;
|
||||
min-width: 252px;
|
||||
width: 252px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<img src="mozilla-banner.gif" alt="">
|
||||
</body>
|
||||
</html>
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче