mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 686886 - Port bug 680747 and bug 680518 to nsMeterFrame. r=roc
This commit is contained in:
parent
57ef1552f9
commit
b4ff41189c
@ -245,6 +245,7 @@ nsMeterFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
||||
PresContext()->PresShell()->FrameNeedsReflow(barFrame,
|
||||
nsIPresShell::eResize,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
Invalidate(GetVisualOverflowRectRelativeToSelf());
|
||||
}
|
||||
|
||||
return nsContainerFrame::AttributeChanged(aNameSpaceID, aAttribute,
|
||||
@ -270,10 +271,32 @@ nsMeterFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
} else {
|
||||
autoSize.width *= 5; // 5em
|
||||
}
|
||||
|
||||
|
||||
return autoSize;
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsMeterFrame::GetMinWidth(nsRenderingContext *aRenderingContext)
|
||||
{
|
||||
nsRefPtr<nsFontMetrics> fontMet;
|
||||
NS_ENSURE_SUCCESS(
|
||||
nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fontMet)), 0);
|
||||
|
||||
nscoord minWidth = fontMet->Font().size; // 1em
|
||||
|
||||
if (GetStyleDisplay()->mOrient == NS_STYLE_ORIENT_HORIZONTAL) {
|
||||
minWidth *= 5; // 5em
|
||||
}
|
||||
|
||||
return minWidth;
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsMeterFrame::GetPrefWidth(nsRenderingContext *aRenderingContext)
|
||||
{
|
||||
return GetMinWidth(aRenderingContext);
|
||||
}
|
||||
|
||||
bool
|
||||
nsMeterFrame::ShouldUseNativeStyle() const
|
||||
{
|
||||
|
@ -85,6 +85,9 @@ public:
|
||||
nsSize aMargin, nsSize aBorder,
|
||||
nsSize aPadding, bool aShrinkWrap);
|
||||
|
||||
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext);
|
||||
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext);
|
||||
|
||||
virtual bool IsFrameOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return nsContainerFrame::IsFrameOfType(aFlags &
|
||||
|
10
layout/reftests/forms/meter/block-invalidate-ref.html
Normal file
10
layout/reftests/forms/meter/block-invalidate-ref.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<link rel='stylesheet' type='text/css' href='style.css'>
|
||||
<style>
|
||||
meter { display: block; }
|
||||
</style>
|
||||
<body>
|
||||
<meter value='0.5'></meter>
|
||||
</body>
|
||||
</html>
|
19
layout/reftests/forms/meter/block-invalidate.html
Normal file
19
layout/reftests/forms/meter/block-invalidate.html
Normal file
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html class='reftest-wait'>
|
||||
<link rel='stylesheet' type='text/css' href='style.css'>
|
||||
<style>
|
||||
meter { display: block; }
|
||||
</style>
|
||||
<script>
|
||||
function loadHandler() {
|
||||
setTimeout(function() {
|
||||
var p = document.getElementsByTagName('meter')[0];
|
||||
p.value = '0.5';
|
||||
document.documentElement.className = '';
|
||||
}, 0);
|
||||
}
|
||||
</script>
|
||||
<body onload="loadHandler();">
|
||||
<meter value='0'></meter>
|
||||
</body>
|
||||
</html>
|
22
layout/reftests/forms/meter/in-cells-ref.html
Normal file
22
layout/reftests/forms/meter/in-cells-ref.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<link rel='stylesheet' type='text/css' href='style.css'>
|
||||
<style>
|
||||
meter { width: 5em; height: 1em; }
|
||||
meter.vertical { -moz-orient: vertical; width: 1em; height: 5em; }
|
||||
</style>
|
||||
<body>
|
||||
<table>
|
||||
<tr>
|
||||
<td>foo</td>
|
||||
<td><meter value='0.5'></meter></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>foo</td>
|
||||
<td><meter class='vertical' value='0.5'></meter></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
21
layout/reftests/forms/meter/in-cells.html
Normal file
21
layout/reftests/forms/meter/in-cells.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<link rel='stylesheet' type='text/css' href='style.css'>
|
||||
<style>
|
||||
meter.vertical { -moz-orient: vertical; }
|
||||
</style>
|
||||
<body>
|
||||
<table>
|
||||
<tr>
|
||||
<td>foo</td>
|
||||
<td><meter value='0.5'></meter></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>foo</td>
|
||||
<td><meter class='vertical' value='0.5'></meter></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -20,3 +20,7 @@
|
||||
|
||||
# default style
|
||||
include default-style/reftest.list
|
||||
|
||||
# Tests for bugs:
|
||||
== block-invalidate.html block-invalidate-ref.html
|
||||
== in-cells.html in-cells-ref.html
|
||||
|
@ -9,12 +9,12 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>foo</td>
|
||||
<td><progress value='0.5'></td>
|
||||
<td><progress value='0.5'></progress></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>foo</td>
|
||||
<td><progress class='vertical' value='0.5'></td>
|
||||
<td><progress class='vertical' value='0.5'></progress></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -8,12 +8,12 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>foo</td>
|
||||
<td><progress value='0.5'></td>
|
||||
<td><progress value='0.5'></progress></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>foo</td>
|
||||
<td><progress class='vertical' value='0.5'></td>
|
||||
<td><progress class='vertical' value='0.5'></progress></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
Loading…
Reference in New Issue
Block a user