Closed
Bug 1313486
Opened 8 years ago
Closed 8 years ago
Fix unicode-bidi for DOM label and value in RTL locales
Categories
(DevTools :: DOM, defect, P2)
DevTools
DOM
Tracking
(firefox52 affected, firefox53 fixed)
RESOLVED
FIXED
Firefox 53
People
(Reporter: magicp.jp, Assigned: Towkir, Mentored)
Details
(Keywords: good-first-bug)
Attachments
(4 files)
Steps to Reproduce:
1. Start Nightly in RTL locales (e.g. Arabic)
2. Go to about:home
3. Open DevTools > DOM
4. Type "_" in filter input
5. Check label and value
Actual Results:
unicode-bidi is wrong.
Expected Results:
fix unicode-bidi for DOM label and value in RTL locales.
Comment 1•8 years ago
|
||
Thanks for the report!
I am not sue if I understand the core of the issue. I am attaching my screenshot, can you explain what's wrong on it?
Do we somehow mix RTL with LTR?
Honza
Flags: needinfo?(magicp.jp)
Updated•8 years ago
|
Priority: -- → P2
Hi Honza, here is an example for expected results.
Flags: needinfo?(magicp.jp)
I think this bug is one of unicode-bidi issues. For example, tooltip of bookmark display "/https://www.mozilla.org/en-US/contribute/" as "https://www.mozilla.org/en-US/contribute" in RTL locales. I will file these issues later.
Comment 5•8 years ago
|
||
(In reply to magicp from comment #2)
> Created attachment 8805471 [details]
> expected-results.png
>
> Hi Honza, here is an example for expected results.
Thanks for the screenshot!
So, I see two issues to be fixed in this report:
1) JS array:
JS Array should be displayed as follows in RTL:
`[] Array`
2) Variables with underscore
Variables should not change position of `_` character.
`_generateCallbackID` should look the same in RTL an LTR.
Honza
Mentor: odvarko
Keywords: good-first-bug
(In reply to Jan Honza Odvarko [:Honza] from comment #5)
> JS Array should be displayed as follows in RTL:
>
> `[] Array`
I see!
Assignee | ||
Comment 7•8 years ago
|
||
Hi, I would like to work on this, can you suggest where to start ?
Thanks
Flags: needinfo?(odvarko)
Comment 8•8 years ago
|
||
(In reply to [:Towkir] Ahmed from comment #7)
> Hi, I would like to work on this, can you suggest where to start ?
Excellent!
Let me first clear what is needed to do here.
1) A little correction. JS array should look the same in RTL and LTR so, we don't have to do anything in this case. Let's follow how math works - it looks the same in LTR and RTL. See [1] as an example.
2) I believe that the second thing should be fixed:
`_generateCallbackID` should look the same in RTL an LTR.
Currently, the variable name looks like as follows in RTL:
`generateCallbackID_`
(the underscore character is moved at the end)
@Eitan: variable names shouldn't be changed, right?
Honza
[1] https://he.wikibooks.org/wiki/%D7%9E%D7%AA%D7%9E%D7%98%D7%99%D7%A7%D7%94_%D7%AA%D7%99%D7%9B%D7%95%D7%A0%D7%99%D7%AA/%D7%90%D7%9C%D7%92%D7%91%D7%A8%D7%94_%D7%AA%D7%99%D7%9B%D7%95%D7%A0%D7%99%D7%AA/%D7%9E%D7%A9%D7%95%D7%95%D7%90%D7%95%D7%AA/%D7%9E%D7%A9%D7%95%D7%95%D7%90%D7%95%D7%AA_%D7%A8%D7%99%D7%91%D7%95%D7%A2%D7%99%D7%95%D7%AA
Flags: needinfo?(odvarko) → needinfo?(eitan)
Comment 9•8 years ago
|
||
Correct. I think a good place to start is to keep block containers as rtl according to locale, but any inline content should be ltr. For example, the DOM tree view should be rendered rtl, but each column in each row should be ltr.
Flags: needinfo?(eitan)
Comment 10•8 years ago
|
||
(In reply to Eitan Isaacson [:eeejay] from comment #9)
> Correct. I think a good place to start is to keep block containers as rtl
> according to locale, but any inline content should be ltr. For example, the
> DOM tree view should be rendered rtl, but each column in each row should be
> ltr.
Yes, agree.
:Towkir, I did some analysis of the #2 problem (comment #8) and the underscore character has special meaning in RTL. We can fix it by explicit setting dir="ltr". This is partially done for functions see:
https://dxr.mozilla.org/mozilla-central/rev/ade8d4a63e57560410de106450f37b50ed71cca5/devtools/client/shared/components/reps/function.js#47
... and we need to also do it for Tree labels. It should be done in: devtools/client/shared/components/tree/label-cell. See the render method, we need to put dir="ltr" into the treeLabel element. I wasn't able to fix it using CSS (direction: ltr) and so, I guess we need to use an attribute.
Does it make sense?
Honza
Flags: needinfo?(3ugzilla)
Comment 11•8 years ago
|
||
See also bug 1290056 for more details how to fix the problem.
Honza
Reporter | ||
Comment 12•8 years ago
|
||
Can we use "unicode-bidi: -moz-plaintext;" (or plaintext) ?
Assignee | ||
Comment 13•8 years ago
|
||
Hi :Honza
I will get back to this with my progress soon, for now, not clearing the needinfo intentionally.
Assignee | ||
Comment 14•8 years ago
|
||
Hello Honza,
I had a look at this and found that magicp's comment 12 fixes the issue. (This is when I want to fix this via css)
If we have to fix this by JS, it would be nice if you could explain the reason behind it, this is just my curiosity, not any judgment. Meanwhile I am looking into your comment 10
Thanks
Flags: needinfo?(3ugzilla)
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(odvarko)
Comment 15•8 years ago
|
||
(In reply to [:Towkir] Ahmed from comment #14)
> Hello Honza,
> I had a look at this and found that magicp's comment 12 fixes the issue.
> (This is when I want to fix this via css)
Sounds good to me. Do you have a patch to attach?
Honza
Flags: needinfo?(odvarko)
Assignee | ||
Comment 16•8 years ago
|
||
Yes,
Will submit a patch soon.
Assignee: nobody → 3ugzilla
Status: NEW → ASSIGNED
Assignee | ||
Comment 17•8 years ago
|
||
Hi Honza,
Please have a look at this, Hope this helps.
Thanks
Attachment #8814470 -
Flags: review?(odvarko)
Comment 18•8 years ago
|
||
Comment on attachment 8814470 [details] [diff] [review]
unicodebdifixed.patch
Review of attachment 8814470 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me, thanks!
Honza
Attachment #8814470 -
Flags: review?(odvarko) → review+
Comment 20•8 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8b922bd2f864
Fix unicode-bidi for DOM label and value in RTL locales. r=Honza
Keywords: checkin-needed
Comment 21•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
Comment 22•8 years ago
|
||
Honza, is it something that we want to uplift in 52? Thanks
Flags: needinfo?(odvarko)
Comment 23•8 years ago
|
||
I think that this was a minor issue and we can wait. Also, I recall that there have been some other patches related to RTL so, I am rather reluctant to uplift just this one patch. In any case, thanks for the notification!
Honza
Flags: needinfo?(odvarko)
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•