Changeset 100805 in webkit
- Timestamp:
- Nov 18, 2011 1:19:14 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r100804 r100805 1 2011-11-18 Vineet Chaudhary <vineet.chaudhary@motorola.com> 2 3 Access key should work on all elements. 4 https://bugs.webkit.org/show_bug.cgi?id=71854 5 6 Reviewed by Ryosuke Niwa. 7 8 Added test case to check whether all elements can also have accessKey attribute. 9 10 * fast/forms/access-key-expected.txt: 11 * fast/forms/access-key-for-all-elements-expected.txt: Added. 12 * fast/forms/access-key-for-all-elements.html: Added. 13 * fast/forms/access-key.html: Added more test coverage for select and textarea elements. 14 1 15 2011-11-18 Adam Klein <adamk@chromium.org> 2 16 -
trunk/LayoutTests/fast/forms/access-key-expected.txt
r27599 r100805 6 6 7 7 8 8 9 9 1 button focussed 10 10 1 button clicked … … 24 24 b area 1 clicked 25 25 c area 2 clicked 26 d select focussed 27 d select clicked 28 e textarea focussed -
trunk/LayoutTests/fast/forms/access-key.html
r34259 r100805 26 26 pressKey("b"); 27 27 pressKey("c"); 28 pressKey("d"); 29 pressKey("e"); 28 30 } 29 31 } … … 50 52 </map> 51 53 <img usemap="#mymap" alt="pic" src="#" height="10" width="10"> 54 <select accesskey="d" onfocus="log('d select focussed')" onclick="log('d select clicked')"></select> 55 <textarea accesskey="e" onfocus="log('e textarea focussed')" onclick="log('e textarea clicked')"></textarea> 52 56 </p> 53 57 <hr> -
trunk/Source/WebCore/ChangeLog
r100800 r100805 1 2011-11-18 Vineet Chaudhary <vineet.chaudhary@motorola.com> 2 3 Access key should work on all elements. 4 https://bugs.webkit.org/show_bug.cgi?id=71854 5 6 Reviewed by Ryosuke Niwa. 7 8 All HTML elements can have the accesskey content attribute set. 9 Specification http://dev.w3.org/html5/spec/Overview.html#the-accesskey-attribute 10 Adding "accessKey" attribute to HTMLElement.idl file as [Reflect]. 11 12 Test: fast/forms/access-key-for-all-elements.html 13 14 * bindings/objc/PublicDOMInterfaces.h: Moved properties form subclass to base class. 15 * html/BaseButtonInputType.cpp: 16 (WebCore::BaseButtonInputType::accessKeyAction): Renamed variable sendToAnyElement to sendMouseEvents. 17 * html/BaseButtonInputType.h: Ditto 18 * html/BaseCheckableInputType.cpp: 19 (WebCore::BaseCheckableInputType::accessKeyAction): Ditto 20 * html/BaseCheckableInputType.h: Ditto 21 * html/HTMLAnchorElement.cpp: 22 (WebCore::HTMLAnchorElement::accessKeyAction): Ditto 23 * html/HTMLAnchorElement.h: Ditto 24 * html/HTMLAnchorElement.idl: Removed redundant IDL attribute entries. 25 * html/HTMLAreaElement.idl: Removed redundant IDL attribute entries. 26 * html/HTMLButtonElement.cpp: 27 (WebCore::HTMLButtonElement::accessKeyAction): Renamed variable sendToAnyElement to sendMouseEvents. 28 * html/HTMLButtonElement.h: Ditto 29 * html/HTMLButtonElement.idl: Removed redundant IDL attribute entries. 30 * html/HTMLElement.cpp: 31 (WebCore::HTMLElement::accessKeyAction): Renamed variable sendToAnyElement to sendMouseEvents. 32 If the element does not have a defined activation behavior, fire a click event at the element. 33 * html/HTMLElement.h: Ditto 34 * html/HTMLElement.idl: Added accessKey IDL attribute. 35 * html/HTMLInputElement.cpp: 36 (WebCore::HTMLInputElement::accessKeyAction): Renamed variable sendToAnyElement to sendMouseEvents. 37 * html/HTMLInputElement.h: Ditto 38 * html/HTMLInputElement.idl: Removed redundant IDL attribute entries. 39 * html/HTMLLabelElement.cpp: 40 (WebCore::HTMLLabelElement::accessKeyAction): Renamed variable sendToAnyElement to sendMouseEvents. 41 * html/HTMLLabelElement.h: Ditto 42 * html/HTMLLabelElement.idl: Removed redundant IDL attribute entries. 43 * html/HTMLLegendElement.cpp: 44 (WebCore::HTMLLegendElement::accessKeyAction): Renamed variable sendToAnyElement to sendMouseEvents. 45 * html/HTMLLegendElement.h: Ditto 46 * html/HTMLLegendElement.idl: Removed redundant IDL attribute entries. 47 * html/HTMLOptGroupElement.h: Renamed variable sendToAnyElement to sendMouseEvents. 48 * html/HTMLSelectElement.cpp: 49 (WebCore::HTMLSelectElement::accessKeyAction): Ditto 50 * html/HTMLSelectElement.h: Ditto 51 * html/HTMLTextAreaElement.h: Ditto 52 * html/HTMLTextAreaElement.idl: Removed redundant IDL attribute entries. 53 * html/HiddenInputType.h: Renamed variable sendToAnyElement to sendMouseEvents. 54 * html/InputType.h: Ditto 55 * html/RangeInputType.cpp: 56 (WebCore::RangeInputType::accessKeyAction): Ditto 57 * html/RangeInputType.h: Ditto 58 1 59 2011-11-18 Simon Fraser <simon.fraser@apple.com> 2 60 -
trunk/Source/WebCore/bindings/objc/PublicDOMInterfaces.h
r97771 r100805 332 332 333 333 @interface DOMHTMLAnchorElement : DOMHTMLElement WEBKIT_VERSION_1_3 334 @property(copy) NSString *accessKey;335 334 @property(copy) NSString *charset; 336 335 @property(copy) NSString *coords; … … 369 368 370 369 @interface DOMHTMLAreaElement : DOMHTMLElement WEBKIT_VERSION_1_3 371 @property(copy) NSString *accessKey;372 370 @property(copy) NSString *alt; 373 371 @property(copy) NSString *coords; … … 412 410 @interface DOMHTMLButtonElement : DOMHTMLElement WEBKIT_VERSION_1_3 413 411 @property(readonly, retain) DOMHTMLFormElement *form; 414 @property(copy) NSString *accessKey;415 412 @property BOOL disabled; 416 413 @property(copy) NSString *name; … … 472 469 473 470 @interface DOMHTMLElement : DOMElement WEBKIT_VERSION_1_3 471 @property(copy) NSString *accessKey; 474 472 @property(copy) NSString *title; 475 473 @property(copy) NSString *idName; … … 604 602 @property(readonly, retain) DOMHTMLFormElement *form; 605 603 @property(copy) NSString *accept; 606 @property(copy) NSString *accessKey;607 604 @property(copy) NSString *align; 608 605 @property(copy) NSString *alt; … … 643 640 @interface DOMHTMLLabelElement : DOMHTMLElement WEBKIT_VERSION_1_3 644 641 @property(readonly, retain) DOMHTMLFormElement *form; 645 @property(copy) NSString *accessKey;646 642 @property(copy) NSString *htmlFor; 647 643 @end … … 649 645 @interface DOMHTMLLegendElement : DOMHTMLElement WEBKIT_VERSION_1_3 650 646 @property(readonly, retain) DOMHTMLFormElement *form; 651 @property(copy) NSString *accessKey;652 647 @property(copy) NSString *align; 653 648 @end … … 885 880 @property(copy) NSString *defaultValue; 886 881 @property(readonly, retain) DOMHTMLFormElement *form; 887 @property(copy) NSString *accessKey;888 882 @property int cols; 889 883 @property BOOL disabled; -
trunk/Source/WebCore/html/BaseButtonInputType.cpp
r95901 r100805 87 87 88 88 // FIXME: Could share this with BaseCheckableInputType and RangeInputType if we had a common base class. 89 void BaseButtonInputType::accessKeyAction(bool send ToAnyElement)89 void BaseButtonInputType::accessKeyAction(bool sendMouseEvents) 90 90 { 91 InputType::accessKeyAction(send ToAnyElement);91 InputType::accessKeyAction(sendMouseEvents); 92 92 93 // Send mouse button events if the caller specified send ToAnyElement.93 // Send mouse button events if the caller specified sendMouseEvents. 94 94 // FIXME: The comment above is no good. It says what we do, but not why. 95 element()->dispatchSimulatedClick(0, send ToAnyElement);95 element()->dispatchSimulatedClick(0, sendMouseEvents); 96 96 } 97 97 -
trunk/Source/WebCore/html/BaseButtonInputType.h
r95901 r100805 47 47 virtual void handleKeyupEvent(KeyboardEvent*); 48 48 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const; 49 virtual void accessKeyAction(bool send ToAnyElement);49 virtual void accessKeyAction(bool sendMouseEvents); 50 50 virtual bool storesValueSeparateFromAttribute(); 51 51 virtual void setValue(const String&, bool, bool); -
trunk/Source/WebCore/html/BaseCheckableInputType.cpp
r99395 r100805 86 86 87 87 // FIXME: Could share this with BaseButtonInputType and RangeInputType if we had a common base class. 88 void BaseCheckableInputType::accessKeyAction(bool send ToAnyElement)88 void BaseCheckableInputType::accessKeyAction(bool sendMouseEvents) 89 89 { 90 InputType::accessKeyAction(send ToAnyElement);90 InputType::accessKeyAction(sendMouseEvents); 91 91 92 // Send mouse button events if the caller specified send ToAnyElement.92 // Send mouse button events if the caller specified sendMouseEvents. 93 93 // FIXME: The comment above is no good. It says what we do, but not why. 94 element()->dispatchSimulatedClick(0, send ToAnyElement);94 element()->dispatchSimulatedClick(0, sendMouseEvents); 95 95 } 96 96 -
trunk/Source/WebCore/html/BaseCheckableInputType.h
r99395 r100805 48 48 virtual void handleKeypressEvent(KeyboardEvent*); 49 49 virtual bool canSetStringValue() const; 50 virtual void accessKeyAction(bool send ToAnyElement);50 virtual void accessKeyAction(bool sendMouseEvents); 51 51 virtual String fallbackValue() const OVERRIDE; 52 52 virtual bool storesValueSeparateFromAttribute(); -
trunk/Source/WebCore/html/HTMLAnchorElement.cpp
r100353 r100805 231 231 } 232 232 233 void HTMLAnchorElement::accessKeyAction(bool send ToAnyElement)234 { 235 // send the mouse button events if the caller specified send ToAnyElement236 dispatchSimulatedClick(0, send ToAnyElement);233 void HTMLAnchorElement::accessKeyAction(bool sendMouseEvents) 234 { 235 // send the mouse button events if the caller specified sendMouseEvents 236 dispatchSimulatedClick(0, sendMouseEvents); 237 237 } 238 238 -
trunk/Source/WebCore/html/HTMLAnchorElement.h
r100164 r100805 105 105 virtual void defaultEventHandler(Event*); 106 106 virtual void setActive(bool active = true, bool pause = false); 107 virtual void accessKeyAction(bool fullAction);107 virtual void accessKeyAction(bool sendMouseEvents); 108 108 virtual bool isURLAttribute(Attribute*) const; 109 109 virtual bool canStartSelection() const; -
trunk/Source/WebCore/html/HTMLAnchorElement.idl
r100164 r100805 22 22 23 23 interface HTMLAnchorElement : HTMLElement { 24 attribute [Reflect] DOMString accessKey;25 24 attribute [Reflect] DOMString charset; 26 25 attribute [Reflect] DOMString coords; -
trunk/Source/WebCore/html/HTMLAreaElement.idl
r100076 r100805 22 22 23 23 interface HTMLAreaElement : HTMLElement { 24 attribute [Reflect] DOMString accessKey;25 24 attribute [Reflect] DOMString alt; 26 25 attribute [Reflect] DOMString coords; -
trunk/Source/WebCore/html/HTMLButtonElement.cpp
r99742 r100805 163 163 } 164 164 165 void HTMLButtonElement::accessKeyAction(bool send ToAnyElement)165 void HTMLButtonElement::accessKeyAction(bool sendMouseEvents) 166 166 { 167 167 focus(); 168 // send the mouse button events iff the caller specified sendToAnyElement169 dispatchSimulatedClick(0, send ToAnyElement);168 // Send the mouse button events if the caller specified sendMouseEvents 169 dispatchSimulatedClick(0, sendMouseEvents); 170 170 } 171 171 -
trunk/Source/WebCore/html/HTMLButtonElement.h
r78232 r100805 54 54 virtual void setActivatedSubmit(bool flag); 55 55 56 virtual void accessKeyAction(bool send ToAnyElement);56 virtual void accessKeyAction(bool sendMouseEvents); 57 57 virtual bool isURLAttribute(Attribute*) const; 58 58 -
trunk/Source/WebCore/html/HTMLButtonElement.idl
r100076 r100805 31 31 readonly attribute ValidityState validity; 32 32 33 attribute [Reflect] DOMString accessKey;34 33 attribute [Reflect] boolean disabled; 35 34 attribute [Reflect] boolean autofocus; -
trunk/Source/WebCore/html/HTMLElement.cpp
r99742 r100805 775 775 } 776 776 777 // accessKeyAction is used by the accessibility support code 778 // to send events to elements that our JavaScript caller does 779 // does not. The elements JS is interested in have subclasses 780 // that override this method to direct the click appropriately. 781 // Here in the base class, then, we only send the click if 782 // the caller wants it to go to any HTMLElement, and we say 783 // to send the mouse events in addition to the click. 784 void HTMLElement::accessKeyAction(bool sendToAnyElement) 785 { 786 if (sendToAnyElement) 787 dispatchSimulatedClick(0, true); 777 void HTMLElement::accessKeyAction(bool sendMouseEvents) 778 { 779 dispatchSimulatedClick(0, sendMouseEvents); 788 780 } 789 781 -
trunk/Source/WebCore/html/HTMLElement.h
r99742 r100805 75 75 void click(); 76 76 77 virtual void accessKeyAction(bool send ToAnyElement);77 virtual void accessKeyAction(bool sendMouseEvents); 78 78 79 79 bool ieForbidsInsertHTML() const; -
trunk/Source/WebCore/html/HTMLElement.idl
r100076 r100805 38 38 attribute [Reflect] DOMString webkitdropzone; 39 39 attribute [Reflect] boolean hidden; 40 attribute [Reflect] DOMString accessKey; 40 41 41 42 // Extensions -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r99742 r100805 700 700 } 701 701 702 void HTMLInputElement::accessKeyAction(bool send ToAnyElement)703 { 704 m_inputType->accessKeyAction(send ToAnyElement);702 void HTMLInputElement::accessKeyAction(bool sendMouseEvents) 703 { 704 m_inputType->accessKeyAction(sendMouseEvents); 705 705 } 706 706 -
trunk/Source/WebCore/html/HTMLInputElement.h
r99403 r100805 273 273 virtual bool canStartSelection() const; 274 274 275 virtual void accessKeyAction(bool send ToAnyElement);275 virtual void accessKeyAction(bool sendMouseEvents); 276 276 277 277 virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const; -
trunk/Source/WebCore/html/HTMLInputElement.idl
r100076 r100805 32 32 readonly attribute ValidityState validity; 33 33 attribute [Reflect] DOMString accept; 34 attribute [Reflect] DOMString accessKey;35 34 attribute [Reflect] DOMString align; 36 35 attribute [Reflect] DOMString alt; -
trunk/Source/WebCore/html/HTMLLabelElement.cpp
r94427 r100805 147 147 } 148 148 149 void HTMLLabelElement::accessKeyAction(bool send ToAnyElement)149 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) 150 150 { 151 151 if (HTMLElement* element = control()) 152 element->accessKeyAction(send ToAnyElement);152 element->accessKeyAction(sendMouseEvents); 153 153 else 154 HTMLElement::accessKeyAction(send ToAnyElement);154 HTMLElement::accessKeyAction(sendMouseEvents); 155 155 } 156 156 -
trunk/Source/WebCore/html/HTMLLabelElement.h
r65982 r100805 41 41 virtual bool isFocusable() const; 42 42 43 virtual void accessKeyAction(bool send ToAnyElement);43 virtual void accessKeyAction(bool sendMouseEvents); 44 44 45 45 // Overridden to update the hover/active state of the corresponding control. -
trunk/Source/WebCore/html/HTMLLabelElement.idl
r100076 r100805 23 23 interface HTMLLabelElement : HTMLElement { 24 24 readonly attribute HTMLFormElement form; 25 attribute [Reflect] DOMString accessKey;26 25 attribute [Reflect=for] DOMString htmlFor; 27 26 readonly attribute HTMLElement control; -
trunk/Source/WebCore/html/HTMLLegendElement.cpp
r69868 r100805 88 88 } 89 89 90 void HTMLLegendElement::accessKeyAction(bool send ToAnyElement)90 void HTMLLegendElement::accessKeyAction(bool sendMouseEvents) 91 91 { 92 92 if (HTMLFormControlElement* control = associatedControl()) 93 control->accessKeyAction(send ToAnyElement);93 control->accessKeyAction(sendMouseEvents); 94 94 } 95 95 -
trunk/Source/WebCore/html/HTMLLegendElement.h
r61959 r100805 41 41 virtual bool supportsFocus() const; 42 42 virtual const AtomicString& formControlType() const; 43 virtual void accessKeyAction(bool send ToAnyElement);43 virtual void accessKeyAction(bool sendMouseEvents); 44 44 virtual void focus(bool restorePreviousSelection = true); 45 45 }; -
trunk/Source/WebCore/html/HTMLLegendElement.idl
r100076 r100805 23 23 interface HTMLLegendElement : HTMLElement { 24 24 readonly attribute HTMLFormElement form; 25 attribute [Reflect] DOMString accessKey;26 25 attribute [Reflect] DOMString align; 27 26 }; -
trunk/Source/WebCore/html/HTMLOptGroupElement.h
r97720 r100805 53 53 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); 54 54 55 virtual void accessKeyAction(bool send ToAnyElement);55 virtual void accessKeyAction(bool sendMouseEvents); 56 56 57 57 virtual RenderStyle* nonRendererRenderStyle() const; -
trunk/Source/WebCore/html/HTMLSelectElement.cpp
r100111 r100805 348 348 } 349 349 350 void HTMLSelectElement::accessKeyAction(bool send ToAnyElement)350 void HTMLSelectElement::accessKeyAction(bool sendMouseEvents) 351 351 { 352 352 focus(); 353 dispatchSimulatedClick(0, send ToAnyElement);353 dispatchSimulatedClick(0, sendMouseEvents); 354 354 } 355 355 -
trunk/Source/WebCore/html/HTMLSelectElement.h
r100123 r100805 75 75 const Vector<HTMLElement*>& listItems() const; 76 76 77 virtual void accessKeyAction(bool send ToAnyElement);77 virtual void accessKeyAction(bool sendMouseEvents); 78 78 void accessKeySetSelectedIndex(int); 79 79 -
trunk/Source/WebCore/html/HTMLTextAreaElement.h
r94047 r100805 102 102 virtual void updateFocusAppearance(bool restorePreviousSelection); 103 103 104 virtual void accessKeyAction(bool send ToAnyElement);104 virtual void accessKeyAction(bool sendMouseEvents); 105 105 106 106 virtual bool shouldUseInputMethod(); -
trunk/Source/WebCore/html/HTMLTextAreaElement.idl
r100076 r100805 26 26 readonly attribute HTMLFormElement form; 27 27 readonly attribute ValidityState validity; 28 attribute [Reflect] DOMString accessKey;29 28 attribute long cols; 30 29 attribute [Reflect] boolean disabled; -
trunk/Source/WebCore/html/HiddenInputType.h
r99310 r100805 45 45 virtual bool supportsValidation() const; 46 46 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const; 47 virtual void accessKeyAction(bool send ToAnyElement);47 virtual void accessKeyAction(bool sendMouseEvents); 48 48 virtual bool rendererIsNeeded(); 49 49 virtual bool storesValueSeparateFromAttribute(); -
trunk/Source/WebCore/html/InputType.h
r99395 r100805 185 185 virtual bool shouldUseInputMethod() const; 186 186 virtual void handleBlurEvent(); 187 virtual void accessKeyAction(bool send ToAnyElement);187 virtual void accessKeyAction(bool sendMouseEvents); 188 188 virtual bool canBeSuccessfulSubmitButton(); 189 189 -
trunk/Source/WebCore/html/RangeInputType.cpp
r99395 r100805 267 267 268 268 // FIXME: Could share this with BaseButtonInputType and BaseCheckableInputType if we had a common base class. 269 void RangeInputType::accessKeyAction(bool send ToAnyElement)270 { 271 InputType::accessKeyAction(send ToAnyElement);272 273 // Send mouse button events if the caller specified send ToAnyElement.269 void RangeInputType::accessKeyAction(bool sendMouseEvents) 270 { 271 InputType::accessKeyAction(sendMouseEvents); 272 273 // Send mouse button events if the caller specified sendMouseEvents. 274 274 // FIXME: The comment above is no good. It says what we do, but not why. 275 element()->dispatchSimulatedClick(0, send ToAnyElement);275 element()->dispatchSimulatedClick(0, sendMouseEvents); 276 276 } 277 277 -
trunk/Source/WebCore/html/RangeInputType.h
r99395 r100805 65 65 virtual double parseToDouble(const String&, double) const; 66 66 virtual String serialize(double) const; 67 virtual void accessKeyAction(bool send ToAnyElement);67 virtual void accessKeyAction(bool sendMouseEvents); 68 68 virtual void minOrMaxAttributeChanged(); 69 69 virtual void setValue(const String&, bool valueChanged, bool sendChangeEvent);
Note: See TracChangeset
for help on using the changeset viewer.