Title: [213540] trunk/Source/WebCore
Revision
213540
Author
[email protected]
Date
2017-03-07 14:22:32 -0800 (Tue, 07 Mar 2017)

Log Message

[Modern Media Controls] Log an error to the console when an image fails to load
https://bugs.webkit.org/show_bug.cgi?id=169292

Patch by Antoine Quint <[email protected]> on 2017-03-07
Reviewed by Dean Jackson.

In order to help debug flaky tests we now log the image source when an image fails to load.

* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype.handleEvent):
(IconButton.prototype._loadImage):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (213539 => 213540)


--- trunk/Source/WebCore/ChangeLog	2017-03-07 21:51:42 UTC (rev 213539)
+++ trunk/Source/WebCore/ChangeLog	2017-03-07 22:22:32 UTC (rev 213540)
@@ -1,3 +1,16 @@
+2017-03-07  Antoine Quint  <[email protected]>
+
+        [Modern Media Controls] Log an error to the console when an image fails to load
+        https://bugs.webkit.org/show_bug.cgi?id=169292
+
+        Reviewed by Dean Jackson.
+
+        In order to help debug flaky tests we now log the image source when an image fails to load.
+
+        * Modules/modern-media-controls/controls/icon-button.js:
+        (IconButton.prototype.handleEvent):
+        (IconButton.prototype._loadImage):
+
 2017-03-07  Zalan Bujtas  <[email protected]>
 
         Simple line layout: Do not use invalid m_lastNonWhitespaceFragment while removing trailing whitespace.

Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/icon-button.js (213539 => 213540)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/icon-button.js	2017-03-07 21:51:42 UTC (rev 213539)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/icon-button.js	2017-03-07 22:22:32 UTC (rev 213540)
@@ -76,9 +76,12 @@
 
     handleEvent(event)
     {
-        if (event.type === "load" && event.target === this._image)
-            this._imageDidLoad();
-        else
+        if (event.target === this._image) {
+            if (event.type === "load")
+                this._imageDidLoad();
+            else if (event.type === "error")
+                console.error(`IconButton failed to load, iconName = ${this._iconName}, layoutTraits = ${this._iconLayoutTraits}, src = ""
+        } else
             super.handleEvent(event);
     }
 
@@ -104,8 +107,10 @@
 
         if (this._image.complete)
             this._updateImage();
-        else
+        else {
             this._image.addEventListener("load", this);
+            this._image.addEventListener("error", this);
+        }
     }
 
     _imageDidLoad()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to