Changeset 259850 in webkit
- Timestamp:
- Apr 9, 2020 11:55:13 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r259844 r259850 1 2020-04-09 Peng Liu <peng.liu6@apple.com> 2 3 REGRESSION: (r258434) [ Mac WK1 ] media/track/track-css-user-override.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=210134 5 6 Reviewed by Eric Carlson. 7 8 Make the test reliable by replacing the timer and testExpected based approach 9 with the approach based on testExpectedEventually. Also remove unnecessary code. 10 11 * media/track/track-css-user-override.html: 12 1 13 2020-04-09 Cathie Chen <cathiechen@igalia.com> 2 14 -
trunk/LayoutTests/media/track/track-css-user-override.html
r239181 r259850 11 11 var seekCount = 0; 12 12 13 function seeked()13 async function seeked() 14 14 { 15 15 var currentCue = textTrackDisplayElement(video, 'cue'); … … 24 24 stylesheet = styleElement.sheet; 25 25 run("stylesheet.insertRule('video::cue { color: purple; background-color: lime; }', 0)"); 26 document.body.offsetTop;27 26 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).color", "rgb(128, 0, 128)"); 28 27 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor", "rgb(0, 255, 0)"); 29 28 30 29 consoleWrite("<br>** Add an override, without '!important' **"); 31 document.body.offsetTop;32 30 run("internals.setCaptionsStyleSheetOverride('video::cue { color: blue; background-color: yellow; }')"); 33 31 consoleWrite("internals.captionsStyleSheetOverride = " + internals.captionsStyleSheetOverride()); 34 document.body.offsetTop;35 32 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).color", "rgb(128, 0, 128)"); 36 33 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor", "rgb(0, 255, 0)"); … … 38 35 consoleWrite("<br>** Mark background-color '!important' **"); 39 36 run("internals.setCaptionsStyleSheetOverride('video::cue { color: blue ; background-color: yellow !important; }')"); 40 // The style is not immediately updated, schedule the rest of the test with a zero timeout timer. 41 setTimeout(function() { 42 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).color", "rgb(128, 0, 128)"); 43 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor", "rgb(255, 255, 0)"); 37 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).color", "rgb(128, 0, 128)"); 38 // The style is not immediately updated. 39 await testExpectedEventually("getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor", "rgb(255, 255, 0)"); 44 40 45 46 47 document.body.offsetTop;48 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).color", "rgb(0, 0, 255)");49 41 consoleWrite("<br>** Mark color '!important' **"); 42 run("stylesheet.insertRule('video::cue { color: blue !important; background-color: yellow !important; }', 0)"); 43 // The style is not immediately updated. 44 await testExpectedEventually("getComputedStyle(textTrackDisplayElement(video, 'cue')).color", "rgb(0, 0, 255)"); 45 testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor", "rgb(255, 255, 0)"); 50 46 51 consoleWrite(""); 52 endTest(); 53 }, 100); 47 consoleWrite(""); 48 endTest(); 54 49 } 55 50 … … 65 60 } 66 61 67 setCaptionDisplayMode('Automatic');62 setCaptionDisplayMode('Automatic'); 68 63 </script> 69 64 </head> -
trunk/Source/WebCore/ChangeLog
r259846 r259850 1 2020-04-09 Peng Liu <peng.liu6@apple.com> 2 3 REGRESSION: (r258434) [ Mac WK1 ] media/track/track-css-user-override.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=210134 5 6 Reviewed by Eric Carlson. 7 8 Call captionPreferencesChanged() directly in CaptionUserPreferences::setCaptionsStyleSheetOverride(). 9 10 * page/CaptionUserPreferences.cpp: 11 (WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride): 12 1 13 2020-04-09 Cathie Chen <cathiechen@igalia.com> 2 14 -
trunk/Source/WebCore/page/CaptionUserPreferences.cpp
r258693 r259850 399 399 m_captionsStyleSheetOverride = override; 400 400 updateCaptionStyleSheetOverride(); 401 if (!m_timer.isActive()) 402 m_timer.startOneShot(0_s); 401 captionPreferencesChanged(); 403 402 } 404 403
Note: See TracChangeset
for help on using the changeset viewer.