diff --git a/layout/forms/nsFileControlFrame.cpp b/layout/forms/nsFileControlFrame.cpp index 58fbd0350e36..04fe2cb7277f 100644 --- a/layout/forms/nsFileControlFrame.cpp +++ b/layout/forms/nsFileControlFrame.cpp @@ -542,8 +542,10 @@ nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, tempList.BorderBackground()->DeleteAll(); - rv = OverflowClip(aBuilder, tempList, aLists, - nsRect(aBuilder->ToReferenceFrame(this), GetSize())); + // Clip height only + nsRect clipRect(aBuilder->ToReferenceFrame(this), GetSize()); + clipRect.width = GetOverflowRect().XMost(); + rv = OverflowClip(aBuilder, tempList, aLists, clipRect); NS_ENSURE_SUCCESS(rv, rv); // Disabled file controls don't pass mouse events to their children, so we diff --git a/layout/reftests/forms/input-file-width-clip-1.html b/layout/reftests/forms/input-file-width-clip-1.html new file mode 100644 index 000000000000..d4acd7e27fc3 --- /dev/null +++ b/layout/reftests/forms/input-file-width-clip-1.html @@ -0,0 +1,3 @@ +
+
+ diff --git a/layout/reftests/forms/input-file-width-clip-ref.html b/layout/reftests/forms/input-file-width-clip-ref.html new file mode 100644 index 000000000000..a6c746ac8d75 --- /dev/null +++ b/layout/reftests/forms/input-file-width-clip-ref.html @@ -0,0 +1,3 @@ +
+
+ diff --git a/layout/reftests/forms/reftest.list b/layout/reftests/forms/reftest.list new file mode 100644 index 000000000000..0fc70d0439b3 --- /dev/null +++ b/layout/reftests/forms/reftest.list @@ -0,0 +1 @@ +== input-file-width-clip-1.html input-file-width-clip-ref.html # bug 409587 diff --git a/layout/reftests/reftest.list b/layout/reftests/reftest.list index 098b307da4e4..fd880323c23b 100644 --- a/layout/reftests/reftest.list +++ b/layout/reftests/reftest.list @@ -84,3 +84,6 @@ include line-breaking/reftest.list # percent-overflow-sizing include percent-overflow-sizing/reftest.list +# forms +include forms/reftest.list +