Bug 138071

Summary: Images with usemap should not have a link state
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, ap, buildbot, cfleizach, commit-queue, dmazzoni, esprehn+autocc, gyuyoung.kim, jcraig, jdiggs, kangil.han, mario, rniwa, samuel_white
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch kling: review+

Description Benjamin Poulain 2014-10-25 19:18:00 PDT
Images with usemap should not have a link state
Comment 1 Benjamin Poulain 2014-10-25 19:27:52 PDT
Created attachment 240458 [details]
Patch
Comment 2 Andreas Kling 2014-10-26 12:53:23 PDT
Comment on attachment 240458 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=240458&action=review

r=me

> Source/WebCore/ChangeLog:11
> +        Unfortunatelly, the Accessibility code was relying on the wrong behavior

Unfortunately

> Source/WebCore/ChangeLog:27
> +        More with its setter for clarity.

Move
Comment 3 Benjamin Poulain 2014-10-26 21:28:44 PDT
Committed r175213: <http://trac.webkit.org/changeset/175213>
Comment 4 Darin Adler 2014-10-27 09:36:42 PDT
Comment on attachment 240458 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=240458&action=review

> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:2458
> +    if (node && is<HTMLImageElement>(*node) && !downcast<HTMLImageElement>(*node).fastGetAttribute(usemapAttr).isNull())
> +        return ImageMapRole;

Writing !fastGetAttribute(x).isNull() is a more wordy roundabout way of writing fastHasAttribute(x); we should probably use fastHasAttribute instead.
Comment 5 Benjamin Poulain 2014-10-27 11:32:27 PDT
(In reply to comment #4)
> Comment on attachment 240458 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=240458&action=review
> 
> > Source/WebCore/accessibility/AccessibilityRenderObject.cpp:2458
> > +    if (node && is<HTMLImageElement>(*node) && !downcast<HTMLImageElement>(*node).fastGetAttribute(usemapAttr).isNull())
> > +        return ImageMapRole;
> 
> Writing !fastGetAttribute(x).isNull() is a more wordy roundabout way of
> writing fastHasAttribute(x); we should probably use fastHasAttribute instead.

Indeed, will fix.
Comment 6 Alexey Proskuryakov 2014-10-27 19:50:38 PDT
Ben landed the cleanup in <https://trac.webkit.org/r175233>, which broke many tests. Hopefully fixed in <https://trac.webkit.org/r175237> (untested).
Comment 7 Benjamin Poulain 2014-10-27 20:35:09 PDT
Arg, that was dumb :(

Thanks for fixing Alexey.