Summary: | positionForPoint is broken when a block is positioned relatively inside the parent | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||||||||||
Component: | HTML Editing | Assignee: | Ryosuke Niwa <rniwa> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | dglazkov, eae, hyatt, leviw, mitz, simon.fraser, webkit.review.bot | ||||||||||||
Priority: | P2 | ||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||
Hardware: | Unspecified | ||||||||||||||
OS: | Unspecified | ||||||||||||||
Attachments: |
|
Description
Ryosuke Niwa
2011-07-11 10:48:40 PDT
Created attachment 100325 [details]
demo
The problem seems to be that RenderBox::location() is not updated for this node: (gdb) p child->showTreeForThis() BODY 0x107478e40 #text 0x10a818690 "\n" * DIV 0x10a80cec0 STYLE=position: relative; left: 50px; padding-bottom: 20px; border: solid 1px #text 0x10a8186f0 "\nClick on the left of this box. The caret is placed at a wrong location.\n" #text 0x10a818e80 "\n" DIV 0x10a8172d0 #text 0x10a826330 "Selected text:" CODE 0x10a819240 DIV 0x1074701e0 #text 0x107470510 "\n" SCRIPT 0x107470570 #text 0x107470790 "\n\nfunction update() {\n document.getElementById('log').textContent = window.getSelection().toString();\n}\n\n" #text 0x107472450 "\n\n\n" $7 = void (gdb) p child->location() $8 = { m_x = 0, m_y = 0 } RenderView 0x107474fa8 #document 0x108056000 RenderBlock 0x107473cc8 HTML 0x107473350 RenderBody 0x10a817cb8 BODY 0x107478e40 * RenderBlock (relative positioned) 0x10a8120e8 DIV 0x10a80cec0 STYLE=position: relative; left: 50px; padding-bottom: 20px; border: solid 1px RenderText 0x10a8121b8 #text 0x10a8186f0 "\nClick on the left of this box. The caret is placed at a wrong location.\n" RenderBlock 0x10a819108 DIV 0x10a8172d0 RenderBlock (anonymous) 0x107470458 RenderText 0x10a8191d8 #text 0x10a826330 "Selected text:" RenderInline 0x1074700f8 CODE 0x10a819240 RenderBlock 0x107470318 DIV 0x1074701e0 I find it hard to believe that hit testing on all position:relative blocks is broken. (In reply to comment #4) > I find it hard to believe that hit testing on all position:relative blocks is broken. It's broken when left or top is specified and the block is inside the parent. Created attachment 100364 [details]
demo 2
It's actually harder to find cases where hit-testing is working.
But it's not. I can select the text just fine. This is something about placing the caret. (In reply to comment #7) > But it's not. I can select the text just fine. This is something about placing the caret. I can't select text properly in any of the boxes in "demo 2". demo 2 works fine for me. Maybe there's a chromium issue? (In reply to comment #9) > demo 2 works fine for me. Maybe there's a chromium issue? No, I'm using WebKit Nightly. To demonstrate this bug, you have to start your mouse drag outside of the dark border but inside the light border. (In reply to comment #9) > demo 2 works fine for me. Maybe there's a chromium issue? For a future reference, I almost never use chromium port for testing. Created attachment 100376 [details]
fixes the bug
Simon, sorry about the confusing :( Hopefully this patch clarifies what needs to be fixed. Comment on attachment 100376 [details] fixes the bug Attachment 100376 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9010628 New failing tests: fast/block/positioning/hittest-on-relative-positioned-children.html Created attachment 100380 [details]
Archive of layout-test-results from ec2-cr-linux-03
The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-03 Port: Chromium Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Created attachment 100383 [details]
fixed the test
Comment on attachment 100383 [details] fixed the test Clearing flags on attachment: 100383 Committed r90800: <http://trac.webkit.org/changeset/90800> All reviewed patches have been landed. Closing bug. |