WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 53942
[Chromium] Select popup box does not align with select button when appearance is not "menulist".
https://bugs.webkit.org/show_bug.cgi?id=53942
Summary
[Chromium] Select popup box does not align with select button when appearance...
xiyuan
Reported
2011-02-07 14:26:22 PST
Created
attachment 81520
[details]
Test case. When a select element's appearance is not "menulist", we use the css padding to calculdate popup width (since
https://bugs.webkit.org/show_bug.cgi?id=33235
). And this caused the popup box is wider than the select button when appearance is not menulist. And use has no way to fix this via css padding.
Attachments
Test case.
(2.08 KB, text/html)
2011-02-07 14:26 PST
,
xiyuan
no flags
Details
Proposed patch.
(5.15 KB, patch)
2011-02-07 14:42 PST
,
xiyuan
no flags
Details
Formatted Diff
Diff
Fix typo in manual test name.
(5.15 KB, patch)
2011-02-07 14:45 PST
,
xiyuan
tony
: review-
Details
Formatted Diff
Diff
Address tony's comments @3,4
(5.64 KB, patch)
2011-02-07 16:36 PST
,
xiyuan
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
xiyuan
Comment 1
2011-02-07 14:42:22 PST
Created
attachment 81523
[details]
Proposed patch.
xiyuan
Comment 2
2011-02-07 14:45:15 PST
Created
attachment 81525
[details]
Fix typo in manual test name.
Tony Chang
Comment 3
2011-02-07 16:06:54 PST
Comment on
attachment 81525
[details]
Fix typo in manual test name. View in context:
https://bugs.webkit.org/attachment.cgi?id=81525&action=review
just some small nits
> Source/WebCore/platform/chromium/PopupMenuChromium.cpp:1272 > +const int minEndOfLinePadding = 2;
static? Also, should this be at the top of the file with the other constants? The other constants are named incorrectly (k prefix), but we can fix that later.
> Source/WebCore/platform/chromium/PopupMenuChromium.cpp:1275 > + bool rightAligned = m_popupClient->menuStyle().textDirection() == RTL;
Nit: rightAligned -> isRightAligned
Tony Chang
Comment 4
2011-02-07 16:07:30 PST
Comment on
attachment 81525
[details]
Fix typo in manual test name. View in context:
https://bugs.webkit.org/attachment.cgi?id=81525&action=review
> Source/WebCore/platform/chromium/PopupMenuChromium.cpp:1349 > + // Use minEndOfLinePadding when there is a scrollbar.
Why does a scrollbar cause us to need 2 extra pixels?
xiyuan
Comment 5
2011-02-07 16:36:01 PST
Comment on
attachment 81525
[details]
Fix typo in manual test name. View in context:
https://bugs.webkit.org/attachment.cgi?id=81525&action=review
>> Source/WebCore/platform/chromium/PopupMenuChromium.cpp:1272
> > static? Also, should this be at the top of the file with the other constants? The other constants are named incorrectly (k prefix), but we can fix that later.
Done.
>> Source/WebCore/platform/chromium/PopupMenuChromium.cpp:1275
> > Nit: rightAligned -> isRightAligned
Done
>> Source/WebCore/platform/chromium/PopupMenuChromium.cpp:1349 >> + // Use minEndOfLinePadding when there is a scrollbar. > > Why does a scrollbar cause us to need 2 extra pixels?
Updated the comment to make it more clear. It's not that we need the 2 extra pixels. We replace the lineEndPaddingWidth space with the minimum 2 pixel space when there is a scrollbar. In this way, scrollbar will stay as much as possible inside the line end padding space. User could use a big enough "padding-right" (>= scrollbarWidth + 2px) to make the popup listbox align with the select button. This is because
https://bugs.webkit.org/show_bug.cgi?id=33235
makes popup respect the "padding-right". It works well when there is no scrollbar. But when popup has a scrollbar, the popup is always wider than the select button no matter what padding-right value you use. You can see that from the test case page.
xiyuan
Comment 6
2011-02-07 16:36:52 PST
Created
attachment 81550
[details]
Address tony's comments @3,4
Tony Chang
Comment 7
2011-02-07 16:41:25 PST
Comment on
attachment 81550
[details]
Address tony's comments @3,4 View in context:
https://bugs.webkit.org/attachment.cgi?id=81550&action=review
> Source/WebCore/platform/chromium/PopupMenuChromium.cpp:1353 > + // Use kMinEndOfLinePadding when there is a scrollbar so that we use > + // as much as (lineEndPaddingWidth - kMinEndOfLinePadding) padding > + // space for scrollbar and allow user to use CSS padding to make the > + // popup listbox align with the select element. > + paddingWidth = paddingWidth - lineEndPaddingWidth + kMinEndOfLinePadding;
This comment is much more useful. Thanks!
WebKit Commit Bot
Comment 8
2011-02-07 23:07:18 PST
Comment on
attachment 81550
[details]
Address tony's comments @3,4 Clearing flags on attachment: 81550 Committed
r77907
: <
http://trac.webkit.org/changeset/77907
>
WebKit Commit Bot
Comment 9
2011-02-07 23:07:24 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug