Changeset 171004 in webkit
- Timestamp:
- Jul 11, 2014, 10:32:17 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r171001 r171004 1 2014-07-11 Brent Fulgham <bfulgham@apple.com> 2 3 Use a separate backdrop element to allow cues to have highlight and background color 4 https://bugs.webkit.org/show_bug.cgi?id=134821 5 <rdar://problem/15999721> 6 7 Reviewed by Eric Carlson. 8 9 Updated tests for new formatting logic. 10 11 * platform/mac/media/track/track-cue-rendering-horizontal-expected.png: 12 * platform/mac/media/track/track-cue-rendering-horizontal-expected.txt: 13 1 14 2014-07-11 Zalan Bujtas <zalan@apple.com> 2 15 -
trunk/LayoutTests/platform/mac/media/track/track-cue-rendering-horizontal-expected.png
-
Property svn:mime-type
set to
image/png
-
Property svn:mime-type
set to
-
trunk/LayoutTests/platform/mac/media/track/track-cue-rendering-horizontal-expected.txt
r150260 r171004 27 27 layer at (8,8) size 320x14 28 28 RenderBlock (positioned) {DIV} at (0,0) size 320x14 29 RenderInline {SPAN} at (0,0) size 276x14 [bgcolor=#000000CC] 30 RenderText {#text} at (22,0) size 276x14 31 text run at (22,0) width 276: "Cue 1: should be positioned at the top of the video." 29 RenderBlock {DIV} at (22,0) size 276x14 30 RenderInline {SPAN} at (0,0) size 275x14 [bgcolor=#000000CC] 31 RenderText {#text} at (0,0) size 275x14 32 text run at (0,0) width 275: "Cue 1: should be positioned at the top of the video." 32 33 layer at (8,22) size 320x14 33 34 RenderBlock (positioned) {DIV} at (0,14) size 320x14 34 RenderInline {SPAN} at (0,0) size 304x14 [bgcolor=#000000CC] 35 RenderText {#text} at (8,0) size 304x14 36 text run at (8,0) width 304: "Cue 2: should be the second cue and not overlap cue 1." 35 RenderBlock {DIV} at (8,0) size 304x14 36 RenderInline {SPAN} at (0,0) size 303x14 [bgcolor=#000000CC] 37 RenderText {#text} at (0,0) size 303x14 38 text run at (0,0) width 303: "Cue 2: should be the second cue and not overlap cue 1." 37 39 layer at (8,36) size 320x14 38 40 RenderBlock (positioned) {DIV} at (0,28) size 320x14 39 RenderInline {SPAN} at (0,0) size 296x14 [bgcolor=#000000CC] 40 RenderText {#text} at (12,0) size 296x14 41 text run at (12,0) width 296: "Cue 3: should become the third line from top to bottom." 41 RenderBlock {DIV} at (12,0) size 296x14 42 RenderInline {SPAN} at (0,0) size 296x14 [bgcolor=#000000CC] 43 RenderText {#text} at (0,0) size 296x14 44 text run at (0,0) width 296: "Cue 3: should become the third line from top to bottom." 42 45 layer at (8,78) size 320x14 43 46 RenderBlock (positioned) {DIV} at (0,70) size 320x14 44 RenderInline {SPAN} at (0,0) size 288x14 [bgcolor=#000000CC] 45 RenderText {#text} at (16,0) size 288x14 46 text run at (16,0) width 288: "Cue 4: should be fixed positioned around the middle." 47 RenderBlock {DIV} at (16,0) size 288x14 48 RenderInline {SPAN} at (0,0) size 287x14 [bgcolor=#000000CC] 49 RenderText {#text} at (0,0) size 287x14 50 text run at (0,0) width 287: "Cue 4: should be fixed positioned around the middle." 47 51 layer at (8,234) size 320x14 48 52 RenderBlock (positioned) {DIV} at (0,226) size 320x14 49 RenderInline {SPAN} at (0,0) size 292x14 [bgcolor=#000000CC] 50 RenderText {#text} at (14,0) size 292x14 51 text run at (14,0) width 292: "Cue 5: should be displayed at the bottom of the video." 53 RenderBlock {DIV} at (14,0) size 292x14 54 RenderInline {SPAN} at (0,0) size 291x14 [bgcolor=#000000CC] 55 RenderText {#text} at (0,0) size 291x14 56 text run at (0,0) width 291: "Cue 5: should be displayed at the bottom of the video." 52 57 layer at (8,220) size 320x14 53 58 RenderBlock (positioned) {DIV} at (0,212) size 320x14 54 RenderInline {SPAN} at (0,0) size 280x14 [bgcolor=#000000CC] 55 RenderText {#text} at (20,0) size 280x14 56 text run at (20,0) width 280: "Cue 6: should be on top of bottom positioned cue 5." 59 RenderBlock {DIV} at (20,0) size 280x14 60 RenderInline {SPAN} at (0,0) size 279x14 [bgcolor=#000000CC] 61 RenderText {#text} at (0,0) size 279x14 62 text run at (0,0) width 279: "Cue 6: should be on top of bottom positioned cue 5." -
trunk/Source/WebCore/ChangeLog
r171001 r171004 1 2014-07-10 Brent Fulgham <bfulgham@apple.com> 2 3 Use a separate backdrop element to allow cues to have highlight and background color 4 https://bugs.webkit.org/show_bug.cgi?id=134821 5 <rdar://problem/15999721> 6 7 Reviewed by Eric Carlson. 8 9 Add a new <div> element wrapping the existing cue <span>. This allows 10 us to have a highlight on the cue (in the <span> background), as well 11 as an overall background color. 12 13 * Modules/mediacontrols/mediaControlsApple.css: 14 (video::-webkit-media-text-track-display-backdrop): New markup for 15 the backdrop element of the caption. 16 * html/track/VTTCue.cpp: 17 (WebCore::VTTCue::cueBackdropShadowPseudoId): Added to 18 allow user customization of the cue backdrop. 19 (WebCore::VTTCue::initialize): Rename the old "m_cueBackgroundBox" to 20 "m_cueHighlightBox" and add a new "m_cueBackdropBox" member. 21 (WebCore::VTTCue::updateDisplayTree): Update for m_cueHighlightBox. 22 (WebCore::VTTCue::getDisplayTree): Make m_cueHighlightBox a child 23 of the new m_cueBackdropBox element, and add m_cueBackdropBox to 24 the display tree. 25 * html/track/VTTCue.h: 26 (WebCore::VTTCue::element): 27 * page/CaptionUserPreferencesMediaAF.cpp: 28 (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges): 29 Fix for missing caption style updates. Even if we are already 30 listening for caption changes, we still want to update the new 31 instance's style sheet to match. 32 (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride): 33 * rendering/RenderVTTCue.cpp: 34 (WebCore::RenderVTTCue::initializeLayoutParameters): Take the new 35 <div> into consideration when looking for the Cue text element. 36 1 37 2014-07-11 Zalan Bujtas <zalan@apple.com> 2 38 -
trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.css
r169019 r171004 729 729 } 730 730 731 video::-webkit-media-text-track-display-backdrop { 732 display: inline-block; 733 } 734 731 735 video::cue(:future) { 732 736 color: gray; -
trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css
r169636 r171004 381 381 } 382 382 383 video::-webkit-media-text-track-display-backdrop { 384 display: inline-block; 385 } 386 383 387 video::cue(:future) { 384 388 color: gray; -
trunk/Source/WebCore/html/track/VTTCue.cpp
r170774 r171004 217 217 // ---------------------------- 218 218 219 const AtomicString& VTTCue::cueBackdropShadowPseudoId() 220 { 221 DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, cueBackdropShadowPseudoId, ("-webkit-media-text-track-display-backdrop", AtomicString::ConstructFromLiteral)); 222 return cueBackdropShadowPseudoId; 223 } 224 219 225 PassRefPtr<VTTCue> VTTCue::create(ScriptExecutionContext& context, double start, double end, const String& content) 220 226 { … … 263 269 m_cueAlignment = Middle; 264 270 m_webVTTNodeTree = nullptr; 265 m_cueBackgroundBox = HTMLSpanElement::create(spanTag, toDocument(context)); 271 m_cueBackdropBox = HTMLDivElement::create(toDocument(context)); 272 m_cueHighlightBox = HTMLSpanElement::create(spanTag, toDocument(context)); 266 273 m_displayDirection = CSSValueLtr; 267 274 m_displaySize = 0; … … 758 765 759 766 // Clear the contents of the set. 760 m_cue BackgroundBox->removeChildren();767 m_cueHighlightBox->removeChildren(); 761 768 762 769 // Update the two sets containing past and future WebVTT objects. … … 766 773 767 774 markFutureAndPastNodes(referenceTree.get(), startTime(), movieTime); 768 m_cue BackgroundBox->appendChild(referenceTree);775 m_cueHighlightBox->appendChild(referenceTree); 769 776 } 770 777 … … 789 796 // background box. 790 797 791 // Note: This is contained by default in m_cueBackgroundBox. 792 m_cueBackgroundBox->setPseudo(cueShadowPseudoId()); 793 displayTree->appendChild(m_cueBackgroundBox, ASSERT_NO_EXCEPTION); 798 // Note: This is contained by default in m_cueHighlightBox. 799 m_cueHighlightBox->setPseudo(cueShadowPseudoId()); 800 801 m_cueBackdropBox->setPseudo(cueBackdropShadowPseudoId()); 802 m_cueBackdropBox->appendChild(m_cueHighlightBox, ASSERT_NO_EXCEPTION); 803 displayTree->appendChild(m_cueBackdropBox, ASSERT_NO_EXCEPTION); 794 804 795 805 // FIXME(BUG 79916): Runs of children of WebVTT Ruby Objects that are not -
trunk/Source/WebCore/html/track/VTTCue.h
r170694 r171004 43 43 44 44 class DocumentFragment; 45 class HTMLDivElement; 45 46 class HTMLSpanElement; 46 47 class ScriptExecutionContext; … … 75 76 static PassRefPtr<VTTCue> create(ScriptExecutionContext&, const WebVTTCueData&); 76 77 78 static const AtomicString& cueBackdropShadowPseudoId(); 79 77 80 virtual ~VTTCue(); 78 81 … … 114 117 bool hasDisplayTree() const { return m_displayTree; } 115 118 VTTCueBox* getDisplayTree(const IntSize& videoSize); 116 HTMLSpanElement* element() const { return m_cue BackgroundBox.get(); }119 HTMLSpanElement* element() const { return m_cueHighlightBox.get(); } 117 120 118 121 void updateDisplayTree(double); … … 203 206 204 207 RefPtr<DocumentFragment> m_webVTTNodeTree; 205 RefPtr<HTMLSpanElement> m_cueBackgroundBox; 208 RefPtr<HTMLSpanElement> m_cueHighlightBox; 209 RefPtr<HTMLDivElement> m_cueBackdropBox; 206 210 RefPtr<VTTCueBox> m_displayTree; 207 211 -
trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
r169725 r171004 235 235 m_listeningForPreferenceChanges = true; 236 236 CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, userCaptionPreferencesChangedNotificationCallback, kMAXCaptionAppearanceSettingsChangedNotification, 0, CFNotificationSuspensionBehaviorCoalesce); 237 updateCaptionStyleSheetOveride(); 238 } 237 } 238 239 updateCaptionStyleSheetOveride(); 239 240 } 240 241 … … 541 542 if (!windowColor.isEmpty() || !windowCornerRadius.isEmpty()) { 542 543 captionsOverrideStyleSheet.append(" video::"); 543 captionsOverrideStyleSheet.append(VTTCue Box::vttCueBoxShadowPseudoId());544 captionsOverrideStyleSheet.append(VTTCue::cueBackdropShadowPseudoId()); 544 545 captionsOverrideStyleSheet.append('{'); 545 546 546 547 if (!windowColor.isEmpty()) 547 548 captionsOverrideStyleSheet.append(windowColor); 548 if (!windowCornerRadius.isEmpty()) 549 if (!windowCornerRadius.isEmpty()) { 549 550 captionsOverrideStyleSheet.append(windowCornerRadius); 551 } 550 552 551 553 captionsOverrideStyleSheet.append('}'); -
trunk/Source/WebCore/rendering/RenderVTTCue.cpp
r170774 r171004 75 75 76 76 RenderBlock* parentBlock = containingBlock(); 77 firstLineBox = toRenderInline(firstChild())->firstLineBox(); 77 78 // firstChild() returns the wrapping (backdrop) <div>. The cue object is 79 // the <div>'s first child. 80 RenderObject* firstChild = this->firstChild(); 81 RenderElement* backdropElement = toRenderElement(firstChild); 82 83 firstLineBox = toRenderInline(backdropElement->firstChild())->firstLineBox(); 78 84 if (!firstLineBox) 79 85 firstLineBox = this->firstRootBox(); … … 335 341 { 336 342 ASSERT(firstChild()); 337 InlineFlowBox* firstLineBox = toRenderInline(firstChild())->firstLineBox(); 343 344 // firstChild() returns the wrapping (backdrop) <div>. The cue object is 345 // the <div>'s first child. 346 RenderObject* firstChild = this->firstChild(); 347 RenderElement* backdropElement = toRenderElement(firstChild); 348 349 InlineFlowBox* firstLineBox = toRenderInline(backdropElement->firstChild())->firstLineBox(); 338 350 if (static_cast<TextTrackCueGeneric*>(m_cue)->useDefaultPosition() && firstLineBox) { 339 351 LayoutUnit parentWidth = containingBlock()->logicalWidth(); -
trunk/WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme
r168541 r171004 131 131 <Testables> 132 132 </Testables> 133 <MacroExpansion> 134 <BuildableReference 135 BuildableIdentifier = "primary" 136 BlueprintIdentifier = "8D1107260486CEB800E47090" 137 BuildableName = "MiniBrowser.app" 138 BlueprintName = "MiniBrowser" 139 ReferencedContainer = "container:Tools/MiniBrowser/MiniBrowser.xcodeproj"> 140 </BuildableReference> 141 </MacroExpansion> 133 142 </TestAction> 134 143 <LaunchAction … … 141 150 debugDocumentVersioning = "YES" 142 151 allowLocationSimulation = "YES"> 143 <PathRunnable 144 FilePath = "/Applications/Safari.app/Contents/MacOS/SafariForWebKitDevelopment"> 145 </PathRunnable> 152 <BuildableProductRunnable> 153 <BuildableReference 154 BuildableIdentifier = "primary" 155 BlueprintIdentifier = "8D1107260486CEB800E47090" 156 BuildableName = "MiniBrowser.app" 157 BlueprintName = "MiniBrowser" 158 ReferencedContainer = "container:Tools/MiniBrowser/MiniBrowser.xcodeproj"> 159 </BuildableReference> 160 </BuildableProductRunnable> 146 161 <AdditionalOptions> 147 162 </AdditionalOptions>
Note:
See TracChangeset
for help on using the changeset viewer.