mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
Make the display frame resize correctly when the <select>'s width changes. Bug
370422, r+sr=dbaron
This commit is contained in:
parent
9eb1226efe
commit
7bf5f8b7a1
@ -1350,6 +1350,7 @@ GK_ATOM(brFrame, "BRFrame")
|
||||
GK_ATOM(bulletFrame, "BulletFrame")
|
||||
GK_ATOM(columnSetFrame, "ColumnSetFrame")
|
||||
GK_ATOM(comboboxControlFrame, "ComboboxControlFrame")
|
||||
GK_ATOM(comboboxDisplayFrame, "ComboboxDisplayFrame")
|
||||
GK_ATOM(directionalFrame, "DirectionalFrame")
|
||||
GK_ATOM(fieldSetFrame, "FieldSetFrame")
|
||||
GK_ATOM(frameSetFrame, "FrameSetFrame")
|
||||
|
@ -1041,6 +1041,10 @@ public:
|
||||
mComboBox(aComboBox)
|
||||
{}
|
||||
|
||||
// Need this so that line layout knows that this block's width
|
||||
// depends on the available width.
|
||||
virtual nsIAtom* GetType() const;
|
||||
|
||||
virtual PRBool IsFrameOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return nsBlockFrame::IsFrameOfType(aFlags &
|
||||
@ -1056,6 +1060,12 @@ protected:
|
||||
nsComboboxControlFrame* mComboBox;
|
||||
};
|
||||
|
||||
nsIAtom*
|
||||
nsComboboxDisplayFrame::GetType() const
|
||||
{
|
||||
return nsGkAtoms::comboboxDisplayFrame;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
@ -748,7 +748,8 @@ IsPercentageAware(const nsIFrame* aFrame)
|
||||
disp->mDisplay == NS_STYLE_DISPLAY_INLINE_TABLE ||
|
||||
fType == nsGkAtoms::HTMLButtonControlFrame ||
|
||||
fType == nsGkAtoms::gfxButtonControlFrame ||
|
||||
fType == nsGkAtoms::fieldSetFrame) {
|
||||
fType == nsGkAtoms::fieldSetFrame ||
|
||||
fType == nsGkAtoms::comboboxDisplayFrame) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
16
layout/reftests/bugs/370422-1-ref.html
Normal file
16
layout/reftests/bugs/370422-1-ref.html
Normal file
@ -0,0 +1,16 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Testcase bug - Select drop down button doesn't update its position in this case when document widens</title>
|
||||
</head>
|
||||
<body onload="test()">
|
||||
The dropwdown button should be on the right of the select<br>
|
||||
|
||||
<iframe src="data:text/html;charset=utf-8,%3Chtml%3E%3Chead%3E%0A%3Cstyle%3E%0Aselect%0A%7B%0A%20%20HEIGHT%3A%20100px%3B%0A%20%20WIDTH%3A%20100%25%3B%20%0A%7D%0A%3C/style%3E%0A%3C/head%3E%0A%3Cbody%3E%0A%3Cselect%3E%3Coption%20value%3D%222%22%3Etext%3C/option%3E%3C/select%3E%20%20%20%20%20%20%20%20%0A%3C/body%3E%0A%3C/html%3E" style="width: 400px;">
|
||||
</iframe>
|
||||
<script>
|
||||
function test() {
|
||||
document.getElementsByTagName('iframe')[0].style.width = '400px';
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
16
layout/reftests/bugs/370422-1.html
Normal file
16
layout/reftests/bugs/370422-1.html
Normal file
@ -0,0 +1,16 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Testcase bug - Select drop down button doesn't update its position in this case when document widens</title>
|
||||
</head>
|
||||
<body onload="test()">
|
||||
The dropwdown button should be on the right of the select<br>
|
||||
|
||||
<iframe src="data:text/html;charset=utf-8,%3Chtml%3E%3Chead%3E%0A%3Cstyle%3E%0Aselect%0A%7B%0A%20%20HEIGHT%3A%20100px%3B%0A%20%20WIDTH%3A%20100%25%3B%20%0A%7D%0A%3C/style%3E%0A%3C/head%3E%0A%3Cbody%3E%0A%3Cselect%3E%3Coption%20value%3D%222%22%3Etext%3C/option%3E%3C/select%3E%20%20%20%20%20%20%20%20%0A%3C/body%3E%0A%3C/html%3E" style="width: 200px;">
|
||||
</iframe>
|
||||
<script>
|
||||
function test() {
|
||||
document.getElementsByTagName('iframe')[0].style.width = '400px';
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -152,6 +152,7 @@ fails == 368020-4.html 368020-4-ref.html # bug 368085
|
||||
== 368020-5.html 368020-5-ref.html
|
||||
== 368622-1.html 368622-1-ref.html
|
||||
== 368622-1.html 368622-1-ref.html
|
||||
== 370422-1.html 370422-1-ref.html
|
||||
== 370586-1.xhtml 370586-1-ref.xhtml
|
||||
== 370629-1.html 370629-1-ref.html
|
||||
== 370629-2.html 370629-2-ref.html
|
||||
|
Loading…
x
Reference in New Issue
Block a user