Bug 568825 - Fix -moz-appearance: progresschunk overflows on the bottom on Windows. r=jimm

This commit is contained in:
Mounir Lamouri 2011-05-04 16:55:12 +02:00
parent 0b2e417121
commit 4d7e6898e5
6 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,7 @@
<!DOCTYPE html>
<html>
<body>
<div style="-moz-appearance: progressbar; width:180px; height:6px;">
</div>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<body>
<div style="overflow: hidden; -moz-appearance: progressbar; width:180px; height:40px;">
<div style="-moz-appearance: progresschunk; width:50%; height:100%;">
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<body>
<div style="-moz-appearance: progressbar; width:180px; height:6px;">
<div style="-moz-appearance: progresschunk; width:50%; height:100%;">
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<body>
<div style="-moz-appearance: progressbar; width:180px; height:40px;">
<div style="-moz-appearance: progresschunk; width:50%; height:100%;">
</div>
</div>
</body>
</html>

View File

@ -64,3 +64,6 @@ skip-if(!winWidget) == scroll-thumb-minimum-size-notheme.html scroll-thumb-minim
== border-radius.html border-radius-ref.html
== checkbox-dynamic-1.html checkbox-dynamic-1-ref.html
== progress-overflow.html progress-overflow-ref.html
fails-if(cocoaWidget) != progress-overflow-small.html progress-nobar.html

View File

@ -343,6 +343,13 @@ static CaptionButtonPadding buttonData[3] = {
}
};
/**
* Progress bar related constants.
*/
// PP_CHUNK is overflowing on the bottom for no appearant reasons.
// This is a fix around this issue.
static const PRInt32 kProgressDeterminedXPOverflow = 11;
// Adds "hot" caption button padding to minimum widget size.
static void AddPaddingRect(nsIntSize* aSize, CaptionButton button) {
if (!aSize)
@ -1289,6 +1296,8 @@ RENDER_AGAIN:
}
else if (aWidgetType == NS_THEME_WINDOW_BUTTON_CLOSE) {
OffsetBackgroundRect(widgetRect, CAPTIONBUTTON_CLOSE);
} else if (aWidgetType == NS_THEME_PROGRESSBAR_CHUNK) {
widgetRect.bottom -= kProgressDeterminedXPOverflow;
}
// widgetRect is the bounding box for a widget, yet the scale track is only