[Webkit-unassigned] [Bug 137597] Support activation behavior of link element

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 10 22:27:14 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=137597


Benjamin Poulain <benjamin at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #239605|review?                     |review-
               Flag|                            |




--- Comment #2 from Benjamin Poulain <benjamin at webkit.org>  2014-10-10 22:27:09 PST ---
(From update of attachment 239605)
View in context: https://bugs.webkit.org/attachment.cgi?id=239605&action=review

The patch is great. The changelogs are great. The tests are really well done.

r- because of the duplicated isLinkClick() in HTMLLinkElement and HTMLAnchorElement. Otherwise this is nearly perfect.

> Source/WebCore/html/HTMLLinkElement.cpp:413
> +bool HTMLLinkElement::isLinkClick(Event* event)
> +{
> +    return event->type() == eventNames().clickEvent && (!is<MouseEvent>(*event) || downcast<MouseEvent>(*event).button() != RightButton);
> +}

Since this code is duplicated in HTMLAnchorElement, we should put it in a common place.

I suggest adding a static function "isRightClick" to the class MouseEvent. Then modify HTMLAnchorElement and HTMLLinkElement to use that function.

> Source/WebCore/html/HTMLLinkElement.cpp:420
> +    if (url.isNull())
> +        return;

I believe this is an interesting case, there should be a test for it if possible.

Maybe:
1) Create a click event with document.createEvent.
2) Send it to the <link> element with dispatchEvent()
3) Verify that the event has its default handled.
4) Set a time to 100ms. If the document has not navigated anywhere after the 100ms, finish the test with success.

This might even work when opened on Firefox...

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list