Changeset 195953 in webkit
- Timestamp:
- Jan 31, 2016 10:34:07 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r195950 r195953 1 2016-01-31 Jeremy Jones <jeremyj@apple.com> 2 3 Add resize event for HTMLMediaElement 4 https://bugs.webkit.org/show_bug.cgi?id=125715 5 6 Reviewed by Darin Adler. 7 8 Update test for change: move resize javascript event from DOMWindow.idl to GlobalEventHandlers.idl 9 per https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers 10 11 * fast/dom/event-handler-attributes-expected.txt: Rebaselined. 12 * fast/dom/event-handler-attributes.html: 13 Move resize from uniqueWindowEvents to eventsInGlobalEventHandlers. 14 * http/tests/media/hls/hls-video-resize-expected.txt: Added. 15 * http/tests/media/hls/hls-video-resize.html: Added. 16 * js/dom/dom-static-property-for-in-iteration-expected.txt: Rebaselined. 17 * media/video-resize-expected.txt: Added. 18 * media/video-resize.html: Added. 19 * media/video-test.js: 20 (requiredEvents): Deleted global. Value is now captured by closure. 21 (waitForEventsAndCall): Remove dependence on global variable, and fix event observation leak. 22 1 23 2016-01-31 Brent Fulgham <bfulgham@apple.com> 2 24 -
trunk/LayoutTests/fast/dom/event-handler-attributes-expected.txt
r184616 r195953 149 149 PASS testScriptAttribute(document, "readystatechange") is "document" 150 150 PASS testScriptAttribute(document, "reset") is "document" 151 PASS testScriptAttribute(document, "resize") is "document" 151 152 PASS testScriptAttribute(document, "scroll") is "document" 152 153 PASS testScriptAttribute(document, "search") is "document" … … 181 182 PASS testScriptAttribute(document, "pageshow") is "none" 182 183 PASS testScriptAttribute(document, "popstate") is "none" 183 PASS testScriptAttribute(document, "resize") is "none"184 184 PASS testScriptAttribute(document, "storage") is "none" 185 185 PASS testScriptAttribute(document, "transitionend") is "none" … … 247 247 PASS testElementAttribute(element, "ratechange") is "target" 248 248 PASS testElementAttribute(element, "reset") is "target" 249 PASS testElementAttribute(element, "resize") is "target" 249 250 PASS testElementAttribute(element, "scroll") is "target" 250 251 PASS testElementAttribute(element, "search") is "target" … … 278 279 PASS testElementAttribute(element, "popstate") is "none" 279 280 PASS testElementAttribute(element, "readystatechange") is "none" 280 PASS testElementAttribute(element, "resize") is "none"281 281 PASS testElementAttribute(element, "selectionchange") is "none" 282 282 PASS testElementAttribute(element, "storage") is "none" … … 340 340 PASS testElementAttribute(inputElement, "ratechange") is "target" 341 341 PASS testElementAttribute(inputElement, "reset") is "target" 342 PASS testElementAttribute(inputElement, "resize") is "target" 342 343 PASS testElementAttribute(inputElement, "scroll") is "target" 343 344 PASS testElementAttribute(inputElement, "search") is "target" … … 371 372 PASS testElementAttribute(inputElement, "popstate") is "none" 372 373 PASS testElementAttribute(inputElement, "readystatechange") is "none" 373 PASS testElementAttribute(inputElement, "resize") is "none"374 374 PASS testElementAttribute(inputElement, "selectionchange") is "none" 375 375 PASS testElementAttribute(inputElement, "storage") is "none" … … 433 433 PASS testElementAttribute(audioElement, "ratechange") is "target" 434 434 PASS testElementAttribute(audioElement, "reset") is "target" 435 PASS testElementAttribute(audioElement, "resize") is "target" 435 436 PASS testElementAttribute(audioElement, "scroll") is "target" 436 437 PASS testElementAttribute(audioElement, "search") is "target" … … 464 465 PASS testElementAttribute(audioElement, "popstate") is "none" 465 466 PASS testElementAttribute(audioElement, "readystatechange") is "none" 466 PASS testElementAttribute(audioElement, "resize") is "none"467 467 PASS testElementAttribute(audioElement, "selectionchange") is "none" 468 468 PASS testElementAttribute(audioElement, "storage") is "none" … … 526 526 PASS testElementAttribute(videoElement, "ratechange") is "target" 527 527 PASS testElementAttribute(videoElement, "reset") is "target" 528 PASS testElementAttribute(videoElement, "resize") is "target" 528 529 PASS testElementAttribute(videoElement, "scroll") is "target" 529 530 PASS testElementAttribute(videoElement, "search") is "target" … … 557 558 PASS testElementAttribute(videoElement, "popstate") is "none" 558 559 PASS testElementAttribute(videoElement, "readystatechange") is "none" 559 PASS testElementAttribute(videoElement, "resize") is "none"560 560 PASS testElementAttribute(videoElement, "selectionchange") is "none" 561 561 PASS testElementAttribute(videoElement, "storage") is "none" … … 817 817 PASS testElementAttribute(rectElement, "ratechange") is "target" 818 818 PASS testElementAttribute(rectElement, "reset") is "target" 819 PASS testElementAttribute(rectElement, "resize") is "target" 819 820 PASS testElementAttribute(rectElement, "scroll") is "target" 820 821 PASS testElementAttribute(rectElement, "search") is "target" … … 848 849 PASS testElementAttribute(rectElement, "popstate") is "none" 849 850 PASS testElementAttribute(rectElement, "readystatechange") is "none" 850 PASS testElementAttribute(rectElement, "resize") is "none"851 851 PASS testElementAttribute(rectElement, "selectionchange") is "none" 852 852 PASS testElementAttribute(rectElement, "storage") is "none" … … 920 920 PASS testElementAttribute(nonHTMLElement, "readystatechange") is "none" 921 921 FAIL testElementAttribute(nonHTMLElement, "reset") should be none. Was script: target; content: none. 922 PASS testElementAttribute(nonHTMLElement, "resize") is "none" 922 FAIL testElementAttribute(nonHTMLElement, "resize") should be none. Was script: target; content: none. 923 923 FAIL testElementAttribute(nonHTMLElement, "scroll") should be none. Was script: target; content: none. 924 924 FAIL testElementAttribute(nonHTMLElement, "search") should be none. Was script: target; content: none. -
trunk/LayoutTests/fast/dom/event-handler-attributes.html
r187012 r195953 57 57 "ratechange", 58 58 "reset", 59 "resize", 59 60 "scroll", 60 61 "seeked", … … 106 107 107 108 const uniqueWindowEvents = [ 108 "resize"109 109 ]; 110 110 -
trunk/LayoutTests/imported/w3c/ChangeLog
r195924 r195953 1 2016-01-31 Jeremy Jones <jeremyj@apple.com> 2 3 Add resize event for HTMLMediaElement 4 https://bugs.webkit.org/show_bug.cgi?id=125715 5 6 Reviewed by Darin Adler. 7 8 Rebaselined test after moving 'resize' from DOMWindow.idl to GlobalEventHandlers.idl 9 per https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers 10 11 * web-platform-tests/html/dom/interfaces-expected.txt: 12 1 13 2016-01-31 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
r195907 r195953 110 110 FAIL Document interface: attribute onratechange assert_equals: getter must be Function expected "function" but got "undefined" 111 111 FAIL Document interface: attribute onreset assert_equals: getter must be Function expected "function" but got "undefined" 112 FAIL Document interface: attribute onresize assert_ true: The prototype object must have a property "onresize" expected true got false112 FAIL Document interface: attribute onresize assert_equals: getter must be Function expected "function" but got "undefined" 113 113 FAIL Document interface: attribute onscroll assert_equals: getter must be Function expected "function" but got "undefined" 114 114 FAIL Document interface: attribute onseeked assert_equals: getter must be Function expected "function" but got "undefined" … … 342 342 PASS Document interface: iframe.contentDocument must inherit property "onratechange" with the proper type (141) 343 343 PASS Document interface: iframe.contentDocument must inherit property "onreset" with the proper type (142) 344 FAIL Document interface: iframe.contentDocument must inherit property "onresize" with the proper type (143) assert_inherits: property "onresize" not found in prototype chain 344 PASS Document interface: iframe.contentDocument must inherit property "onresize" with the proper type (143) 345 345 PASS Document interface: iframe.contentDocument must inherit property "onscroll" with the proper type (144) 346 346 PASS Document interface: iframe.contentDocument must inherit property "onseeked" with the proper type (145) … … 657 657 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onratechange" with the proper type (141) 658 658 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onreset" with the proper type (142) 659 FAIL Document interface: document.implementation.createDocument(null, "", null) must inherit property "onresize" with the proper type (143) assert_inherits: property "onresize" not found in prototype chain 659 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onresize" with the proper type (143) 660 660 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onscroll" with the proper type (144) 661 661 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onseeked" with the proper type (145) … … 939 939 FAIL HTMLElement interface: attribute onratechange assert_own_property: expected property "onratechange" missing 940 940 FAIL HTMLElement interface: attribute onreset assert_own_property: expected property "onreset" missing 941 FAIL HTMLElement interface: attribute onresize assert_ true: The prototype object must have a property "onresize" expected true got false941 FAIL HTMLElement interface: attribute onresize assert_own_property: expected property "onresize" missing 942 942 FAIL HTMLElement interface: attribute onscroll assert_own_property: expected property "onscroll" missing 943 943 FAIL HTMLElement interface: attribute onseeked assert_own_property: expected property "onseeked" missing … … 1036 1036 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onratechange" with the proper type (79) 1037 1037 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onreset" with the proper type (80) 1038 FAIL HTMLElement interface: document.createElement("noscript") must inherit property "onresize" with the proper type (81) assert_inherits: property "onresize" not found in prototype chain 1038 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onresize" with the proper type (81) 1039 1039 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onscroll" with the proper type (82) 1040 1040 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onseeked" with the proper type (83) -
trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt
r195778 r195953 112 112 PASS a["onratechange"] is null 113 113 PASS a["onreset"] is null 114 PASS a["onresize"] is null 114 115 PASS a["onscroll"] is null 115 116 PASS a["onseeked"] is null -
trunk/LayoutTests/media/video-test.js
r183428 r195953 350 350 } 351 351 352 var requiredEvents = [];353 354 352 function waitForEventsAndCall(eventList, func) 355 353 { 354 var requiredEvents = [] 355 356 356 function _eventCallback(event) 357 357 { … … 359 359 return; 360 360 361 var index = requiredEvents.indexOf(event.type); 362 if (index < 0) 361 for (var index = 0; index < requiredEvents.length; index++) { 362 if (requiredEvents[index][1] === event.type) { 363 break; 364 } 365 } 366 if (index >= requiredEvents.length) 363 367 return; 364 368 369 requiredEvents[index][0].removeEventListener(event, _eventCallback); 365 370 requiredEvents.splice(index, 1); 366 371 if (requiredEvents.length) … … 370 375 } 371 376 372 requiredEvents = [];373 377 for (var i = 0; i < eventList.length; i++) { 374 requiredEvents[i] = eventList[i] [1];375 eventList[i][0].addEventListener(requiredEvents[i], _eventCallback, true);378 requiredEvents[i] = eventList[i].slice(0); 379 requiredEvents[i][0].addEventListener(requiredEvents[i][1], _eventCallback, true); 376 380 } 377 381 } -
trunk/Source/WebCore/ChangeLog
r195952 r195953 1 2016-01-31 Jeremy Jones <jeremyj@apple.com> 2 3 Add resize event for HTMLMediaElement 4 https://bugs.webkit.org/show_bug.cgi?id=125715 5 6 Reviewed by Darin Adler. 7 8 Tests: http/tests/media/hls/hls-video-resize.html 9 media/video-resize.html 10 11 Move resize javascript event from DOMWindow.idl to GlobalEventHandlers.idl 12 per https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers 13 14 Post resize event from video element when metadata loads and when content size changes. 15 16 * dom/GlobalEventHandlers.idl: Add onresize. 17 * html/HTMLElement.cpp: 18 (WebCore::HTMLElement::createEventHandlerNameMap): Add onresizeAttr. 19 * html/HTMLMediaElement.cpp: 20 (WebCore::HTMLMediaElement::setReadyState): 21 (WebCore::HTMLMediaElement::mediaPlayerSizeChanged): 22 * html/HTMLMediaElement.h: 23 (WebCore::HTMLMediaElement::scheduleResizeEvent): 24 (WebCore::HTMLMediaElement::scheduleResizeEventIfSizeChanged): 25 * html/HTMLVideoElement.cpp: 26 (WebCore::HTMLVideoElement::scheduleResizeEvent): Sechedule event. 27 (WebCore::HTMLVideoElement::scheduleResizeEventIfSizeChanged): Schedule event if size has changed. 28 * html/HTMLVideoElement.h: Add declarations. 29 * page/DOMWindow.idl: Remove onresize. 30 1 31 2016-01-31 Darin Adler <darin@apple.com> 2 32 -
trunk/Source/WebCore/dom/GlobalEventHandlers.idl
r195778 r195953 81 81 attribute EventHandler onratechange; 82 82 attribute EventHandler onreset; 83 //attribute EventHandler onresize;83 attribute EventHandler onresize; 84 84 attribute EventHandler onscroll; 85 85 attribute EventHandler onseeked; -
trunk/Source/WebCore/html/HTMLElement.cpp
r195501 r195953 315 315 &onratechangeAttr, 316 316 &onresetAttr, 317 &onresizeAttr, 317 318 &onscrollAttr, 318 319 &onsearchAttr, -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r195755 r195953 2151 2151 prepareMediaFragmentURI(); 2152 2152 scheduleEvent(eventNames().durationchangeEvent); 2153 scheduleResizeEvent(); 2153 2154 scheduleEvent(eventNames().loadedmetadataEvent); 2154 2155 #if ENABLE(WIRELESS_PLAYBACK_TARGET) … … 4497 4498 4498 4499 beginProcessingMediaPlayerCallback(); 4500 if (m_readyState > HAVE_NOTHING) 4501 scheduleResizeEventIfSizeChanged(); 4499 4502 if (renderer()) 4500 4503 renderer()->updateFromElement(); -
trunk/Source/WebCore/html/HTMLMediaElement.h
r195755 r195953 639 639 640 640 void scheduleTimeupdateEvent(bool periodicEvent); 641 virtual void scheduleResizeEvent() { } 642 virtual void scheduleResizeEventIfSizeChanged() { } 641 643 642 644 // loading -
trunk/Source/WebCore/html/HTMLVideoElement.cpp
r195487 r195953 187 187 } 188 188 189 void HTMLVideoElement::scheduleResizeEvent() 190 { 191 m_lastReportedVideoWidth = videoWidth(); 192 m_lastReportedVideoHeight = videoHeight(); 193 scheduleEvent(eventNames().resizeEvent); 194 } 195 196 void HTMLVideoElement::scheduleResizeEventIfSizeChanged() 197 { 198 if (m_lastReportedVideoWidth == videoWidth() && m_lastReportedVideoHeight == videoHeight()) 199 return; 200 scheduleResizeEvent(); 201 } 202 189 203 bool HTMLVideoElement::isURLAttribute(const Attribute& attribute) const 190 204 { -
trunk/Source/WebCore/html/HTMLVideoElement.h
r195487 r195953 42 42 WEBCORE_EXPORT unsigned videoWidth() const; 43 43 WEBCORE_EXPORT unsigned videoHeight() const; 44 44 45 45 // Fullscreen 46 46 void webkitEnterFullscreen(ExceptionCode&); … … 90 90 HTMLVideoElement(const QualifiedName&, Document&, bool); 91 91 92 virtual void scheduleResizeEvent() override; 93 virtual void scheduleResizeEventIfSizeChanged() override; 92 94 virtual bool rendererIsNeeded(const RenderStyle&) override; 93 95 virtual void didAttachRenderers() override; … … 111 113 112 114 AtomicString m_defaultPosterURL; 115 116 unsigned m_lastReportedVideoWidth { 0 }; 117 unsigned m_lastReportedVideoHeight { 0 }; 113 118 }; 114 119 -
trunk/Source/WebCore/page/DOMWindow.idl
r195907 r195953 216 216 // Event Handlers 217 217 218 // FIXME: This should be in GlobalEventHandlers.idl according to HTML5 - https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers219 [NotEnumerable] attribute EventHandler onresize;220 221 218 // Unique to Element and DOMWindow 222 219 // FIXME: Should these be exposed on Document as well (and therefore moved to GlobalEventHandlers.idl)? -
trunk/Source/WebInspectorUI/ChangeLog
r195923 r195953 1 2016-01-31 Jeremy Jones <jeremyj@apple.com> 2 3 Add resize event for HTMLMediaElement 4 https://bugs.webkit.org/show_bug.cgi?id=125715 5 6 Reviewed by Darin Adler. 7 8 Add a display name for "resize" event. 9 10 * UserInterface/Models/ScriptTimelineRecord.js: 11 (WebInspector.ScriptTimelineRecord.EventType.displayName): 12 1 13 2016-01-30 Dave Hyatt <hyatt@apple.com> 2 14 -
trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js
r195566 r195953 293 293 nameMap.set("removestream", "Remove Stream"); 294 294 nameMap.set("removetrack", "Remove Track"); 295 nameMap.set("resize", "Resize"); 295 296 nameMap.set("securitypolicyviolation", "Security Policy Violation"); 296 297 nameMap.set("selectionchange", "Selection Change");
Note: See TracChangeset
for help on using the changeset viewer.