Bug 103869 - INPUT_MULTIPLE_FIELDS_UI doesn't render digits well in RTL locales
Summary: INPUT_MULTIPLE_FIELDS_UI doesn't render digits well in RTL locales
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:
Depends on:
Blocks:
 
Reported: 2012-12-03 02:03 PST by Kent Tamura
Modified: 2012-12-05 23:11 PST (History)
7 users (show)

See Also:


Attachments
Patch (571.16 KB, patch)
2012-12-03 21:12 PST, Kent Tamura
morrita: review+
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-12-03 02:03:49 PST
http://code.google.com/p/chromium/issues/detail?id=163108

Many RTL locales use LTR digits. So, we should show "23:59" (visual order) for "23:59" (logical order) even in an RTL locale.  WebCore applies such bidi re-ordering automatically. However,  we wrap these characters with display:inline-block elements in INPUT_MULTIPLE_FIELDS_UI and WebCore can't apply the bidi re-ordering to block elements. We should use display:inline in INPUT_MULTIPLE_FIELDS_UI.
Comment 1 Kent Tamura 2012-12-03 21:12:01 PST
Created attachment 177412 [details]
Patch
Comment 2 Kentaro Hara 2012-12-03 22:22:38 PST
Comment on attachment 177412 [details]
Patch

morrita-san: I'm not familiar with the code. Could you take a look?
Comment 3 Hajime Morrita 2012-12-05 21:34:43 PST
Comment on attachment 177412 [details]
Patch

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

> Source/WebCore/dom/Element.h:398
> +    virtual bool isDateTimeFieldElement() const;

Nit: OK to be inlined like other isXxxElement(). Having extra if/endif in .cpp file seems a bit mess.

> Source/WebCore/html/shadow/DateTimeEditElement.cpp:358
> +            width += static_cast<DateTimeFieldElement*>(childElement)->maximumWidth(style->font());

You might able to override didStyleRecalc() instead of this one. It allows you to modify createdStyle.

> Source/WebCore/html/shadow/DateTimeEditElement.cpp:362
> +            width += style->font().width(childElement->textContent());

Doesn't textContent() change?
Comment 4 Hajime Morrita 2012-12-05 21:46:04 PST
Comment on attachment 177412 [details]
Patch

I hope there were better way to handle this kind of workaround. I have no good idea though.
Comment 5 Kent Tamura 2012-12-05 22:40:58 PST
Comment on attachment 177412 [details]
Patch

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

>> Source/WebCore/html/shadow/DateTimeEditElement.cpp:362
>> +            width += style->font().width(childElement->textContent());
> 
> Doesn't textContent() change?

Right. It is fixed.
Comment 6 Kent Tamura 2012-12-05 22:42:29 PST
(In reply to comment #4)
> (From update of attachment 177412 [details])
> I hope there were better way to handle this kind of workaround. I have no good idea though.

The calculation is a kind of layout.  So the ideal solution might be to add a new renderer ;-(
Comment 7 Kent Tamura 2012-12-05 23:11:20 PST
Committed r136808: <http://trac.webkit.org/changeset/136808>