Changeset 88555 in webkit


Ignore:
Timestamp:
Jun 10, 2011 12:43:23 PM (13 years ago)
Author:
rwlbuis@webkit.org
Message:

2011-06-10 Rob Buis <rbuis@rim.com>

Reviewed by Nikolas Zimmermann.

animation event handling broken: focusin
https://bugs.webkit.org/show_bug.cgi?id=12894

focusin, focusout, activate not implemented in SVG
https://bugs.webkit.org/show_bug.cgi?id=40545

Test whether focusin and focusout events are dispatched and seen in the focusin/focusout event handlers.

  • platform/mac/svg/custom/focus-ring-expected.txt:
  • svg/custom/focus-event-handling-expected.txt: Added.
  • svg/custom/focus-event-handling-keyboard-expected.txt: Added.
  • svg/custom/focus-event-handling-keyboard.xhtml: Added.
  • svg/custom/focus-event-handling.xhtml: Added.
  • svg/custom/resources/focus-event-handling-keyboard.js: Added. (focusinHandler): (focusoutHandler):
  • svg/custom/resources/focus-event-handling.js: Added. (clearFocusSeen): (): (focusoutHandler): (clickAt):

2011-06-10 Rob Buis <rbuis@rim.com>

Reviewed by Nikolas Zimmermann.

amation event handling broken: focusin
https://bugs.webkit.org/show_bug.cgi?id=12894

focusin, focusout, activate not implemented in SVG
https://bugs.webkit.org/show_bug.cgi?id=40545

Make elements that should support GraphicalEventAttribute handle focussing, since focusin, focusout is part of that:

http://www.w3.org/TR/SVG11/intro.html#TermGraphicalEventAttribute

Match Opera behaviour ; elements that support GraphicalEventAttribute can receive visual mouse focus when having either a focusin or focusout event handler. Elements that support GraphicalEventAttribute can receive visual keyboard focus when having either a focusin or focusout event handler. Keyboard focus does not advance to SVG elements that are not focusable at the time.

Tests: svg/custom/focus-event-handling-keyboard.xhtml

svg/custom/focus-event-handling.xhtml

  • rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::computeRectForRepaint):
  • svg/SVGCircleElement.h: (WebCore::SVGCircleElement::supportsFocus):
  • svg/SVGEllipseElement.h: (WebCore::SVGEllipseElement::supportsFocus):
  • svg/SVGGElement.h: (WebCore::SVGGElement::supportsFocus):
  • svg/SVGImageElement.h: (WebCore::SVGImageElement::supportsFocus):
  • svg/SVGLineElement.h: (WebCore::SVGLineElement::supportsFocus):
  • svg/SVGPathElement.h: (WebCore::SVGPathElement::supportsFocus):
  • svg/SVGPolyElement.h: (WebCore::SVGPolyElement::supportsFocus):
  • svg/SVGRectElement.h: (WebCore::SVGRectElement::supportsFocus):
  • svg/SVGSVGElement.h: (WebCore::SVGSVGElement::supportsFocus):
  • svg/SVGStyledElement.cpp: (WebCore::SVGStyledElement::isMouseFocusable): (WebCore::SVGStyledElement::isKeyboardFocusable):
  • svg/SVGStyledElement.h:
  • svg/SVGSwitchElement.h: (WebCore::SVGSwitchElement::supportsFocus):
  • svg/SVGSymbolElement.h: (WebCore::SVGSymbolElement::supportsFocus):
  • svg/SVGTextElement.h: (WebCore::SVGTextElement::supportsFocus):
  • svg/SVGUseElement.h: (WebCore::SVGUseElement::supportsFocus):
