Bug 91913 - If select element is off screen horizontally, menu is either inappropriately resized or positioned offscreen
Summary: If select element is off screen horizontally, menu is either inappropriately ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Roger Fong
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-20 17:53 PDT by Roger Fong
Modified: 2012-07-23 17:48 PDT (History)
2 users (show)

See Also:


Attachments
Patch to fix Windows menu list positioning code. (4.34 KB, patch)
2012-07-23 13:03 PDT, Roger Fong
thorton: review-
thorton: commit-queue-
Details | Formatted Diff | Diff
Remove executable property from test file (3.90 KB, patch)
2012-07-23 13:23 PDT, Roger Fong
no flags Details | Formatted Diff | Diff
Correction to make sure that if width is larger than screen width, left side of menus will always appear. Changed test file to use more generic menu items. (3.97 KB, patch)
2012-07-23 15:40 PDT, Roger Fong
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Fong 2012-07-20 17:53:07 PDT
If the select element is positioned off the edge of the screen to the left, the menu is resized. It should not be resized, just shifted to remain on the screen.

If the select element is positioned off the edge of the screen to the right, the menu goes off screen instead of being shifted over to appear on screen.
Comment 1 Roger Fong 2012-07-20 17:54:40 PDT
Radar: <rdar://problem/7611229>
Comment 2 Roger Fong 2012-07-23 13:03:10 PDT
Created attachment 153847 [details]
Patch to fix Windows menu list positioning code.
Comment 3 Tim Horton 2012-07-23 13:11:41 PDT
Comment on attachment 153847 [details]
Patch to fix Windows menu list positioning code.

View in context: https://bugs.webkit.org/attachment.cgi?id=153847&action=review

> ManualTests/win/select-menu-off-screen.html:8
> +<select id = "left-select-over" style="margin-left:-50px;">

You have extra space around the =

> ManualTests/win/select-menu-off-screen.html:12
> +  <option value="volvo">Volvo</option>
> +  <option value="saab">Saab</option>
> +  <option value="mercedes">Mercedes</option>
> +  <option value="audi">Audi</option>

I wonder if we should use something more neutral than car manufacturers :)

> ManualTests/win/select-menu-off-screen.html:14
> +<select id = "right-select-over" style="float:right; margin-right:-50px;">

You have extra space around the =

> Source/WebCore/platform/win/PopupMenuWin.cpp:-382
> -    if (popupRect.x() < screen.x()) {
> -        popupRect.setWidth(popupRect.width() - (screen.x() - popupRect.x()));

What happens now if the popup is super wide?
Comment 4 Tim Horton 2012-07-23 13:12:16 PDT
You've got that executable flag set again. I wonder if there's something you can do in your svn config to stop that from happening.
Comment 5 Roger Fong 2012-07-23 13:23:35 PDT
Created attachment 153851 [details]
Remove executable property from test file
Comment 6 WebKit Review Bot 2012-07-23 13:26:38 PDT
Attachment 153851 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'ChangeLog', u'ManualTests/win/select-menu-..." exit_code: 1
ManualTests/win/select-menu-off-screen.html:1:  One or more unexpected \r (^M) found; better to use only a \n  [whitespace/carriage_return] [1]
Suppressing further [whitespace/carriage_return] reports for this file.
Total errors found: 21 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Roger Fong 2012-07-23 13:53:09 PDT
If the width is too large it just flows off screen according to whichever case it first hits. I guess however that I may as well adjust the width. It should probably also always show the beginning of the menu entries.
Comment 8 Roger Fong 2012-07-23 15:40:56 PDT
Created attachment 153879 [details]
Correction to make sure that if width is larger than screen width, left side of menus will always appear. Changed test file to use more generic menu items.
Comment 9 WebKit Review Bot 2012-07-23 17:48:24 PDT
Comment on attachment 153879 [details]
Correction to make sure that if width is larger than screen width, left side of menus will always appear. Changed test file to use more generic menu items.

Clearing flags on attachment: 153879

Committed r123411: <http://trac.webkit.org/changeset/123411>
Comment 10 WebKit Review Bot 2012-07-23 17:48:27 PDT
All reviewed patches have been landed.  Closing bug.