Bug 90864 - RTL calendar picker for <input type=date> is too narrow and clipped
Summary: RTL calendar picker for <input type=date> is too narrow and clipped
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kent Tamura
URL:
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2012-07-10 02:10 PDT by Kent Tamura
Modified: 2012-07-12 00:33 PDT (History)
3 users (show)

See Also:


Attachments
Patch (4.27 KB, patch)
2012-07-10 02:17 PDT, Kent Tamura
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Tamura 2012-07-10 02:10:04 PDT
http://code.google.com/p/chromium/issues/detail?id=135421

A calendar picker is too narrow if user's date setting is for an RTL language.
This affects only desktop Chromium.
Comment 1 Kent Tamura 2012-07-10 02:17:45 PDT
Created attachment 151422 [details]
Patch
Comment 2 Kentaro Hara 2012-07-10 02:54:29 PDT
Comment on attachment 151422 [details]
Patch

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

> Source/WebCore/Resources/calendarPicker.js:319
> +        yearMonthEnd = startOffset - yearMonthRightElement.offsetLeft;
> +        daysAreaEnd = startOffset - (daysAreaElement.offsetLeft + daysAreaElement.offsetWidth) + maxCellWidth * 7 + DaysAreaContainerBorder;

For daysAreaEnd, daysAreaElement.offsetWidth is subtracted from startOffset. On the other hand, for yearMonthEnd, yearMonthRightElement.offsetWidth is not subtracted from startOffset. Why?
Comment 3 Kent Tamura 2012-07-10 03:05:41 PDT
Comment on attachment 151422 [details]
Patch

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

>> Source/WebCore/Resources/calendarPicker.js:319
>> +        daysAreaEnd = startOffset - (daysAreaElement.offsetLeft + daysAreaElement.offsetWidth) + maxCellWidth * 7 + DaysAreaContainerBorder;
> 
> For daysAreaEnd, daysAreaElement.offsetWidth is subtracted from startOffset. On the other hand, for yearMonthEnd, yearMonthRightElement.offsetWidth is not subtracted from startOffset. Why?

For yearMonthEnd, we need the distance from the right edge of "main" to the left edge of yearMonthRightElement.
For daysAreaEnd, we need the sum of the followings:
 o the distane from the right edge of "main" to the right edge of the daysAreaElement
 o 7 * maxCellWidth
 o DaysAreaContainerBorder.

We don't use the left edge of the daysAreaElement because we'd like to assign the same width (maxCellWidth) for each of day-of-week columns.
Comment 4 Kentaro Hara 2012-07-10 03:08:38 PDT
Comment on attachment 151422 [details]
Patch

Thanks for the clarification. rs=me
Comment 5 Kent Tamura 2012-07-10 03:09:27 PDT
Comment on attachment 151422 [details]
Patch

Thanks!
Comment 6 WebKit Review Bot 2012-07-10 04:21:43 PDT
Comment on attachment 151422 [details]
Patch

Clearing flags on attachment: 151422

Committed r122212: <http://trac.webkit.org/changeset/122212>
Comment 7 WebKit Review Bot 2012-07-10 04:21:48 PDT
All reviewed patches have been landed.  Closing bug.