Location:
trunk
Files:
6 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r88549 r88555  
     12011-06-10  Rob Buis  <rbuis@rim.com>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        animation event handling broken: focusin
     6        https://bugs.webkit.org/show_bug.cgi?id=12894
     7
     8        focusin, focusout, activate not implemented in SVG
     9        https://bugs.webkit.org/show_bug.cgi?id=40545
     10
     11        Test whether focusin and focusout events are dispatched and seen in the focusin/focusout event handlers.
     12
     13        * platform/mac/svg/custom/focus-ring-expected.txt:
     14        * svg/custom/focus-event-handling-expected.txt: Added.
     15        * svg/custom/focus-event-handling-keyboard-expected.txt: Added.
     16        * svg/custom/focus-event-handling-keyboard.xhtml: Added.
     17        * svg/custom/focus-event-handling.xhtml: Added.
     18        * svg/custom/resources/focus-event-handling-keyboard.js: Added.
     19        (focusinHandler):
     20        (focusoutHandler):
     21        * svg/custom/resources/focus-event-handling.js: Added.
     22        (clearFocusSeen):
     23        ():
     24        (focusoutHandler):
     25        (clickAt):
     26
    1272011-06-10  Abhishek Arya  <inferno@chromium.org>
    228
  • trunk/LayoutTests/platform/mac/svg/custom/focus-ring-expected.txt

    r69386 r88555  
    33layer at (0,0) size 800x600
    44  RenderSVGRoot {svg} at (10,10) size 437x527
    5     RenderSVGPath {circle} at (15,10) size 100x100 [fill={[type=SOLID] [color=#FFA500]}] [cx=65.00] [cy=60.00] [r=50.00]
    6     RenderSVGPath {path} at (140,10) size 100x100 [fill={[type=SOLID] [color=#FFA500]}] [data="M 140 10 L 190 110 L 240 60 L 220 60 L 200 30 Z"]
    7     RenderSVGContainer {g} at (270,10) size 100x100
    8       RenderSVGPath {rect} at (270,10) size 100x100 [fill={[type=SOLID] [color=#FFA500]}] [x=270.00] [y=10.00] [width=100.00] [height=100.00]
     5    RenderSVGPath {circle} at (10,5) size 110x110 [fill={[type=SOLID] [color=#FFA500]}] [cx=65.00] [cy=60.00] [r=50.00]
     6    RenderSVGPath {path} at (135,5) size 110x110 [fill={[type=SOLID] [color=#FFA500]}] [data="M 140 10 L 190 110 L 240 60 L 220 60 L 200 30 Z"]
     7    RenderSVGContainer {g} at (265,5) size 110x110
     8      RenderSVGPath {rect} at (265,5) size 110x110 [fill={[type=SOLID] [color=#FFA500]}] [x=270.00] [y=10.00] [width=100.00] [height=100.00]
    99    RenderSVGContainer {g} at (10,140) size 137x137 [transform={m=((0.87,0.50)(-0.50,0.87)) t=(60.00,140.00)}]
    10       RenderSVGPath {rect} at (10,140) size 137x137 [fill={[type=SOLID] [color=#FFA500]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
    11     RenderSVGPath {rect} at (150,140) size 137x137 [transform={m=((0.87,0.50)(-0.50,0.87)) t=(200.00,140.00)}] [fill={[type=SOLID] [color=#FFA500]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
    12     RenderSVGContainer {g} at (310,140) size 137x137
    13       RenderSVGPath {rect} at (310,140) size 137x137 [transform={m=((0.87,0.50)(-0.50,0.87)) t=(360.00,140.00)}] [fill={[type=SOLID] [color=#FFA500]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
     10      RenderSVGPath {rect} at (3,133) size 151x151 [fill={[type=SOLID] [color=#FFA500]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
     11    RenderSVGPath {rect} at (143,133) size 151x151 [transform={m=((0.87,0.50)(-0.50,0.87)) t=(200.00,140.00)}] [fill={[type=SOLID] [color=#FFA500]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
     12    RenderSVGContainer {g} at (305,135) size 147x147
     13      RenderSVGPath {rect} at (305,135) size 147x147 [transform={m=((0.87,0.50)(-0.50,0.87)) t=(360.00,140.00)}] [fill={[type=SOLID] [color=#FFA500]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
    1414    RenderSVGText {text} at (10,306) size 76x18 contains 1 chunk(s)
    1515      RenderSVGInlineText {#text} at (0,0) size 76x18
     
    1818      RenderSVGInlineText {#text} at (0,0) size 76x18
    1919        chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 12 width 76.00: "focused text"
    20     RenderSVGContainer {g} at (198,307) size 75x55
     20    RenderSVGContainer {g} at (193,302) size 85x65
    2121      RenderSVGText {text} at (0,-14) size 76x18 contains 1 chunk(s)
    2222        RenderSVGInlineText {#text} at (0,0) size 76x18
     
    2424    RenderSVGResourceClipper {clipPath} [id="clip"] [clipPathUnits=userSpaceOnUse]
    2525      RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
    26     RenderSVGImage {image} at (0,0) size 0x0
     26    RenderSVGImage {image} at (0,0) size 5x5
    2727      [clipPath="clip"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x100
    28     RenderSVGImage {image} at (150,400) size 137x137 [transform={m=((0.87,0.50)(-0.50,0.87)) t=(200.00,400.00)}]
     28    RenderSVGImage {image} at (143,393) size 151x151 [transform={m=((0.87,0.50)(-0.50,0.87)) t=(200.00,400.00)}]
    2929      [clipPath="clip"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x100
    30     RenderSVGContainer {g} at (310,400) size 137x137 [transform={m=((0.87,0.50)(-0.50,0.87)) t=(360.00,400.00)}]
    31       RenderSVGImage {image} at (310,400) size 137x137
     30    RenderSVGContainer {g} at (303,393) size 151x151 [transform={m=((0.87,0.50)(-0.50,0.87)) t=(360.00,400.00)}]
     31      RenderSVGImage {image} at (303,393) size 151x151
    3232        [clipPath="clip"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x100
  • trunk/Source/WebCore/ChangeLog

    r88553 r88555  
     12011-06-10  Rob Buis  <rbuis@rim.com>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        amation event handling broken: focusin
     6        https://bugs.webkit.org/show_bug.cgi?id=12894
     7
     8        focusin, focusout, activate not implemented in SVG
     9        https://bugs.webkit.org/show_bug.cgi?id=40545
     10
     11        Make elements that should support GraphicalEventAttribute handle focussing, since focusin, focusout is part of that:
     12
     13        http://www.w3.org/TR/SVG11/intro.html#TermGraphicalEventAttribute
     14
     15        Match Opera behaviour ; elements that support GraphicalEventAttribute can receive visual mouse focus when having either a focusin or focusout event handler. Elements that support GraphicalEventAttribute can receive visual keyboard focus when having either a focusin or focusout event handler. Keyboard focus does not advance to SVG elements that are not focusable at the time.
     16
     17        Tests: svg/custom/focus-event-handling-keyboard.xhtml
     18               svg/custom/focus-event-handling.xhtml
     19
     20        * rendering/svg/SVGRenderSupport.cpp:
     21        (WebCore::SVGRenderSupport::computeRectForRepaint):
     22        * svg/SVGCircleElement.h:
     23        (WebCore::SVGCircleElement::supportsFocus):
     24        * svg/SVGEllipseElement.h:
     25        (WebCore::SVGEllipseElement::supportsFocus):
     26        * svg/SVGGElement.h:
     27        (WebCore::SVGGElement::supportsFocus):
     28        * svg/SVGImageElement.h:
     29        (WebCore::SVGImageElement::supportsFocus):
     30        * svg/SVGLineElement.h:
     31        (WebCore::SVGLineElement::supportsFocus):
     32        * svg/SVGPathElement.h:
     33        (WebCore::SVGPathElement::supportsFocus):
     34        * svg/SVGPolyElement.h:
     35        (WebCore::SVGPolyElement::supportsFocus):
     36        * svg/SVGRectElement.h:
     37        (WebCore::SVGRectElement::supportsFocus):
     38        * svg/SVGSVGElement.h:
     39        (WebCore::SVGSVGElement::supportsFocus):
     40        * svg/SVGStyledElement.cpp:
     41        (WebCore::SVGStyledElement::isMouseFocusable):
     42        (WebCore::SVGStyledElement::isKeyboardFocusable):
     43        * svg/SVGStyledElement.h:
     44        * svg/SVGSwitchElement.h:
     45        (WebCore::SVGSwitchElement::supportsFocus):
     46        * svg/SVGSymbolElement.h:
     47        (WebCore::SVGSymbolElement::supportsFocus):
     48        * svg/SVGTextElement.h:
     49        (WebCore::SVGTextElement::supportsFocus):
     50        * svg/SVGUseElement.h:
     51        (WebCore::SVGUseElement::supportsFocus):
     52
    1532011-06-10  Luke Macpherson   <macpherson@chromium.org>
    254
  • trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp

    r87310 r88555  
    6464    if (const ShadowData* shadow = svgStyle->shadow())
    6565        shadow->adjustRectForShadow(repaintRect);
     66    repaintRect.inflate(object->style()->outlineWidth());
    6667
    6768    // Translate to coords in our parent renderer, and then call computeRectForRepaint on our parent
  • trunk/Source/WebCore/svg/SVGCircleElement.h

    r87010 r88555  
    4343
    4444    virtual bool isValid() const { return SVGTests::isValid(); }
     45    virtual bool supportsFocus() const { return true; }
    4546
    4647    bool isSupportedAttribute(const QualifiedName&);
  • trunk/Source/WebCore/svg/SVGEllipseElement.h

    r87010 r88555  
    4343   
    4444    virtual bool isValid() const { return SVGTests::isValid(); }
     45    virtual bool supportsFocus() const { return true; }
    4546
    4647    bool isSupportedAttribute(const QualifiedName&);
  • trunk/Source/WebCore/svg/SVGGElement.h

    r87125 r88555  
    4747private:
    4848    virtual bool isValid() const { return SVGTests::isValid(); }
     49    virtual bool supportsFocus() const { return true; }
    4950
    5051    bool isSupportedAttribute(const QualifiedName&);
  • trunk/Source/WebCore/svg/SVGImageElement.h

    r87010 r88555  
    4747   
    4848    virtual bool isValid() const { return SVGTests::isValid(); }
     49    virtual bool supportsFocus() const { return true; }
    4950
    5051    bool isSupportedAttribute(const QualifiedName&);
  • trunk/Source/WebCore/svg/SVGLineElement.h

    r87010 r88555  
    4343   
    4444    virtual bool isValid() const { return SVGTests::isValid(); }
     45    virtual bool supportsFocus() const { return true; }
    4546
    4647    bool isSupportedAttribute(const QualifiedName&);
  • trunk/Source/WebCore/svg/SVGPathElement.h

    r87010 r88555  
    101101
    102102    virtual bool isValid() const { return SVGTests::isValid(); }
     103    virtual bool supportsFocus() const { return true; }
    103104
    104105    bool isSupportedAttribute(const QualifiedName&);
  • trunk/Source/WebCore/svg/SVGPolyElement.h

    r87010 r88555  
    4747private:
    4848    virtual bool isValid() const { return SVGTests::isValid(); }
     49    virtual bool supportsFocus() const { return true; }
    4950
    5051    bool isSupportedAttribute(const QualifiedName&);
  • trunk/Source/WebCore/svg/SVGRectElement.h

    r87010 r88555  
    4343   
    4444    virtual bool isValid() const { return SVGTests::isValid(); }
     45    virtual bool supportsFocus() const { return true; }
    4546
    4647    bool isSupportedAttribute(const QualifiedName&);
  • trunk/Source/WebCore/svg/SVGSVGElement.h

    r88007 r88555  
    5353
    5454    virtual bool isValid() const { return SVGTests::isValid(); }
     55    virtual bool supportsFocus() const { return true; }
    5556
    5657    // 'SVGSVGElement' functions
  • trunk/Source/WebCore/svg/SVGStyledElement.cpp

    r87125 r88555  
    2727#include "CSSParser.h"
    2828#include "Document.h"
     29#include "EventNames.h"
    2930#include "HTMLNames.h"
    3031#include "PlatformString.h"
     
    507508}
    508509
     510bool SVGStyledElement::isMouseFocusable() const
     511{
     512    if (!isFocusable())
     513        return false;
     514    Element* eventTarget = const_cast<SVGStyledElement *>(this);
     515    return eventTarget->hasEventListeners(eventNames().focusinEvent) || eventTarget->hasEventListeners(eventNames().focusoutEvent);
     516}
     517
     518bool SVGStyledElement::isKeyboardFocusable(KeyboardEvent*) const
     519{
     520    return isMouseFocusable();
     521}
     522
    509523}
    510524
  • trunk/Source/WebCore/svg/SVGStyledElement.h

    r87125 r88555  
    8888    virtual bool isStyled() const { return true; }
    8989
     90    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
     91    virtual bool isMouseFocusable() const;
     92
    9093    void buildPendingResourcesIfNeeded() const;
    9194
  • trunk/Source/WebCore/svg/SVGSwitchElement.h

    r78249 r88555  
    4242   
    4343    virtual bool isValid() const { return SVGTests::isValid(); }
     44    virtual bool supportsFocus() const { return true; }
    4445
    4546    virtual bool childShouldCreateRenderer(Node*) const;
  • trunk/Source/WebCore/svg/SVGSymbolElement.h

    r87125 r88555  
    4343    SVGSymbolElement(const QualifiedName&, Document*);
    4444
     45    virtual bool supportsFocus() const { return true; }
     46
    4547    bool isSupportedAttribute(const QualifiedName&);
    4648    virtual void parseMappedAttribute(Attribute*);
  • trunk/Source/WebCore/svg/SVGTextElement.h

    r87010 r88555  
    4545    SVGTextElement(const QualifiedName&, Document*);
    4646
     47    virtual bool supportsFocus() const { return true; }
     48
    4749    bool isSupportedAttribute(const QualifiedName&);
    4850    virtual void parseMappedAttribute(Attribute*);
  • trunk/Source/WebCore/svg/SVGUseElement.h

    r87010 r88555  
    5555
    5656    virtual bool isValid() const { return SVGTests::isValid(); }
     57    virtual bool supportsFocus() const { return true; }
    5758
    5859    virtual void insertedIntoDocument();
Note: See TracChangeset for help on using the changeset viewer.