[webkit-changes] cvs commit: WebKit/WebCoreSupport.subproj
WebTextRenderer.m
Darin
darin at opensource.apple.com
Sat Sep 24 05:05:23 PDT 2005
darin 05/09/24 05:05:22
Modified: . ChangeLog
WebCoreSupport.subproj WebTextRenderer.m
Log:
Reviewed by Dave.
Landed by Darin.
- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4862
Incorrect layout of bidi overrides
* WebCoreSupport.subproj/WebTextRenderer.m:
(addDirectionalOverride): Renamed, and made it work in both directions.
(-[WebTextRenderer _ATSU_drawHighlightForRun:style:geometry:]): Updated to call addDirectionalOverride.
(-[WebTextRenderer _ATSU_drawRun:style:geometry:]): More of the same.
(-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:]): Ditto.
Revision Changes Path
1.3330 +14 -0 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3329
retrieving revision 1.3330
diff -u -r1.3329 -r1.3330
--- ChangeLog 24 Sep 2005 10:58:16 -0000 1.3329
+++ ChangeLog 24 Sep 2005 12:05:15 -0000 1.3330
@@ -1,3 +1,17 @@
+2005-09-24 Mitz Pettel <opendarwin.org at mitzpettel.com>
+
+ Reviewed by Dave.
+ Landed by Darin.
+
+ - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4862
+ Incorrect layout of bidi overrides
+
+ * WebCoreSupport.subproj/WebTextRenderer.m:
+ (addDirectionalOverride): Renamed, and made it work in both directions.
+ (-[WebTextRenderer _ATSU_drawHighlightForRun:style:geometry:]): Updated to call addDirectionalOverride.
+ (-[WebTextRenderer _ATSU_drawRun:style:geometry:]): More of the same.
+ (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:]): Ditto.
+
2005-09-24 Alexey Proskuryakov <ap at nypop.com>
Tweaked, reviewed, and landed by Darin.
1.190 +14 -13 WebKit/WebCoreSupport.subproj/WebTextRenderer.m
Index: WebTextRenderer.m
===================================================================
RCS file: /cvs/root/WebKit/WebCoreSupport.subproj/WebTextRenderer.m,v
retrieving revision 1.189
retrieving revision 1.190
diff -u -r1.189 -r1.190
--- WebTextRenderer.m 25 Aug 2005 23:46:30 -0000 1.189
+++ WebTextRenderer.m 24 Sep 2005 12:05:22 -0000 1.190
@@ -54,6 +54,7 @@
#define ZERO_WIDTH_SPACE 0x200B
#define POP_DIRECTIONAL_FORMATTING 0x202C
#define LEFT_TO_RIGHT_OVERRIDE 0x202D
+#define RIGHT_TO_LEFT_OVERRIDE 0x202E
// MAX_GLYPH_EXPANSION is the maximum numbers of glyphs that may be
// use to represent a single Unicode code point.
@@ -1546,7 +1547,7 @@
}
// Be sure to free the run.characters allocated by this function.
-static WebCoreTextRun reverseCharactersInRun(const WebCoreTextRun *run)
+static WebCoreTextRun addDirectionalOverride(const WebCoreTextRun *run, BOOL rtl)
{
WebCoreTextRun swappedRun;
@@ -1555,7 +1556,7 @@
swappedRun.from = (run->from == -1 ? 0 : run->from) + 1;
swappedRun.to = (run->to == -1 ? (int)run->length - 1 : run->to + 1);
swappedRun.length = run->length+2;
- swappedCharacters[swappedRun.from - 1] = LEFT_TO_RIGHT_OVERRIDE;
+ swappedCharacters[swappedRun.from - 1] = rtl ? RIGHT_TO_LEFT_OVERRIDE : LEFT_TO_RIGHT_OVERRIDE;
swappedCharacters[swappedRun.to] = POP_DIRECTIONAL_FORMATTING;
swappedRun.characters = swappedCharacters;
@@ -1596,8 +1597,8 @@
if (style->backgroundColor == nil)
return;
- if (style->visuallyOrdered) {
- swappedRun = reverseCharactersInRun(run);
+ if (style->directionalOverride) {
+ swappedRun = addDirectionalOverride(run, style->rtl);
aRun = &swappedRun;
} else if (style->rtl && !ATSUMirrors) {
swappedRun = applyMirroringToRun(run);
@@ -1641,7 +1642,7 @@
float yPos = geometry->useFontMetricsForSelectionYAndHeight ? geometry->point.y - [self ascent] : geometry->selectionY;
float height = geometry->useFontMetricsForSelectionYAndHeight ? [self lineSpacing] : geometry->selectionHeight;
- if (style->rtl || style->visuallyOrdered){
+ if (style->rtl || style->directionalOverride){
WebCoreTextRun completeRun = *aRun;
completeRun.from = 0;
completeRun.to = aRun->length;
@@ -1654,7 +1655,7 @@
ATSUDisposeTextLayout (layout); // Ignore the error. Nothing we can do anyway.
- if (style->visuallyOrdered || (style->rtl && !ATSUMirrors))
+ if (style->directionalOverride || (style->rtl && !ATSUMirrors))
free ((void *)swappedRun.characters);
}
@@ -1671,8 +1672,8 @@
const WebCoreTextRun *aRun = run;
WebCoreTextRun swappedRun;
- if (style->visuallyOrdered) {
- swappedRun = reverseCharactersInRun(run);
+ if (style->directionalOverride) {
+ swappedRun = addDirectionalOverride(run, style->rtl);
aRun = &swappedRun;
} else if (style->rtl && !ATSUMirrors) {
swappedRun = applyMirroringToRun(run);
@@ -1710,7 +1711,7 @@
ATSUDisposeTextLayout (layout); // Ignore the error. Nothing we can do anyway.
- if (style->visuallyOrdered || (style->rtl && !ATSUMirrors))
+ if (style->directionalOverride || (style->rtl && !ATSUMirrors))
free ((void *)swappedRun.characters);
}
@@ -1728,9 +1729,9 @@
const WebCoreTextRun *aRun = run;
WebCoreTextRun swappedRun;
- // Enclose in LRO-PDF to force ATSU to render visually.
- if (style->visuallyOrdered) {
- swappedRun = reverseCharactersInRun(run);
+ // Enclose in LRO/RLO - PDF to force ATSU to render visually.
+ if (style->directionalOverride) {
+ swappedRun = addDirectionalOverride(run, style->rtl);
aRun = &swappedRun;
} else if (style->rtl && !ATSUMirrors) {
swappedRun = applyMirroringToRun(run);
@@ -1753,7 +1754,7 @@
ATSUDisposeTextLayout(layout);
- if (style->visuallyOrdered || (style->rtl && !ATSUMirrors)) {
+ if (style->directionalOverride || (style->rtl && !ATSUMirrors)) {
free ((void *)swappedRun.characters);
}
More information about the webkit-changes
mailing list