Closed
Bug 349352
Opened 19 years ago
Closed 19 years ago
Underline shifts when clicking the spacebar after an unrecognized Hebrew word on RTL textarea
Categories
(Core :: Layout: Text and Fonts, defect)
Core
Layout: Text and Fonts
Tracking
()
RESOLVED
FIXED
mozilla1.8.1
People
(Reporter: nir123, Assigned: smontagu)
References
Details
(Keywords: fixed1.8.1, rtl, testcase)
Attachments
(3 files, 4 obsolete files)
|
223 bytes,
text/html; charset=windows-1255
|
Details | |
|
13.51 KB,
patch
|
uriber
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
|
11.99 KB,
patch
|
mtschrep
:
approval1.8.1+
|
Details | Diff | Splinter Review |
Grr. forgot the description :)
On RTL textarea, try to write a misspelled Hebrew word and then click the spacebar.
result: the red underline shifts to the the left after any spacebar clicking.
Summary: Underline shifts when click the spacebar after an unrecognized Hebrew word on RTL textarea → Underline shifts when clicking the spacebar after an unrecognized Hebrew word on RTL textarea
| Assignee | ||
Comment 2•19 years ago
|
||
Same bug on Linux, but only with --enable-pango. Setting All | All
Assignee: mscott → nobody
Component: Spelling checker → Layout: BiDi Hebrew & Arabic
OS: Windows XP → All
QA Contact: spelling-checker → layout.bidi
Hardware: PC → All
Updated•19 years ago
|
Flags: blocking1.8.1? → blocking1.8.1+
Target Milestone: --- → mozilla1.8.1
Comment 3•19 years ago
|
||
Can you please post a testcase? I don't know hebrew at all, or any good sites. If possible, can you also post some text I can paste in with exact steps to reproduce?
| Assignee | ||
Comment 4•19 years ago
|
||
I'm on this. The problem is at http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/generic/nsTextFrame.cpp&rev=1.587&mark=2588-2591#2576 which doesn't allow for Bidi.
Assignee: nobody → smontagu
Comment 5•19 years ago
|
||
Awesome, I would have never figured that out.
I added charset=windows-1255 to this testcase.
Attachment #234747 -
Attachment is obsolete: true
| Assignee | ||
Comment 8•19 years ago
|
||
Attachment #234811 -
Flags: review?(uriber)
Comment 9•19 years ago
|
||
Comment on attachment 234811 [details] [diff] [review]
Patch
Looks good. r=me.
You might want to fix the annoying indentation problem (starting with |if (!hideStandardSelection || displaySelection)|) while you're there.
Attachment #234811 -
Flags: review?(uriber) → review+
| Assignee | ||
Updated•19 years ago
|
Attachment #234811 -
Flags: superreview?(bzbarsky)
Comment 10•19 years ago
|
||
I'd like to see some documentation for the new args before I can reasonably sr this...
| Assignee | ||
Comment 11•19 years ago
|
||
Attachment #234811 -
Attachment is obsolete: true
Attachment #235197 -
Flags: superreview?(bzbarsky)
Attachment #234811 -
Flags: superreview?(bzbarsky)
| Assignee | ||
Comment 12•19 years ago
|
||
| Assignee | ||
Comment 13•19 years ago
|
||
Comment on attachment 235197 [details] [diff] [review]
Indentation fixed and documentation added
Removing review request for now. I had an idea to simplify this and other things.
Attachment #235197 -
Flags: superreview?(bzbarsky)
| Assignee | ||
Comment 14•19 years ago
|
||
Comment on attachment 235197 [details] [diff] [review]
Indentation fixed and documentation added
re-requesting sr. I will do the simplification later after the TextFrame rewrite.
Attachment #235197 -
Flags: superreview?(bzbarsky)
Attachment #235197 -
Flags: review+
Comment 15•19 years ago
|
||
Comment on attachment 235197 [details] [diff] [review]
Indentation fixed and documentation added
>Index: layout/generic/nsTextFrame.cpp
>+ * @param aSelectionIsMirrored whether the offsets of the selection have been
So wouldn't it make more sense to call this aSelectionPointsReversed or even aSelectionCoordsReversed? At least those names seem to make more sense to me... If you're ok with that, make that change throught the patch? If not, catch me and let's talk about naming this stuff? I'm not familiar with standard bidi terms, so maybe "mirrored" is a technical term here?
> void RenderString(nsIRenderingContext& aRenderingContext,
Same here, and this probably wants a cop of the comment on PaintTextDecorations.
>+ /**
>+ * @return whether the selection points were mirrored
And here, "reversed".
> nsTextFrame::PaintTextDecorations(nsIRenderingContext& aRenderingContext,
>+ * XXX In theory this should use the same logic as
>+ * SELECTION_SPELLCHECK for right-to-left frames, but I don't
>+ * know of any right-to-left language that uses an IME
Would handling this really make the code that much more complex? If so, can we at least assert that whatever situation we're not handling is not happening? If not, can we do the right thing here?
>@@ -3003,128 +3038,147 @@ nsTextFrame::PaintUnicodeText(nsPresCont
>+ selectionIsMirrored = AdjustSelectionPointsForBidi(sdptr, textLength,
>+ CHARTYPE_IS_RTL(charType),
>+ isOddLevel, isBidiSystem);
I'd prefer a linebreak after the '=' sign and more natural indenting of the arguments (lining up with the arguments right after the '(' ).
>+ PRBool isSelection = iter.GetSelectionColors(
>+ ¤tFGColor,
>+ ¤tBKColor,
>+ &isCurrentBKColorTransparent);
How about nixing the extra spaces after the "PRBool" instead? If things still don't fit in 80 chars, please put the linebreak after the '='.
By the way, check with roc before landing this reindentation? If it's going to make life hell for him, please don't do it....
>@@ -3684,35 +3741,36 @@ nsTextFrame::PaintTextSlowly(nsPresConte
>+ selectionIsMirrored = AdjustSelectionPointsForBidi(sdptr, textLength,
Again, linebreak after the '='.
| Assignee | ||
Comment 16•19 years ago
|
||
I apologize for wasting reviewers' time. I was looking for a scenario where I could test IMEs, and I realized with Uri's help that the patch went through some unnecessary hoops. The condition
if ((NS_GET_EMBEDDING_LEVEL(this) & 1) != aSelectionIsMirrored)
is equivalent to
if ((NS_GET_EMBEDDING_LEVEL(this) & 1) != (isOddLevel ^ (isRTLChars && isBidiSystem))
but (NS_GET_EMBEDDING_LEVEL(this) & 1) and (isOddLevel) are the same thing, so it reduces to just
if (isRTLChars && isBidiSystem)
and we already have a boolean for that, isRTLOnBidiPlatform.
Attachment #235197 -
Attachment is obsolete: true
Attachment #235198 -
Attachment is obsolete: true
Attachment #237956 -
Flags: superreview?(bzbarsky)
Attachment #237956 -
Flags: review?(uriber)
Attachment #235197 -
Flags: superreview?(bzbarsky)
Comment 17•19 years ago
|
||
Comment on attachment 237956 [details] [diff] [review]
Simpler patch
Seems fine.
Attachment #237956 -
Flags: review?(uriber) → review+
Comment 18•19 years ago
|
||
Comment on attachment 237956 [details] [diff] [review]
Simpler patch
>Index: layout/generic/nsTextFrame.cpp
> void PaintTextDecorations(nsIRenderingContext& aRenderingContext,
So... I should have caught this before, but could we make this arg NOT have a default value? Put it before aText or something? That way we can be sure we got all the callers, etc...
> void RenderString(nsIRenderingContext& aRenderingContext,
Same here.
>@@ -2560,33 +2571,53 @@ nsTextFrame::PaintTextDecorations(nsIRen
>+ * If the rendering context is drawing text from right-to-left,
"from right to left" (no dashes).
sr=bzbarsky with those nits.
Attachment #237956 -
Flags: superreview?(bzbarsky) → superreview+
Updated•19 years ago
|
Blocks: SpellCheckTracking
| Assignee | ||
Updated•19 years ago
|
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 19•19 years ago
|
||
Requesting 1.8.1 approval. This bug makes spellchecking almost unusable for right-to-left languages. The fix is very low risk, and only changes behaviour for the underline marking for right-to-left text.
(To make assurance doubly sure, when backporting to the branch I removed the code for IME selection, since it would need to be rewritten for the branch and I have no way of testing it anyway, and replaced it by an assertion as bz suggested)
Attachment #238195 -
Flags: approval1.8.1?
Comment 20•19 years ago
|
||
Comment on attachment 238195 [details] [diff] [review]
Branch patch
a=schrep
Attachment #238195 -
Flags: approval1.8.1? → approval1.8.1+
| Assignee | ||
Updated•19 years ago
|
Keywords: fixed1.8.1
| Assignee | ||
Updated•18 years ago
|
Attachment #234753 -
Attachment mime type: text/html → text/html; charset=windows-1255
Comment 21•17 years ago
|
||
Mass-assigning the new rtl keyword to RTL-related (see bug 349193).
Keywords: rtl
Component: Layout: BiDi Hebrew & Arabic → Layout: Text
QA Contact: layout.bidi → layout.fonts-and-text
You need to log in
before you can comment on or make changes to this bug.
Description
•