Bug 24206 - RTL: the underline of overflowed RTL link text in hyperlink only underlined partial of the text
Summary: RTL: the underline of overflowed RTL link text in hyperlink only underlined p...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 525.x (Safari 3.2)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-26 12:47 PST by Xiaomei Ji
Modified: 2009-05-13 15:34 PDT (History)
4 users (show)

See Also:


Attachments
test case for wrong underline problem in link text (1.16 KB, text/html)
2009-02-26 12:48 PST, Xiaomei Ji
no flags Details
Patch 1 (5.66 KB, patch)
2009-04-10 15:13 PDT, Jeremy Moskovich
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xiaomei Ji 2009-02-26 12:47:25 PST
Test case is attached.

Open the test case in Safari, you can see the underline of the link text in hyperlink only underlines partial of the text.

It only happens for over-flow RTL text and text-overflow is ellipsis (not clip), and only happens if there is 
"<!DOCTYPE html>" at the beginning of the document.

Partial underline happens in both Safari 3.2 and nightly build,
although there are other differences between Safari 3.2 and nightly build, such as 
1. the wrong position of ellipsis in Safari 3.2: https://bugs.webkit.org/show_bug.cgi?id=23471, and
2. the wrong truncation of leading English word in nightly build: https://bugs.webkit.org/show_bug.cgi?id=24186
Comment 1 Xiaomei Ji 2009-02-26 12:48:42 PST
Created attachment 28031 [details]
test case for wrong underline problem in link text
Comment 2 Xiaomei Ji 2009-02-26 12:50:11 PST
The related Chrome bug is:
http://code.google.com/p/chromium/issues/detail?id=7252
Comment 3 Jeremy Moskovich 2009-04-10 15:00:46 PDT
The reason the underline isn't drawn correctly here is because it turns out that the underline for inline boxes has two separate codepaths:

InlineTextBox::paintDecoration() for quirks mode
InlineFlowBox::paintTextDecorations for standards mode

While the first one handles RTL correctly, the InlineFlowBox case does not.
Comment 4 Jeremy Moskovich 2009-04-10 15:13:11 PDT
Created attachment 29403 [details]
Patch 1

This fixes the drawing code but I'd really appreciate some comments regarding the math.

I'm entirely unclear on why we need to add m_x to ellipsisX to convert it into the same coordinate system as x?

Thanks!
Comment 5 Jeremy Moskovich 2009-05-01 15:23:10 PDT
Comment on attachment 29403 [details]
Patch 1

Clearing review flag since I'm rolling this fix into the patch for bug 25135
Comment 6 Dimitri Glazkov (Google) 2009-05-13 15:34:04 PDT
Fixed in http://trac.webkit.org/changeset/43664.