Changeset 112134 in webkit


Ignore:
Timestamp:
Mar 26, 2012 11:51:52 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

An <area> element remains focusable even though its associated <img> is not rendered.
https://bugs.webkit.org/show_bug.cgi?id=71788

Patch by Antaryami Pandia <antaryami.pandia@motorola.com> on 2012-03-26
Reviewed by Andy Estes.

Source/WebCore:

HTMLAreaElement::isFocusable() needs to consider the display and
visibility state.

Test: fast/events/tab-test-not-visible-imagemap.html

  • html/HTMLAreaElement.cpp:

(WebCore::HTMLAreaElement::imageElement):
(WebCore::HTMLAreaElement::isFocusable):

  • html/HTMLAreaElement.h: Make imageElement() const.

(HTMLAreaElement):

LayoutTests:

Test sequential focus navigation.

  • fast/events/tab-test-not-visible-imagemap-expected.txt: Added.
  • fast/events/tab-test-not-visible-imagemap.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r112133 r112134  
     12012-03-26  Antaryami Pandia  <antaryami.pandia@motorola.com>
     2
     3        An <area> element remains focusable even though its associated <img> is not rendered.
     4        https://bugs.webkit.org/show_bug.cgi?id=71788
     5
     6        Reviewed by Andy Estes.
     7
     8        Test sequential focus navigation.
     9
     10        * fast/events/tab-test-not-visible-imagemap-expected.txt: Added.
     11        * fast/events/tab-test-not-visible-imagemap.html: Added.
     12
    1132012-03-26  Ojan Vafai  <ojan@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r112130 r112134  
     12012-03-26  Antaryami Pandia  <antaryami.pandia@motorola.com>
     2
     3        An <area> element remains focusable even though its associated <img> is not rendered.
     4        https://bugs.webkit.org/show_bug.cgi?id=71788
     5
     6        Reviewed by Andy Estes.
     7
     8        HTMLAreaElement::isFocusable() needs to consider the display and
     9        visibility state.
     10
     11        Test: fast/events/tab-test-not-visible-imagemap.html
     12
     13        * html/HTMLAreaElement.cpp:
     14        (WebCore::HTMLAreaElement::imageElement):
     15        (WebCore::HTMLAreaElement::isFocusable):
     16        * html/HTMLAreaElement.h: Make imageElement() const.
     17        (HTMLAreaElement):
     18
    1192012-03-26  Anton Muhin  <antonm@chromium.org>
    220
  • trunk/Source/WebCore/html/HTMLAreaElement.cpp

    r111126 r112134  
    180180}
    181181
    182 HTMLImageElement* HTMLAreaElement::imageElement()
     182HTMLImageElement* HTMLAreaElement::imageElement() const
    183183{
    184184    Node* mapElement = parentNode();
     
    201201bool HTMLAreaElement::isFocusable() const
    202202{
     203    HTMLImageElement* image = imageElement();
     204    if (!image || !image->renderer() || image->renderer()->style()->visibility() != VISIBLE)
     205        return false;
     206
    203207    return supportsFocus() && Element::tabIndex() >= 0;
    204208}
  • trunk/Source/WebCore/html/HTMLAreaElement.h

    r106769 r112134  
    4646
    4747    // The parent map's image.
    48     HTMLImageElement* imageElement();
     48    HTMLImageElement* imageElement() const;
    4949   
    5050private:
Note: See TracChangeset for help on using the changeset viewer.