Bug 22304

Summary: [Transforms] Dictionary panel does not work correctly in transformed text
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: HTML EditingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: ASSIGNED ---    
Severity: Normal CC: mitz
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Bug Depends on: 15671    
Bug Blocks:    
Attachments:
Description Flags
Testcase none

Description Simon Fraser (smfr) 2008-11-16 22:47:43 PST
The Dictionary panel (Command-Control-D) doesn't work correctly on text in a transformed element. It seems to refuse to open up. I'm guessing it's related to the relative positions of the cursor and the reported selection rects.
Comment 1 Simon Fraser (smfr) 2008-12-01 21:16:06 PST
Created attachment 25660 [details]
Testcase
Comment 2 Simon Fraser (smfr) 2008-12-01 21:19:02 PST
The relevant call stack is 
#3  0x038bc680 in WebCore::RenderText::caretRect (this=0x1c90d00c, inlineBox=0x1c90a20c, caretOffset=25, extraWidthToEndOfLine=0xbfffdc1c) at /Volumes/Cassoulet/WebKit/WebKit.git/WebCore/rendering/RenderText.cpp:388
#4  0x035a4eef in WebCore::Frame::firstRectForRange (this=0x99fac0, range=0x1aff2480) at /Volumes/Cassoulet/WebKit/WebKit.git/WebCore/page/Frame.cpp:271
#5  0x001aff54 in -[WebFrame(WebInternal) _firstRectForDOMRange:] (self=0x99fb10, _cmd=0x26e514, range=0x1af9ecd0) at /Volumes/Cassoulet/WebKit/WebKit.git/WebKit/mac/WebView/WebFrame.mm:681
#6  0x001b1382 in -[WebFrame(WebInternal) _characterRangeAtPoint:] (self=0x99fb10, _cmd=0x25fe92, point={x = 179, y = 25}) at /Volumes/Cassoulet/WebKit/WebKit.git/WebKit/mac/WebView/WebFrame.mm:973
#7  0x001cbd87 in -[WebHTMLView(WebNSTextInputSupport) characterIndexForPoint:] (self=0x1aff5170, _cmd=0x94418798, thePoint={x = 179, y = 25}) at /Volumes/Cassoulet/WebKit/WebKit.git/WebKit/mac/WebView/WebHTMLView.mm:4963
#8  0x95772c6b in _NSTSMEventHandler ()

So this depends on the caretRect stuff.
Comment 3 Simon Fraser (smfr) 2008-12-06 18:50:06 PST
Note: the "start and end are on the same line" test in Frame::firstRectForRange() is wrong for transformed elements. But fixing this still doesn't make it work in all cases.