зеркало из https://github.com/mozilla/gecko-dev.git
Bug 970257 - Make <input type=number> handle auto width properly. r=dholbert
This commit is contained in:
Родитель
823e3ab22a
Коммит
bf93e3f9bb
|
@ -60,6 +60,42 @@ nsNumberControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
|
|||
nsContainerFrame::DestroyFrom(aDestructRoot);
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsNumberControlFrame::GetMinWidth(nsRenderingContext* aRenderingContext)
|
||||
{
|
||||
nscoord result;
|
||||
DISPLAY_MIN_WIDTH(this, result);
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
if (kid) { // display:none?
|
||||
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||
kid,
|
||||
nsLayoutUtils::MIN_WIDTH);
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsNumberControlFrame::GetPrefWidth(nsRenderingContext* aRenderingContext)
|
||||
{
|
||||
nscoord result;
|
||||
DISPLAY_PREF_WIDTH(this, result);
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
if (kid) { // display:none?
|
||||
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||
kid,
|
||||
nsLayoutUtils::PREF_WIDTH);
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
|
|
@ -50,6 +50,10 @@ public:
|
|||
virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
|
||||
#endif
|
||||
|
||||
virtual nscoord GetMinWidth(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE;
|
||||
|
||||
virtual nscoord GetPrefWidth(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<input type="text" style="-moz-appearance:none; width:auto;">
|
||||
<!-- div to cover spin box area -->
|
||||
<div style="display:block; position:absolute; background-color:black; width:2000px; height:100px; top:0px; left:100px;">
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<input type="number" style="-moz-appearance:none; width:auto;">
|
||||
<!-- div to cover spin box area -->
|
||||
<div style="display:block; position:absolute; background-color:black; width:2000px; height:100px; top:0px; left:100px;">
|
||||
</body>
|
||||
</html>
|
|
@ -20,6 +20,9 @@ fuzzy-if(/^Windows\x20NT\x205\.1/.test(http.oscpu),64,4) fuzzy-if(cocoaWidget,63
|
|||
# disabled
|
||||
== number-disabled.html number-disabled-ref.html
|
||||
|
||||
# auto width:
|
||||
== number-auto-width-1.html number-auto-width-1-ref.html
|
||||
|
||||
# min-height/max-height tests:
|
||||
skip-if(B2G) == number-min-height-1.html number-min-height-1-ref.html
|
||||
skip-if(B2G) == number-min-height-2.html number-min-height-2-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче