Changeset 82925 in webkit
- Timestamp:
- Apr 5, 2011 4:45:29 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 deleted
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r82924 r82925 1 2011-04-05 Alexey Proskuryakov <ap@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Remove onformchange and onforminput events/event handlers 6 https://bugs.webkit.org/show_bug.cgi?id=55755 7 <rdar://problem/9087969> 8 9 * fast/dom/Window/window-properties-expected.txt: 10 * fast/dom/Window/window-property-descriptors-expected.txt: 11 * fast/forms/formchange-event-expected.txt: Removed. 12 * fast/forms/formchange-event.html: Removed. 13 * fast/forms/forminput-event-expected.txt: Removed. 14 * fast/forms/forminput-event.html: Removed. 15 * fast/forms/script-tests/formchange-event.js: Removed. 16 * fast/forms/script-tests/forminput-event.js: Removed. 17 1 18 2011-04-05 Pavel Podivilov <podivilov@chromium.org> 2 19 -
trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt
r80846 r82925 2337 2337 window.onerror [null] 2338 2338 window.onfocus [null] 2339 window.onformchange [null]2340 window.onforminput [null]2341 2339 window.onhashchange [null] 2342 2340 window.oninput [null] -
trunk/LayoutTests/fast/dom/Window/window-property-descriptors-expected.txt
r80846 r82925 397 397 PASS typeof Object.getOwnPropertyDescriptor(window, 'onerror') is 'object' 398 398 PASS typeof Object.getOwnPropertyDescriptor(window, 'onfocus') is 'object' 399 PASS typeof Object.getOwnPropertyDescriptor(window, 'onformchange') is 'object'400 PASS typeof Object.getOwnPropertyDescriptor(window, 'onforminput') is 'object'401 399 PASS typeof Object.getOwnPropertyDescriptor(window, 'onhashchange') is 'object' 402 400 PASS typeof Object.getOwnPropertyDescriptor(window, 'oninput') is 'object' -
trunk/Source/WebCore/ChangeLog
r82923 r82925 1 2011-04-05 Alexey Proskuryakov <ap@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Remove onformchange and onforminput events/event handlers 6 https://bugs.webkit.org/show_bug.cgi?id=55755 7 <rdar://problem/9087969> 8 9 Covered by existing tests. 10 11 * dom/Document.h: 12 * dom/Document.idl: 13 * dom/Element.h: 14 * dom/Element.idl: 15 * dom/Event.cpp: 16 (WebCore::Event::fromUserGesture): 17 * dom/EventNames.h: 18 * html/FormAssociatedElement.h: 19 * html/HTMLAttributeNames.in: 20 * html/HTMLElement.cpp: 21 (WebCore::HTMLElement::parseMappedAttribute): 22 * html/HTMLElement.h: 23 * html/HTMLFormControlElement.h: 24 (WebCore::HTMLFormControlElement::isEnumeratable): 25 * html/HTMLFormElement.cpp: 26 * html/HTMLFormElement.h: 27 * html/HTMLFormElement.idl: 28 * html/HTMLInputElement.h: 29 * html/HTMLKeygenElement.h: 30 * html/HTMLObjectElement.h: 31 (WebCore::HTMLObjectElement::isEnumeratable): 32 * html/HTMLOutputElement.h: 33 (WebCore::HTMLOutputElement::isEnumeratable): 34 * html/HTMLSelectElement.h: 35 (WebCore::HTMLSelectElement::isEnumeratable): 36 * html/HTMLTextAreaElement.h: 37 (WebCore::HTMLTextAreaElement::isEnumeratable): 38 * page/DOMWindow.h: 39 * page/DOMWindow.idl: 40 1 41 2011-04-05 Sheriff Bot <webkit.review.bot@gmail.com> 2 42 -
trunk/Source/WebCore/dom/Document.h
r82882 r82925 239 239 DEFINE_ATTRIBUTE_EVENT_LISTENER(drag); 240 240 DEFINE_ATTRIBUTE_EVENT_LISTENER(dragend); 241 DEFINE_ATTRIBUTE_EVENT_LISTENER(formchange);242 DEFINE_ATTRIBUTE_EVENT_LISTENER(forminput);243 241 DEFINE_ATTRIBUTE_EVENT_LISTENER(input); 244 242 DEFINE_ATTRIBUTE_EVENT_LISTENER(invalid); -
trunk/Source/WebCore/dom/Document.idl
r79208 r82925 267 267 attribute [DontEnum] EventListener onerror; 268 268 attribute [DontEnum] EventListener onfocus; 269 attribute [DontEnum] EventListener onformchange;270 attribute [DontEnum] EventListener onforminput;271 269 attribute [DontEnum] EventListener oninput; 272 270 attribute [DontEnum] EventListener oninvalid; -
trunk/Source/WebCore/dom/Element.h
r82595 r82925 65 65 DEFINE_ATTRIBUTE_EVENT_LISTENER(drag); 66 66 DEFINE_ATTRIBUTE_EVENT_LISTENER(dragend); 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(formchange);68 DEFINE_ATTRIBUTE_EVENT_LISTENER(forminput);69 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(input); 70 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(invalid); -
trunk/Source/WebCore/dom/Element.idl
r80846 r82925 156 156 attribute [DontEnum] EventListener onerror; 157 157 attribute [DontEnum] EventListener onfocus; 158 attribute [DontEnum] EventListener onformchange;159 attribute [DontEnum] EventListener onforminput;160 158 attribute [DontEnum] EventListener oninput; 161 159 attribute [DontEnum] EventListener oninvalid; -
trunk/Source/WebCore/dom/Event.cpp
r82891 r82925 260 260 || type == eventNames().selectEvent || type == eventNames().changeEvent 261 261 || type == eventNames().focusEvent || type == eventNames().blurEvent 262 || type == eventNames().submitEvent || type == eventNames().formchangeEvent;262 || type == eventNames().submitEvent; 263 263 } 264 264 -
trunk/Source/WebCore/dom/EventNames.h
r80183 r82925 68 68 macro(focusin) \ 69 69 macro(focusout) \ 70 macro(formchange) \71 macro(forminput) \72 70 macro(hashchange) \ 73 71 macro(input) \ -
trunk/Source/WebCore/html/FormAssociatedElement.h
r77114 r82925 47 47 virtual bool isFormControlElement() const = 0; 48 48 virtual bool isEnumeratable() const = 0; 49 virtual bool isResettable() const = 0;50 49 51 50 const AtomicString& name() const { return formControlName(); } -
trunk/Source/WebCore/html/HTMLAttributeNames.in
r81038 r82925 179 179 onfocusin 180 180 onfocusout 181 onformchange182 onforminput183 181 onhashchange 184 182 oninput -
trunk/Source/WebCore/html/HTMLElement.cpp
r82886 r82925 195 195 } else if (attr->name() == onfocusoutAttr) { 196 196 setAttributeEventListener(eventNames().focusoutEvent, createAttributeEventListener(this, attr)); 197 } else if (attr->name() == onformchangeAttr) {198 setAttributeEventListener(eventNames().formchangeEvent, createAttributeEventListener(this, attr));199 } else if (attr->name() == onforminputAttr) {200 setAttributeEventListener(eventNames().forminputEvent, createAttributeEventListener(this, attr));201 197 } else if (attr->name() == onblurAttr) { 202 198 setAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(this, attr)); … … 815 811 } 816 812 817 HTMLFormElement* HTMLElement::shadowAncestorOwnerForm()818 {819 Node* ancestorNode = shadowAncestorNode();820 if (!ancestorNode)821 return form();822 823 if (!ancestorNode->isHTMLElement())824 return 0;825 HTMLElement* ancestorHTML = toHTMLElement(ancestorNode);826 if (!ancestorHTML)827 return 0;828 return ancestorHTML->form();829 }830 831 void HTMLElement::dispatchChangeEvents()832 {833 RefPtr<HTMLElement> protector(this);834 RefPtr<HTMLFormElement> ownerForm(shadowAncestorOwnerForm());835 836 Node::dispatchChangeEvents();837 if (ownerForm)838 ownerForm->dispatchFormChange();839 }840 841 void HTMLElement::dispatchInputEvents()842 {843 RefPtr<HTMLElement> protector(this);844 RefPtr<HTMLFormElement> ownerForm(shadowAncestorOwnerForm());845 846 Node::dispatchInputEvents();847 if (ownerForm)848 ownerForm->dispatchFormInput();849 }850 851 813 static void setHasDirAutoFlagRecursively(Node* firstNode, bool flag, Node* lastNode = 0) 852 814 { -
trunk/Source/WebCore/html/HTMLElement.h
r82886 r82925 82 82 HTMLFormElement* findFormAncestor() const; 83 83 84 virtual void dispatchChangeEvents();85 virtual void dispatchInputEvents();86 87 84 TextDirection directionalityIfhasDirAutoAttribute(bool& isAuto) const; 88 85 … … 106 103 Node* insertAdjacent(const String& where, Node* newChild, ExceptionCode&); 107 104 PassRefPtr<DocumentFragment> textToFragment(const String&, ExceptionCode&); 108 109 HTMLFormElement* shadowAncestorOwnerForm();110 105 111 106 void dirAttributeChanged(Attribute*); -
trunk/Source/WebCore/html/HTMLFormControlElement.h
r81978 r82925 64 64 virtual bool isFocusable() const; 65 65 virtual bool isEnumeratable() const { return false; } 66 virtual bool isResettable() const { return false; }67 66 68 67 // Determines whether or not a control will be automatically focused. -
trunk/Source/WebCore/html/HTMLFormElement.cpp
r82535 r82925 588 588 } 589 589 590 void HTMLFormElement::broadcastFormEvent(const AtomicString& eventName)591 {592 RefPtr<HTMLFormElement> protector(this);593 // Copy m_associatedElements because event handlers called from594 // formElement->dispatchEvent() might change m_associatedElements.595 Vector<RefPtr<FormAssociatedElement> > elements;596 elements.reserveCapacity(m_associatedElements.size());597 for (unsigned i = 0; i < m_associatedElements.size(); ++i) {598 if (!m_associatedElements[i]->isResettable())599 continue;600 elements.append(m_associatedElements[i]);601 }602 603 for (unsigned i = 0; i < elements.size(); ++i) {604 // We can assume a resettable control is always a HTMLFormControlElement.605 // FIXME: We should handle resettable non-HTMLFormControlElements maybe in the future.606 ASSERT(elements[i]->isFormControlElement());607 HTMLFormControlElement* formElement = static_cast<HTMLFormControlElement*>(elements[i].get());608 if (!formElement->dispatchEvent(Event::create(eventName, false, false)))609 continue;610 }611 }612 613 void HTMLFormElement::dispatchFormInput()614 {615 broadcastFormEvent(eventNames().forminputEvent);616 }617 618 void HTMLFormElement::dispatchFormChange()619 {620 broadcastFormEvent(eventNames().formchangeEvent);621 }622 623 590 bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(Vector<RefPtr<FormAssociatedElement> >& unhandledInvalidControls) 624 591 { -
trunk/Source/WebCore/html/HTMLFormElement.h
r76663 r82925 115 115 const Vector<FormAssociatedElement*>& associatedElements() const { return m_associatedElements; } 116 116 117 void dispatchFormInput();118 void dispatchFormChange();119 120 117 private: 121 118 HTMLFormElement(const QualifiedName&, Document*); … … 149 146 bool checkInvalidControlsAndCollectUnhandled(Vector<RefPtr<FormAssociatedElement> >&); 150 147 151 void broadcastFormEvent(const AtomicString&);152 153 148 friend class HTMLFormCollection; 154 149 -
trunk/Source/WebCore/html/HTMLFormElement.idl
r76115 r82925 44 44 void reset(); 45 45 boolean checkValidity(); 46 47 void dispatchFormInput();48 void dispatchFormChange();49 46 }; 50 47 -
trunk/Source/WebCore/html/HTMLInputElement.h
r81263 r82925 216 216 virtual bool isMouseFocusable() const; 217 217 virtual bool isEnumeratable() const; 218 virtual bool isResettable() const { return true; }219 218 virtual void updateFocusAppearance(bool restorePreviousSelection); 220 219 virtual void aboutToUnload(); -
trunk/Source/WebCore/html/HTMLKeygenElement.h
r77781 r82925 50 50 virtual bool isEnumeratable() const { return true; } 51 51 52 virtual bool isResettable() const { return true; }53 52 virtual void reset(); 54 53 -
trunk/Source/WebCore/html/HTMLObjectElement.h
r77891 r82925 51 51 52 52 virtual bool isEnumeratable() const { return true; } 53 virtual bool isResettable() const { return false; }54 53 virtual bool appendFormData(FormDataList&, bool); 55 54 -
trunk/Source/WebCore/html/HTMLOutputElement.h
r78232 r82925 57 57 virtual const AtomicString& formControlType() const; 58 58 virtual bool isEnumeratable() const { return true; } 59 virtual bool isResettable() const { return true; }60 59 virtual void childrenChanged(bool createdByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); 61 60 virtual void reset(); -
trunk/Source/WebCore/html/HTMLSelectElement.h
r76929 r82925 108 108 109 109 virtual bool isEnumeratable() const { return true; } 110 virtual bool isResettable() const { return true; }111 110 112 111 virtual bool saveFormControlState(String& value) const; -
trunk/Source/WebCore/html/HTMLTextAreaElement.h
r81263 r82925 83 83 84 84 virtual bool isEnumeratable() const { return true; } 85 virtual bool isResettable() const { return true; }86 85 87 86 virtual const AtomicString& formControlType() const; -
trunk/Source/WebCore/page/DOMWindow.h
r81438 r82925 285 285 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); 286 286 DEFINE_ATTRIBUTE_EVENT_LISTENER(focus); 287 DEFINE_ATTRIBUTE_EVENT_LISTENER(formchange);288 DEFINE_ATTRIBUTE_EVENT_LISTENER(forminput);289 287 DEFINE_ATTRIBUTE_EVENT_LISTENER(hashchange); 290 288 DEFINE_ATTRIBUTE_EVENT_LISTENER(input); -
trunk/Source/WebCore/page/DOMWindow.idl
r81821 r82925 268 268 attribute EventListener onerror; 269 269 attribute EventListener onfocus; 270 attribute EventListener onformchange;271 attribute EventListener onforminput;272 270 attribute EventListener onhashchange; 273 271 attribute EventListener oninput;
Note: See TracChangeset
for help on using the changeset viewer.