b=444870 include overflow in the dirty rect passed to DrawWidgetBackground() r=roc

This commit is contained in:
Karl Tomlinson 2010-07-02 16:08:06 +12:00
Родитель 9f4fd5ba19
Коммит 306540d13f
6 изменённых файлов: 72 добавлений и 13 удалений

Просмотреть файл

@ -2147,10 +2147,13 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
nsITheme *theme = aPresContext->GetTheme();
if (theme && theme->ThemeSupportsWidget(aPresContext, aForFrame,
displayData->mAppearance)) {
nsRect dirty;
dirty.IntersectRect(aDirtyRect, aBorderArea);
nsRect drawing(aBorderArea);
theme->GetWidgetOverflow(aPresContext->DeviceContext(),
aForFrame, displayData->mAppearance, &drawing);
drawing.IntersectRect(drawing, aDirtyRect);
theme->DrawWidgetBackground(&aRenderingContext, aForFrame,
displayData->mAppearance, aBorderArea, dirty);
displayData->mAppearance, aBorderArea,
drawing);
return;
}
}

Просмотреть файл

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
#checkbox {
position: absolute;
left: 0px;
top: 0px;
background: -moz-linear-gradient(left, white, brown);
}
</style>
</head>
<body>
<div id="checkbox">
<input type="checkbox">
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
#checkbox {
position: absolute;
left: 0px;
top: 0px;
background: -moz-linear-gradient(left, white, brown);
}
#toremove {
position: absolute;
left: 0px;
top: 0px;
width: 100px;
height: 0px;
background: black;
}
</style>
</head>
<body>
<div id="checkbox">
<input type="checkbox">
</div>
<div id="toremove">
</div>
</body>
<script type="text/javascript">
var checkBox = document.getElementById("checkbox");
var toRemove = document.getElementById("toremove");
toRemove.style.height = checkBox.offsetHeight / 2 + 0.2 + "px";
function boom()
{
toRemove.parentNode.removeChild(toRemove);
document.documentElement.className = "";
}
window.addEventListener("MozReftestInvalidate", boom, false);
</script>
</html>

Просмотреть файл

@ -57,3 +57,5 @@ skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") == resizer-bottomend-rtl.xul resizer-bottome
# Windows-only, depends on native scrollbar metrics
skip-if(MOZ_WIDGET_TOOLKIT!="windows") == scroll-thumb-minimum-size-notheme.html scroll-thumb-minimum-size-notheme-ref.html
# skip-if(MOZ_WIDGET_TOOLKIT!="windows") == scroll-thumb-minimum-size-theme.html scroll-thumb-minimum-size-theme-ref.html # Bug 512206
== checkbox-dynamic-1.html checkbox-dynamic-1-ref.html

Просмотреть файл

@ -748,23 +748,20 @@ nsNativeThemeGTK::DrawWidgetBackground(nsIRenderingContext* aContext,
// GTK themes can only draw an integer number of pixels
// (even when not snapped).
nsIntRect widgetRect(0, 0, NS_lround(rect.Width()), NS_lround(rect.Height()));
nsIntRect overflowRect(widgetRect);
nsIntMargin extraSize;
if (GetExtraSizeForWidget(aWidgetType, state.isDefault, &extraSize)) {
overflowRect.Inflate(extraSize);
}
// This is the rectangle that will actually be drawn, in gdk pixels
nsIntRect drawingRect(PRInt32(dirtyRect.X()),
PRInt32(dirtyRect.Y()),
PRInt32(dirtyRect.Width()),
PRInt32(dirtyRect.Height()));
if (!drawingRect.IntersectRect(widgetRect, drawingRect))
if (!drawingRect.IntersectRect(overflowRect, drawingRect))
return NS_OK;
nsIntMargin extraSize;
// The margin should be applied to the widget rect rather than the dirty
// rect but nsCSSRendering::PaintBackgroundWithSC has already intersected
// the dirty rect with the uninflated widget rect.
if (GetExtraSizeForWidget(aWidgetType, state.isDefault, &extraSize)) {
drawingRect.Inflate(extraSize);
}
// gdk rectangles are wrt the drawing rect.
// The gdk_clip is just advisory here, meaning "you don't

Просмотреть файл

@ -1485,7 +1485,7 @@ nsNativeThemeWin::GetWidgetOverflow(nsIDeviceContext* aContext,
nsRect* aResult)
{
/* This is disabled for now, because it causes invalidation problems --
* see bug 402381. The effect of not updating the overflow area is that
* see bug 420381. The effect of not updating the overflow area is that
* for dropdown buttons in content areas, there is a 1px border on 3 sides
* where, if invalidated, the dropdown control probably won't be repainted.
* This is fairly minor, as by default there is nothing in that area, and