From cf9c2a7620127486a8ee52343e83acd9ab15ec5e Mon Sep 17 00:00:00 2001 From: "reed%reedloden.com" Date: Mon, 7 Jan 2008 22:18:06 +0000 Subject: [PATCH] Bug 409587 - "input[type="file"] cropped when narrow width specified" [p=kinetik@flim.org (Matthew Gregan) r+sr=roc a1.9=beltzner] git-svn-id: svn://10.0.0.236/trunk@242601 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsFileControlFrame.cpp | 6 ++++-- mozilla/layout/reftests/forms/input-file-width-clip-1.html | 3 +++ .../layout/reftests/forms/input-file-width-clip-ref.html | 3 +++ mozilla/layout/reftests/forms/reftest.list | 1 + mozilla/layout/reftests/reftest.list | 3 +++ 5 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 mozilla/layout/reftests/forms/input-file-width-clip-1.html create mode 100644 mozilla/layout/reftests/forms/input-file-width-clip-ref.html create mode 100644 mozilla/layout/reftests/forms/reftest.list diff --git a/mozilla/layout/forms/nsFileControlFrame.cpp b/mozilla/layout/forms/nsFileControlFrame.cpp index 58fbd0350e3..04fe2cb7277 100644 --- a/mozilla/layout/forms/nsFileControlFrame.cpp +++ b/mozilla/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/mozilla/layout/reftests/forms/input-file-width-clip-1.html b/mozilla/layout/reftests/forms/input-file-width-clip-1.html new file mode 100644 index 00000000000..d4acd7e27fc --- /dev/null +++ b/mozilla/layout/reftests/forms/input-file-width-clip-1.html @@ -0,0 +1,3 @@ +
+
+ diff --git a/mozilla/layout/reftests/forms/input-file-width-clip-ref.html b/mozilla/layout/reftests/forms/input-file-width-clip-ref.html new file mode 100644 index 00000000000..a6c746ac8d7 --- /dev/null +++ b/mozilla/layout/reftests/forms/input-file-width-clip-ref.html @@ -0,0 +1,3 @@ +
+
+ diff --git a/mozilla/layout/reftests/forms/reftest.list b/mozilla/layout/reftests/forms/reftest.list new file mode 100644 index 00000000000..0fc70d0439b --- /dev/null +++ b/mozilla/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/mozilla/layout/reftests/reftest.list b/mozilla/layout/reftests/reftest.list index 098b307da4e..fd880323c23 100644 --- a/mozilla/layout/reftests/reftest.list +++ b/mozilla/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 +