media/track/track-in-band-style.html is flaky
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Mar 2019 20:05:33 +0000 (20:05 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Mar 2019 20:05:33 +0000 (20:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195922

Reviewed by Eric Carlson.

Source/WebCore:

* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
Small optimization: some of the if checks were missing their "continue;"
statement. This would cause us to keep checking following keys even though
we already got a match.

LayoutTests:

* media/track/track-in-band-style-expected.txt:
* media/track/track-in-band-style.html:
- Check element.style instead of getComputedStyle(element) to get the
  CSS colors as this seems more reliable.
- For the foreground text color, check cueNode.style.color instead of
  cueDisplayElement given that the implementation sets the CSS attribute
  on the cueNode, not the cueDisplayElement.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243164 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/media/track/track-in-band-style-expected.txt
LayoutTests/media/track/track-in-band-style.html
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp

index 98ee807..d0d8d18 100644 (file)
@@ -1,3 +1,18 @@
+2019-03-19  Chris Dumez  <cdumez@apple.com>
+
+        media/track/track-in-band-style.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=195922
+
+        Reviewed by Eric Carlson.
+
+        * media/track/track-in-band-style-expected.txt:
+        * media/track/track-in-band-style.html:
+        - Check element.style instead of getComputedStyle(element) to get the
+          CSS colors as this seems more reliable.
+        - For the foreground text color, check cueNode.style.color instead of
+          cueDisplayElement given that the implementation sets the CSS attribute
+          on the cueNode, not the cueDisplayElement.
+
 2019-03-19  Devin Rousso  <drousso@apple.com>
 
         Unreviewed, fix test failures after r243119.
index f157125..327a484 100644 (file)
@@ -13,7 +13,7 @@ RUN(video.play())
 EVENT(cuechange)
 
 ** Test current cue colors
-EXPECTED (getComputedStyle(cueDisplayElement).color == 'rgb(255, 255, 255)') OK
-EXPECTED (getComputedStyle(cueNode).backgroundColor == 'rgb(0, 0, 0)') OK
+EXPECTED (cueNode.style.color == 'rgb(255, 255, 255)') OK
+EXPECTED (cueNode.style.backgroundColor == 'rgb(0, 0, 0)') OK
 END OF TEST
 
index 64c27e5..15fc770 100644 (file)
@@ -25,8 +25,8 @@
                     }
     
                     consoleWrite("<br><i>** Test current cue colors<" + "/i>");
-                    testExpected("getComputedStyle(cueDisplayElement).color", "rgb(255, 255, 255)");
-                    testExpected("getComputedStyle(cueNode).backgroundColor", "rgb(0, 0, 0)");
+                    testExpected("cueNode.style.color", "rgb(255, 255, 255)");
+                    testExpected("cueNode.style.backgroundColor", "rgb(0, 0, 0)");
     
                     endTest();
                 }
index 3064fc1..557fd6b 100644 (file)
@@ -1,3 +1,16 @@
+2019-03-19  Chris Dumez  <cdumez@apple.com>
+
+        media/track/track-in-band-style.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=195922
+
+        Reviewed by Eric Carlson.
+
+        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
+        (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
+        Small optimization: some of the if checks were missing their "continue;"
+        statement. This would cause us to keep checking following keys even though
+        we already got a match.
+
 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         Build cleanly with GCC 9
index 50225c3..e6dfece 100644 (file)
@@ -270,6 +270,7 @@ void InbandTextTrackPrivateAVF::processCueAttributes(CFAttributedStringRef attri
                 if (!makeRGBA32FromARGBCFArray(arrayValue, color))
                     continue;
                 cueData.setForegroundColor(color);
+                continue;
             }
             
             if (CFStringCompare(key, kCMTextMarkupAttribute_BackgroundColorARGB, 0) == kCFCompareEqualTo) {
@@ -281,6 +282,7 @@ void InbandTextTrackPrivateAVF::processCueAttributes(CFAttributedStringRef attri
                 if (!makeRGBA32FromARGBCFArray(arrayValue, color))
                     continue;
                 cueData.setBackgroundColor(color);
+                continue;
             }
 
             if (CFStringCompare(key, kCMTextMarkupAttribute_CharacterBackgroundColorARGB, 0) == kCFCompareEqualTo) {
@@ -292,6 +294,7 @@ void InbandTextTrackPrivateAVF::processCueAttributes(CFAttributedStringRef attri
                 if (!makeRGBA32FromARGBCFArray(arrayValue, color))
                     continue;
                 cueData.setHighlightColor(color);
+                continue;
             }
         }