Closed
Bug 1088071
Opened 10 years ago
Closed 10 years ago
Move the final variant of nsRenderingContext::DrawString to nsLayoutUtils
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: jwatt, Assigned: jwatt)
References
Details
Attachments
(2 files)
4.84 KB,
patch
|
jfkthame
:
review+
jwatt
:
checkin+
|
Details | Diff | Splinter Review |
5.93 KB,
patch
|
jfkthame
:
review+
jwatt
:
checkin+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8510347 -
Flags: review?(jfkthame)
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8510348 -
Flags: review?(jfkthame)
Assignee | ||
Comment 3•10 years ago
|
||
I've exposed some nsRenderingContext methods for this, but those methods will be moved themselves shortly.
Comment 4•10 years ago
|
||
Comment on attachment 8510347 [details] [diff] [review] part 1 - Wrap the callers of the final nsRenderingContext::DrawString method up in an nsLayoutUtils method Review of attachment 8510347 [details] [diff] [review]: ----------------------------------------------------------------- How about something like DrawUnidirectionalString or DrawSingleDirectionString instead of DrawStringWithoutBidi?
Assignee | ||
Comment 5•10 years ago
|
||
Someone else can choose the name. I have no strong opinions there.
Comment 6•10 years ago
|
||
Comment on attachment 8510348 [details] [diff] [review] part 2 - Move the nsRenderingContext::DrawString code to nsLayoutUtils::DrawStringWithoutBidi Review of attachment 8510348 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/base/nsLayoutUtils.h @@ +1325,5 @@ > nsStyleContext* aStyleContext = nullptr); > > + /** > + * Supports only LTR or RTL. Bidi (mixed direction) is not supported. > + */ So it looks like the only two callers of this method are nsImageFrame::DisplayAltText (though if the text includes RTL characters, or the presContext has BidiEnabled, it'll go via nsBidiPresUtils::RenderText instead), and nsDisplayMathMLError::Paint, which just uses it to draw a hard-coded ASCII error string. Given this, I wonder if we need any kind of RTL support at all in this method? Can we strip it down and make it just DrawLTRString?
Assignee | ||
Comment 7•10 years ago
|
||
Don't forget the nsLayoutUtils::DrawString caller. I'm not adverse to stripping it down, but I'd rather do that as a follow-up.
Comment 8•10 years ago
|
||
Comment on attachment 8510347 [details] [diff] [review] part 1 - Wrap the callers of the final nsRenderingContext::DrawString method up in an nsLayoutUtils method Review of attachment 8510347 [details] [diff] [review]: ----------------------------------------------------------------- OK, but let's go with one of Simon's naming suggestions to replace DrawStringWithoutBidi. I guess I'd lean towards DrawUnidirectionalString, though all of the options are rather long... DrawUniDirString, anyone?
Attachment #8510347 -
Flags: review?(jfkthame) → review+
Comment 9•10 years ago
|
||
Comment on attachment 8510348 [details] [diff] [review] part 2 - Move the nsRenderingContext::DrawString code to nsLayoutUtils::DrawStringWithoutBidi Review of attachment 8510348 [details] [diff] [review]: ----------------------------------------------------------------- Fair enough. I still suspect we don't need RTL support here at all, though, and could simplify it accordingly; could you file a followup for us to check on that, please?
Attachment #8510348 -
Flags: review?(jfkthame) → review+
Assignee | ||
Comment 10•10 years ago
|
||
Surely to reflect "Bidi" it should be "Unidi". ;) (DrawUniDirString seems fine to me.)
Assignee | ||
Comment 11•10 years ago
|
||
Comment on attachment 8510347 [details] [diff] [review] part 1 - Wrap the callers of the final nsRenderingContext::DrawString method up in an nsLayoutUtils method https://hg.mozilla.org/integration/mozilla-inbound/rev/449a78f0febc
Attachment #8510347 -
Flags: checkin+
Assignee | ||
Comment 12•10 years ago
|
||
Comment on attachment 8510348 [details] [diff] [review] part 2 - Move the nsRenderingContext::DrawString code to nsLayoutUtils::DrawStringWithoutBidi https://hg.mozilla.org/integration/mozilla-inbound/rev/90cd5968c9ce
Attachment #8510348 -
Flags: checkin+
Assignee | ||
Comment 13•10 years ago
|
||
(In reply to Jonathan Kew (:jfkthame) from comment #9) > could you file a followup for us to check > on that, please? Bug 1088596.
Comment 14•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/449a78f0febc https://hg.mozilla.org/mozilla-central/rev/90cd5968c9ce
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in
before you can comment on or make changes to this bug.
Description
•