Changeset 140010 in webkit


Ignore:
Timestamp:
Jan 17, 2013 11:26:35 AM (11 years ago)
Author:
alexis@webkit.org
Message:

Add ontransitionend attribute on HTML elements.
https://bugs.webkit.org/show_bug.cgi?id=107134

Reviewed by Simon Fraser.

Source/WebCore:

Add ontransitionend attribute on HTML elements to match the prefixed
attribute onwebkittransitionend. As it uses the same plumbing as a
regular event listener, it behaves the same which means that if
ontransitionend only is defined then only the code attached to this
attribute will be called, if only onwebkittransitionend is defined then
only the code attached to this attribute will be called and finally if
both attributes are defined then only the code attached to the
unprefixed attribute will be called.

Tests: transitions/transition-end-event-unprefixed-03.html

transitions/transition-end-event-unprefixed-04.html

  • html/HTMLAttributeNames.in:
  • html/HTMLElement.cpp:

(WebCore::HTMLElement::parseAttribute):

  • page/DOMWindow.h:

(DOMWindow):

  • page/DOMWindow.idl: only define the property if the unprefixing is

turn on.

LayoutTests:

Add tests to cover the new attribute. It also make sure that event if
we use the old attribute and the new one at the same time only the new
event handler will be called.

  • transitions/transition-end-event-unprefixed-03-expected.txt: Added.
  • transitions/transition-end-event-unprefixed-03.html: Added.
  • transitions/transition-end-event-unprefixed-04-expected.txt: Added.
  • transitions/transition-end-event-unprefixed-04.html: Added.
Location:
trunk
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140007 r140010  
     12013-01-17  Alexis Menard  <alexis@webkit.org>
     2
     3        Add ontransitionend attribute on HTML elements.
     4        https://bugs.webkit.org/show_bug.cgi?id=107134
     5
     6        Reviewed by Simon Fraser.
     7
     8        Add tests to cover the new attribute. It also make sure that event if
     9        we use the old attribute and the new one at the same time only the new
     10        event handler will be called.
     11
     12        * transitions/transition-end-event-unprefixed-03-expected.txt: Added.
     13        * transitions/transition-end-event-unprefixed-03.html: Added.
     14        * transitions/transition-end-event-unprefixed-04-expected.txt: Added.
     15        * transitions/transition-end-event-unprefixed-04.html: Added.
     16
    1172013-01-17  Andrei Bucur  <abucur@adobe.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r140007 r140010  
     12013-01-17  Alexis Menard  <alexis@webkit.org>
     2
     3        Add ontransitionend attribute on HTML elements.
     4        https://bugs.webkit.org/show_bug.cgi?id=107134
     5
     6        Reviewed by Simon Fraser.
     7
     8        Add ontransitionend attribute on HTML elements to match the prefixed
     9        attribute onwebkittransitionend. As it uses the same plumbing as a
     10        regular event listener, it behaves the same which means that if
     11        ontransitionend only is defined then only the code attached to this
     12        attribute will be called, if only onwebkittransitionend is defined then
     13        only the code attached to this attribute will be called and finally if
     14        both attributes are defined then only the code attached to the
     15        unprefixed attribute will be called.
     16
     17        Tests: transitions/transition-end-event-unprefixed-03.html
     18               transitions/transition-end-event-unprefixed-04.html
     19
     20        * html/HTMLAttributeNames.in:
     21        * html/HTMLElement.cpp:
     22        (WebCore::HTMLElement::parseAttribute):
     23        * page/DOMWindow.h:
     24        (DOMWindow):
     25        * page/DOMWindow.idl: only define the property if the unprefixing is
     26        turn on.
     27
    1282013-01-17  Andrei Bucur  <abucur@adobe.com>
    229
  • trunk/Source/WebCore/html/HTMLAttributeNames.in

    r137112 r140010  
    243243ontouchend
    244244ontouchcancel
     245ontransitionend
    245246onunload
    246247onvolumechange
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r139681 r140010  
    313313    } else if (name == onwebkittransitionendAttr) {
    314314        setAttributeEventListener(eventNames().webkitTransitionEndEvent, createAttributeEventListener(this, name, value));
     315    } else if (name == ontransitionendAttr) {
     316        setAttributeEventListener(eventNames().transitionendEvent, createAttributeEventListener(this, name, value));
    315317    } else if (name == oninputAttr) {
    316318        setAttributeEventListener(eventNames().inputEvent, createAttributeEventListener(this, name, value));
  • trunk/Source/WebCore/page/DOMWindow.h

    r139509 r140010  
    350350        DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationend, webkitAnimationEnd);
    351351        DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkittransitionend, webkitTransitionEnd);
     352        DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(transitionend, transitionend);
    352353
    353354        void captureEvents();
  • trunk/Source/WebCore/page/DOMWindow.idl

    r139509 r140010  
    298298    attribute EventListener onwebkitanimationstart;
    299299    attribute EventListener onwebkittransitionend;
     300#if defined(ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED) && ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED
     301    attribute EventListener ontransitionend;
     302#endif
    300303#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
    301304    attribute EventListener onorientationchange;
Note: See TracChangeset for help on using the changeset viewer.