Changeset 244078 in webkit
- Timestamp:
- Apr 9, 2019 8:57:45 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r244061 r244078 1 2019-04-09 Jer Noble <jer.noble@apple.com> 2 3 Add test for fix of #196095 4 https://bugs.webkit.org/show_bug.cgi?id=196097 5 6 Reviewed by Eric Carlson. 7 8 * media/track/track-in-band-metadata-display-order-expected.txt: Added. 9 * media/track/track-in-band-metadata-display-order.html: Added. 10 1 11 2019-04-08 Chris Fleizach <cfleizach@apple.com> 2 12 -
trunk/Source/WebCore/CMakeLists.txt
r244065 r244078 1369 1369 html/track/TextTrack.idl 1370 1370 html/track/TextTrackCue.idl 1371 html/track/TextTrackCueGeneric.idl 1371 1372 html/track/TextTrackCueList.idl 1372 1373 html/track/TextTrackList.idl -
trunk/Source/WebCore/ChangeLog
r244077 r244078 1 2019-04-09 Jer Noble <jer.noble@apple.com> 2 3 Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order. 4 https://bugs.webkit.org/show_bug.cgi?id=196097 5 6 Reviewed by Eric Carlson. 7 8 Test: media/track/track-in-band-metadata-display-order.html 9 10 Add a method in Internals to create a TextTrackCueGeneric (which can normally only be created 11 by parsing an in-band media track). This requires adding IDL for TextTrackCueGeneric, and exporting 12 TextTrackCueGeneric for testing. 13 14 Drive-by fixes: 15 16 Add runtime logging to MediaControlTextTrackContainerElement. This necessitates modifying the 17 parentMediaElement() method to take a const Node*, and const_cast that constness away in order to return 18 a HTMLMediaElement* 19 20 TextTrackCue, VTTCue, TextTrackCueGeneric, and DataCue should all use the WTF TypeCasts macros to 21 enable use of is<> and downcast<>. 22 23 * Source/WebCore/CMakeLists.txt: 24 * DerivedSources-input.xcfilelist: 25 * DerivedSources-output.xcfilelist: 26 * DerivedSources.make: 27 * WebCore.xcodeproj/project.pbxproj: 28 * Sources.txt: 29 * html/shadow/MediaControlElementTypes.cpp: 30 (WebCore::parentMediaElement): 31 * html/shadow/MediaControlElementTypes.h: 32 * html/shadow/MediaControlElements.cpp: 33 (WebCore::MediaControlTextTrackContainerElement::updateDisplay): 34 (WebCore::MediaControlTextTrackContainerElement::logger const): 35 (WebCore::MediaControlTextTrackContainerElement::logIdentifier const): 36 (WebCore::MediaControlTextTrackContainerElement::logChannel const): 37 * html/shadow/MediaControlElements.h: 38 * html/track/DataCue.h: 39 (isType): 40 * html/track/TextTrackCueGeneric.h: 41 (isType): 42 * html/track/TextTrackCueGeneric.idl: Added. 43 * html/track/VTTCue.h: 44 (isType): 45 * testing/Internals.cpp: 46 (WebCore::Internals::createGenericCue): 47 * testing/Internals.h: 48 * testing/Internals.idl: 49 1 50 2019-04-09 Sihui Liu <sihui_liu@apple.com> 2 51 -
trunk/Source/WebCore/DerivedSources-input.xcfilelist
r243755 r244078 848 848 $(PROJECT_DIR)/html/track/TextTrack.idl 849 849 $(PROJECT_DIR)/html/track/TextTrackCue.idl 850 $(PROJECT_DIR)/html/track/TextTrackCueGeneric.idl 850 851 $(PROJECT_DIR)/html/track/TextTrackCueList.idl 851 852 $(PROJECT_DIR)/html/track/TextTrackList.idl -
trunk/Source/WebCore/DerivedSources-output.xcfilelist
r243755 r244078 1750 1750 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSTextTrackCue.cpp 1751 1751 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSTextTrackCue.h 1752 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSTextTrackCueGeneric.cpp 1753 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSTextTrackCueGeneric.h 1752 1754 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSTextTrackCueList.cpp 1753 1755 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSTextTrackCueList.h -
trunk/Source/WebCore/DerivedSources.make
r243755 r244078 827 827 $(WebCore)/html/track/TextTrack.idl \ 828 828 $(WebCore)/html/track/TextTrackCue.idl \ 829 $(WebCore)/html/track/TextTrackCueGeneric.idl \ 829 830 $(WebCore)/html/track/TextTrackCueList.idl \ 830 831 $(WebCore)/html/track/TextTrackList.idl \ -
trunk/Source/WebCore/Sources.txt
r243962 r244078 3436 3436 JSTextTrack.cpp 3437 3437 JSTextTrackCue.cpp 3438 JSTextTrackCueGeneric.cpp 3438 3439 JSTextTrackCueList.cpp 3439 3440 JSTextTrackList.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r244054 r244078 13748 13748 CDFC360318CA61C20026E56F /* RemoteCommandListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteCommandListener.cpp; sourceTree = "<group>"; }; 13749 13749 CDFC360418CA61C20026E56F /* RemoteCommandListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteCommandListener.h; sourceTree = "<group>"; }; 13750 CDFD78BA2242C4FE00D7208A /* JSTextTrackCueGeneric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTextTrackCueGeneric.h; sourceTree = "<group>"; }; 13751 CDFD78BB2242C4FF00D7208A /* JSTextTrackCueGeneric.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextTrackCueGeneric.cpp; sourceTree = "<group>"; }; 13752 CDFD78C22242FC4900D7208A /* TextTrackCueGeneric.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TextTrackCueGeneric.idl; sourceTree = "<group>"; }; 13750 13753 CE057FA31220731100A476D5 /* DocumentMarkerController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentMarkerController.cpp; sourceTree = "<group>"; }; 13751 13754 CE057FA41220731100A476D5 /* DocumentMarkerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentMarkerController.h; sourceTree = "<group>"; }; … … 22742 22745 070756D714239B4B00414161 /* JSTextTrackCue.cpp */, 22743 22746 070756D814239B4B00414161 /* JSTextTrackCue.h */, 22747 CDFD78BB2242C4FF00D7208A /* JSTextTrackCueGeneric.cpp */, 22748 CDFD78BA2242C4FE00D7208A /* JSTextTrackCueGeneric.h */, 22744 22749 070756D914239B4C00414161 /* JSTextTrackCueList.cpp */, 22745 22750 070756DA14239B4E00414161 /* JSTextTrackCueList.h */, … … 23683 23688 071A9EC0168FB56C002629F9 /* TextTrackCueGeneric.cpp */, 23684 23689 071A9EC1168FB56C002629F9 /* TextTrackCueGeneric.h */, 23690 CDFD78C22242FC4900D7208A /* TextTrackCueGeneric.idl */, 23685 23691 9759E93B14EF1CF80026A2DD /* TextTrackCueList.cpp */, 23686 23692 9759E93C14EF1CF80026A2DD /* TextTrackCueList.h */, -
trunk/Source/WebCore/html/shadow/MediaControlElementTypes.cpp
r243482 r244078 55 55 class Event; 56 56 57 RefPtr<HTMLMediaElement> parentMediaElement( Node* node)57 RefPtr<HTMLMediaElement> parentMediaElement(const Node* node) 58 58 { 59 59 if (!node) … … 61 61 RefPtr<Node> mediaNode = node->shadowHost(); 62 62 if (!mediaNode) 63 mediaNode = node;63 mediaNode = const_cast<Node*>(node); 64 64 if (!is<HTMLMediaElement>(*mediaNode)) 65 65 return nullptr; -
trunk/Source/WebCore/html/shadow/MediaControlElementTypes.h
r243482 r244078 73 73 }; 74 74 75 RefPtr<HTMLMediaElement> parentMediaElement( Node*);75 RefPtr<HTMLMediaElement> parentMediaElement(const Node*); 76 76 inline RefPtr<HTMLMediaElement> parentMediaElement(const RenderObject& renderer) { return parentMediaElement(renderer.node()); } 77 77 -
trunk/Source/WebCore/html/shadow/MediaControlElements.cpp
r243482 r244078 1173 1173 1174 1174 activeCues.removeAllMatching([] (CueInterval& cueInterval) { 1175 if (! cueInterval.data() || !cueInterval.data()->isRenderable())1175 if (!is<VTTCue>(cueInterval.data())) 1176 1176 return true; 1177 1177 1178 Ref Ptr<VTTCue> cue = toVTTCue(cueInterval.data());1178 Ref<VTTCue> cue = downcast<VTTCue>(*cueInterval.data()); 1179 1179 1180 1180 return !cue->isRenderable() … … 1198 1198 continue; 1199 1199 1200 RefPtr<VTTCue> cue = toVTTCue(activeCues[i].data()); 1201 ASSERT(cue); 1202 if (!cue) 1203 continue; 1204 1205 LOG(Media, "MediaControlTextTrackContainerElement::updateDisplay(%p) - adding and positioning cue #%zu: \"%s\", start=%.2f, end=%.2f, line=%.2f", this, i, cue->text().utf8().data(), cue->startTime(), cue->endTime(), cue->line()); 1200 RefPtr<VTTCue> cue = downcast<VTTCue>(activeCues[i].data()); 1201 1202 DEBUG_LOG(LOGIDENTIFIER, "adding and positioning cue ", i, ": \"", cue->text(), "\", start=", cue->startTime(), ", end=", cue->endTime(), ", line=", cue->line()); 1206 1203 Ref<VTTCueBox> displayBox = cue->getDisplayTree(m_videoDisplaySize.size(), m_fontSize); 1207 1204 RefPtr<VTTRegion> region = cue->track()->regions()->getRegionById(cue->regionId()); … … 1455 1452 } 1456 1453 1454 #if !RELEASE_LOG_DISABLED 1455 const Logger& MediaControlTextTrackContainerElement::logger() const 1456 { 1457 return document().logger(); 1458 } 1459 1460 const void* MediaControlTextTrackContainerElement::logIdentifier() const 1461 { 1462 if (auto mediaElement = parentMediaElement(this)) 1463 return mediaElement->logIdentifier(); 1464 return nullptr; 1465 } 1466 1467 WTFLogChannel& MediaControlTextTrackContainerElement::logChannel() const 1468 { 1469 return LogMedia; 1470 } 1471 #endif // !RELEASE_LOG_DISABLED 1472 1457 1473 #endif // ENABLE(VIDEO_TRACK) 1458 1474 -
trunk/Source/WebCore/html/shadow/MediaControlElements.h
r243482 r244078 34 34 #include "MediaControlElementTypes.h" 35 35 #include "TextTrackRepresentation.h" 36 #include <wtf/LoggerHelper.h> 36 37 37 38 namespace WebCore { … … 467 468 #if ENABLE(VIDEO_TRACK) 468 469 469 class MediaControlTextTrackContainerElement final : public MediaControlDivElement, public TextTrackRepresentationClient { 470 class MediaControlTextTrackContainerElement final 471 : public MediaControlDivElement 472 , public TextTrackRepresentationClient 473 #if !RELEASE_LOG_DISABLED 474 , private LoggerHelper 475 #endif 476 { 470 477 WTF_MAKE_ISO_ALLOCATED(MediaControlTextTrackContainerElement); 471 478 public: … … 481 488 void updateActiveCuesFontSize(); 482 489 void updateTextStrokeStyle(); 483 490 491 #if !RELEASE_LOG_DISABLED 492 const Logger& logger() const final; 493 const void* logIdentifier() const final; 494 WTFLogChannel& logChannel() const final; 495 const char* logClassName() const final { return "MediaControlTextTrackContainerElement"; } 496 #endif 497 484 498 explicit MediaControlTextTrackContainerElement(Document&); 485 499 -
trunk/Source/WebCore/html/track/DataCue.h
r243887 r244078 34 34 #include <JavaScriptCore/JSCJSValue.h> 35 35 #include <wtf/MediaTime.h> 36 #include <wtf/TypeCasts.h> 36 37 37 38 namespace WebCore { … … 125 126 } 126 127 128 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::DataCue) 129 static bool isType(const WebCore::TextTrackCue& cue) { return cue.cueType() == WebCore::TextTrackCue::Data; } 130 SPECIALIZE_TYPE_TRAITS_END() 131 127 132 #endif -
trunk/Source/WebCore/html/track/TextTrackCueGeneric.h
r243887 r244078 37 37 // A "generic" cue is a non-WebVTT cue, so it is not positioned/sized with the WebVTT logic. 38 38 class TextTrackCueGeneric final : public VTTCue { 39 WTF_MAKE_ISO_ALLOCATED (TextTrackCueGeneric);39 WTF_MAKE_ISO_ALLOCATED_EXPORT(TextTrackCueGeneric, WEBCORE_EXPORT); 40 40 public: 41 41 static Ref<TextTrackCueGeneric> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const String& content) … … 72 72 73 73 private: 74 TextTrackCueGeneric(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, const String&);74 WEBCORE_EXPORT TextTrackCueGeneric(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, const String&); 75 75 76 76 bool isOrderedBefore(const TextTrackCue*) const final; … … 110 110 111 111 } 112 113 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::TextTrackCueGeneric) 114 static bool isType(const WebCore::TextTrackCue& cue) { return cue.cueType() == WebCore::TextTrackCue::Generic; } 115 SPECIALIZE_TYPE_TRAITS_END() 116 112 117 #endif -
trunk/Source/WebCore/html/track/VTTCue.h
r243887 r244078 36 36 #include "HTMLElement.h" 37 37 #include "TextTrackCue.h" 38 #include <wtf/TypeCasts.h> 38 39 39 40 namespace WebCore { … … 262 263 } // namespace WTF 263 264 265 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::VTTCue) 266 static bool isType(const WebCore::TextTrackCue& cue) { return cue.isRenderable(); } 267 SPECIALIZE_TYPE_TRAITS_END() 268 264 269 #endif -
trunk/Source/WebCore/testing/Internals.cpp
r243958 r244078 214 214 #include "CaptionUserPreferences.h" 215 215 #include "PageGroup.h" 216 #include "TextTrackCueGeneric.h" 216 217 #endif 217 218 … … 3576 3577 } 3577 3578 3579 RefPtr<TextTrackCueGeneric> Internals::createGenericCue(double startTime, double endTime, String text) 3580 { 3581 Document* document = contextDocument(); 3582 if (!document || !document->page()) 3583 return nullptr; 3584 #if ENABLE(VIDEO_TRACK) 3585 return TextTrackCueGeneric::create(*document, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), text); 3586 #else 3587 UNUSED_PARAM(startTime); 3588 UNUSED_PARAM(endTime); 3589 UNUSED_PARAM(text); 3590 return nullptr; 3591 #endif 3592 } 3593 3578 3594 #if ENABLE(VIDEO) 3579 3595 -
trunk/Source/WebCore/testing/Internals.h
r243958 r244078 92 92 class StringCallback; 93 93 class StyleSheet; 94 class TextTrackCueGeneric; 94 95 class TimeRanges; 95 96 class TypeConversions; … … 544 545 ExceptionOr<void> setPrimaryAudioTrackLanguageOverride(const String&); 545 546 ExceptionOr<void> setCaptionDisplayMode(const String&); 547 RefPtr<TextTrackCueGeneric> createGenericCue(double startTime, double endTime, String text); 546 548 547 549 #if ENABLE(VIDEO) -
trunk/Source/WebCore/testing/Internals.idl
r243958 r244078 541 541 [Conditional=VIDEO_TRACK, MayThrowException] void setPrimaryAudioTrackLanguageOverride(DOMString language); 542 542 [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionDisplayMode(DOMString mode); 543 [Conditional=VIDEO_TRACK] TextTrackCueGeneric createGenericCue(double startTime, double endTime, DOMString text); 543 544 544 545 [Conditional=VIDEO] TimeRanges createTimeRanges(Float32Array startTimes, Float32Array -
trunk/Tools/ChangeLog
r244076 r244078 1 2019-04-09 Jer Noble <jer.noble@apple.com> 2 3 Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order. 4 https://bugs.webkit.org/show_bug.cgi?id=196097 5 6 Reviewed by Eric Carlson. 7 8 Drive-by bug fix: allow tests to play audio without a user gesture by default. 9 10 * DumpRenderTree/mac/DumpRenderTree.mm: 11 (resetWebPreferencesToConsistentValues): 12 * WebKitTestRunner/TestController.cpp: 13 (WTR::TestController::resetPreferencesToConsistentValues): 14 1 15 2019-04-09 Pablo Saavedra <psaavedra@igalia.com> 2 16 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r243666 r244078 938 938 939 939 [preferences setMediaPlaybackAllowsInline:YES]; 940 [preferences setMediaPlaybackRequiresUserGesture:NO]; 940 941 [preferences setVideoPlaybackRequiresUserGesture:NO]; 941 942 [preferences setAudioPlaybackRequiresUserGesture:NO]; -
trunk/Tools/WebKitTestRunner/TestController.cpp
r243927 r244078 867 867 WKPreferencesSetWebSQLDisabled(preferences, false); 868 868 869 WKPreferencesSetMediaPlaybackRequiresUserGesture(preferences, false); 870 WKPreferencesSetVideoPlaybackRequiresUserGesture(preferences, false); 871 WKPreferencesSetAudioPlaybackRequiresUserGesture(preferences, false); 872 869 873 platformResetPreferencesToConsistentValues(); 870 874 }
Note: See TracChangeset
for help on using the changeset viewer.