Add resize event for HTMLMediaElement
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Feb 2016 06:34:07 +0000 (06:34 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Feb 2016 06:34:07 +0000 (06:34 +0000)
commit9a33baf069231d5aea3e5ff737dd50be1c4012be
treee8934cd7e25b323447005aee2236ff45b34f045e
parent1565cc5c7caa7d74f586e8070e297d3bf94765c2
Add resize event for HTMLMediaElement
https://bugs.webkit.org/show_bug.cgi?id=125715

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-01-31
Reviewed by Darin Adler.
LayoutTests/imported/w3c:

Rebaselined test after moving 'resize' from DOMWindow.idl to GlobalEventHandlers.idl
per https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Tests: http/tests/media/hls/hls-video-resize.html
       media/video-resize.html

Move resize javascript event from DOMWindow.idl to GlobalEventHandlers.idl
per https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers

Post resize event from video element when metadata loads and when content size changes.

* dom/GlobalEventHandlers.idl: Add onresize.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap): Add onresizeAttr.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::mediaPlayerSizeChanged):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::scheduleResizeEvent):
(WebCore::HTMLMediaElement::scheduleResizeEventIfSizeChanged):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::scheduleResizeEvent): Sechedule event.
(WebCore::HTMLVideoElement::scheduleResizeEventIfSizeChanged): Schedule event if size has changed.
* html/HTMLVideoElement.h: Add declarations.
* page/DOMWindow.idl: Remove onresize.

Source/WebInspectorUI:

Add a display name for "resize" event.

* UserInterface/Models/ScriptTimelineRecord.js:
(WebInspector.ScriptTimelineRecord.EventType.displayName):

LayoutTests:

Update test for change: move resize javascript event from DOMWindow.idl to GlobalEventHandlers.idl
per https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers

* fast/dom/event-handler-attributes-expected.txt: Rebaselined.
* fast/dom/event-handler-attributes.html:
    Move resize from uniqueWindowEvents to eventsInGlobalEventHandlers.
* http/tests/media/hls/hls-video-resize-expected.txt: Added.
* http/tests/media/hls/hls-video-resize.html: Added.
* js/dom/dom-static-property-for-in-iteration-expected.txt: Rebaselined.
* media/video-resize-expected.txt: Added.
* media/video-resize.html: Added.
* media/video-test.js:
(requiredEvents): Deleted global. Value is now captured by closure.
(waitForEventsAndCall): Remove dependence on global variable, and fix event observation leak.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/event-handler-attributes-expected.txt
LayoutTests/fast/dom/event-handler-attributes.html
LayoutTests/http/tests/media/hls/hls-video-resize-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/media/hls/hls-video-resize.html [new file with mode: 0644]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt
LayoutTests/media/video-resize-expected.txt [new file with mode: 0644]
LayoutTests/media/video-resize.html [new file with mode: 0644]
LayoutTests/media/video-test.js
Source/WebCore/ChangeLog
Source/WebCore/dom/GlobalEventHandlers.idl
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLVideoElement.cpp
Source/WebCore/html/HTMLVideoElement.h
Source/WebCore/page/DOMWindow.idl
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js