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
Created attachment 28031 [details] test case for wrong underline problem in link text
The related Chrome bug is: http://code.google.com/p/chromium/issues/detail?id=7252
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.
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 on attachment 29403 [details] Patch 1 Clearing review flag since I'm rolling this fix into the patch for bug 25135
Fixed in http://trac.webkit.org/changeset/43664.