RESOLVED FIXED 20443
Certain parts of link are not clickable when there is frameset
https://bugs.webkit.org/show_bug.cgi?id=20443
Summary Certain parts of link are not clickable when there is frameset
Eric Roman
Reported 2008-08-18 20:26:27 PDT
There is glitch with links not being clickable when there is a nearby frame divider. The links are not clickable precisely at the y coordinate where the adjacent frame divider is. please see the forthcoming repro case for better explanation.
Attachments
Load index.html, then follow the instructions in bottom-right pane. (1.12 KB, application/zip)
2008-08-18 20:27 PDT, Eric Roman
no flags
Fix for bug. Not yet ready for submitting. (2.55 KB, patch)
2008-08-27 07:29 PDT, Brad Garcia
no flags
Layout test (2.84 KB, text/plain)
2008-08-27 13:05 PDT, Eric Roman
no flags
Final fix for bug. (4.35 KB, patch)
2008-08-28 07:17 PDT, Brad Garcia
hyatt: review-
Fix for bug (4.35 KB, patch)
2008-08-29 08:58 PDT, Brad Garcia
no flags
Updated patch incorporating feedback (5.27 KB, patch)
2008-09-26 10:48 PDT, Brad Garcia
eric: review+
Eric Roman
Comment 1 2008-08-18 20:27:56 PDT
Created attachment 22873 [details] Load index.html, then follow the instructions in bottom-right pane.
Brad Garcia
Comment 2 2008-08-26 16:11:19 PDT
I've found the problem & I have a fix. I need to come up with a test to include with the patch. Can somebody recommend a way to create a test for this? If I included something like the first attachment in this bug report, would that actually generate expected output to show that it's now clickable? If not, is there some other way to write a test for this?
Eric Roman
Comment 3 2008-08-26 17:13:11 PDT
How about a text dump layout test, which prints SUCCESS when the link is clicked. Something along these lines: <style> a { /* position it such that it has dead spot at (X,Y) */ } </style> <a href="#" onclick="return onLinkClick()">LINK TO CLICK</a> <script> if (window.layoutTestController) { window.dumpAsText(); // Click in a dead position window.eventSender.mouseMoveTo(X, Y); window.eventSender.mouseDown(); window.eventSender.mouseUp(); } function onLinkClicked() { window.console.logln("SUCCESS -- the link was clicked"); return false; // Prevent default. } </script>
Brad Garcia
Comment 4 2008-08-27 07:29:41 PDT
Created attachment 23030 [details] Fix for bug. Not yet ready for submitting. Here is the fix. The problem was that the interior frameset was saying that the mouse was over one of the borders, and therefore resizable (because the Y-position matched, and we didn't check the X-position because of the use of OR instead of AND). Then we wouldn't bother checking the left frame, which is where the mouse was actually located. I could still use some help developing a test for this, if someone doesn't mind holding my hand. The window.eventSender stuff isn't working.
Eric Roman
Comment 5 2008-08-27 13:05:34 PDT
Created attachment 23039 [details] Layout test Thanks Brad, the patch looks good! I can help you with the layout test . Attached is a modified version which works for me (tested on mac os x, not windows yet) When you are ready for review, upload your patch and set the review:? flag so that a webkit committer can take a look.
Brad Garcia
Comment 6 2008-08-28 07:17:17 PDT
Created attachment 23053 [details] Final fix for bug. Thanks for the help, Eric!
Eric Seidel (no email)
Comment 7 2008-08-28 13:19:43 PDT
Comment on attachment 23053 [details] Final fix for bug. Won't this break normal resizing? With this patch you can only resize frames when you click on the intersection of their split regions no? I would be more confident of this change if you had a test which tested expected frame set adjustment behavior. Where you clicked on the various parts of the adjuster and tried to adjust the frames and made sure they changed size. Leaving r=? since maybe this does actually work, but it looks to me like this breaks normal resizing when you don't click on the intersection of the resize bars.
Eric Roman
Comment 8 2008-08-28 17:05:17 PDT
(I thought the same thing initially, but after patching into my build did not observe this limitation)
Eric Roman
Comment 9 2008-08-28 17:08:13 PDT
> + function onLinkClick() { WebKit style says curly braces should be on following line for functions. As in: function onLinkClick() {
Dave Hyatt
Comment 10 2008-08-28 19:20:50 PDT
Comment on attachment 23053 [details] Final fix for bug. This patch isn't right. canResize is fine. The issue is higher up (in nodeAtPoint).
Dave Hyatt
Comment 11 2008-08-28 19:24:04 PDT
I think this check is the troublesome one: bool inside = RenderContainer::nodeAtPoint(request, result, x, y, tx, ty, action) || m_isResizing || canResize(IntPoint(x, y)); My memory of this code is hazy (I'm the one who rewrote it most recently I guess), but I think RenderContainer::nodeAtPoint needs to be true in order for you to check canResize.
Dave Hyatt
Comment 12 2008-08-28 19:26:58 PDT
Make a 2-dimensional frameset (with both rows and columns) and you'll see why your patch is wrong. You will only return true from canResize if you're over joins of vertical and horizontal splitters.
Dave Hyatt
Comment 13 2008-08-28 19:32:19 PDT
I actually don't even remember why this canResize check is present in nodeAtPoint.
Dave Hyatt
Comment 14 2008-08-28 19:34:21 PDT
I'd suggest just yanking the canResize check completely from nodeAtPoint and see if anything breaks. :)
Brad Garcia
Comment 15 2008-08-29 08:22:05 PDT
(In reply to comment #12) > Make a 2-dimensional frameset (with both rows and columns) and you'll see why > your patch is wrong. You will only return true from canResize if you're over > joins of vertical and horizontal splitters. I've done just this, and I'm still able to resize at any point along the splitters. Strange. Have you tried it with this patch? But I agree that this fix is incorrect. Your explanation that canResize should only be called when nodeAtPoint is true made the code clearer to me. I'll test simply removing the call to canResize.
Brad Garcia
Comment 16 2008-08-29 08:58:22 PDT
Created attachment 23069 [details] Fix for bug Removing the call to canResize appears to solve the problem with no other anomalies noticed.
Eric Seidel (no email)
Comment 17 2008-08-29 17:08:55 PDT
Comment on attachment 23069 [details] Fix for bug It would still be great to have additional tests which test for clicking on the resize area and dragging to resize the frameset. Although perhaps that's outside the scope of this bug.
Darin Adler
Comment 18 2008-09-21 13:51:01 PDT
Comment on attachment 23069 [details] Fix for bug If the correct thing to do here is to remove the canResize function call, then the implementation of canResize also needs to be removed altogether. We don't want to leave dead code around. The ChangeLog doesn't match the patch. The log says the function being changed is RenderFrameSet::canResize, but the patch is a change to RenderFrameSet::nodeAtPoint.
Brad Garcia
Comment 19 2008-09-26 10:48:02 PDT
Created attachment 23855 [details] Updated patch incorporating feedback
Eric Seidel (no email)
Comment 20 2008-12-01 15:28:03 PST
Comment on attachment 23855 [details] Updated patch incorporating feedback I think the test could have been better. With both positive and negative tests made. (sythesized clicks which should both fail and succeed, on each side of the resize bar). But the change itself looks fine, at least it matches what Darin and Hyatt asked of you. Sorry this took over a month to get through the review queue :(
Brent Fulgham
Comment 21 2009-02-03 21:00:26 PST
Committed in revision 40605.
Note You need to log in before you can comment on or make changes to this bug.