Title: [186652] trunk/Source/WebCore
Revision
186652
Author
d...@apple.com
Date
2015-07-09 17:02:50 -0700 (Thu, 09 Jul 2015)

Log Message

REGRESSION: Inline media scrubbing always pauses the video
https://bugs.webkit.org/show_bug.cgi?id=146819
<rdar://problem/21572027>

Reviewed by Eric Carlson. Joseph Pecoraro also was really
helpful in diagnosing the problem.

When we moved some code from a getter/setter in the child
class to the base class, it was no longer being called due
to the bad way we were implementing inheritance. The solution
was to have the child class explicitly call into the base
class.

The much better solution would have been to rewrite everything
to use ES6 classes or, as a smaller change, assign the __proto__
directly on the child prototype. But I felt that was a bit
too risky at this point.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.extend): Describe in a comment why the extend function
is not suitable.
* Modules/mediacontrols/mediaControlsiOS.js: Add a getter/setter for
scrubbing that calls into the base Controller.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (186651 => 186652)


--- trunk/Source/WebCore/ChangeLog	2015-07-10 00:02:41 UTC (rev 186651)
+++ trunk/Source/WebCore/ChangeLog	2015-07-10 00:02:50 UTC (rev 186652)
@@ -1,3 +1,29 @@
+2015-07-09  Dean Jackson  <d...@apple.com>
+
+        REGRESSION: Inline media scrubbing always pauses the video
+        https://bugs.webkit.org/show_bug.cgi?id=146819
+        <rdar://problem/21572027>
+
+        Reviewed by Eric Carlson. Joseph Pecoraro also was really
+        helpful in diagnosing the problem.
+
+        When we moved some code from a getter/setter in the child
+        class to the base class, it was no longer being called due
+        to the bad way we were implementing inheritance. The solution
+        was to have the child class explicitly call into the base
+        class.
+
+        The much better solution would have been to rewrite everything
+        to use ES6 classes or, as a smaller change, assign the __proto__
+        directly on the child prototype. But I felt that was a bit
+        too risky at this point.
+
+        * Modules/mediacontrols/mediaControlsApple.js:
+        (Controller.prototype.extend): Describe in a comment why the extend function
+        is not suitable.
+        * Modules/mediacontrols/mediaControlsiOS.js: Add a getter/setter for
+        scrubbing that calls into the base Controller.
+
 2015-07-09  Chris Fleizach  <cfleiz...@apple.com>
 
         AX: <details> element should allow expand/close through AX API

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (186651 => 186652)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2015-07-10 00:02:41 UTC (rev 186651)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2015-07-10 00:02:50 UTC (rev 186652)
@@ -132,6 +132,12 @@
 
     extend: function(child)
     {
+        // This function doesn't actually do what we want it to. In particular it
+        // is not copying the getters and setters to the child class, since they are
+        // not enumerable. What we should do is use ES6 classes, or assign the __proto__
+        // directly.
+        // FIXME: Use ES6 classes.
+
         for (var property in this) {
             if (!child.hasOwnProperty(property))
                 child[property] = this[property];

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js (186651 => 186652)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js	2015-07-10 00:02:41 UTC (rev 186651)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js	2015-07-10 00:02:50 UTC (rev 186652)
@@ -630,6 +630,21 @@
         return Controller.prototype.controlsAlwaysVisible.call(this);
     },
 
+    // Due to the bad way we are faking inheritance here, in particular the extends method
+    // on Controller.prototype, we don't copy getters and setters from the prototype. This
+    // means we have to implement them again, here in the subclass.
+    // FIXME: Use ES6 classes!
+
+    get scrubbing()
+    {
+        return Object.getOwnPropertyDescriptor(Controller.prototype, "scrubbing").get.call(this);
+    },
+
+    set scrubbing(flag)
+    {
+        Object.getOwnPropertyDescriptor(Controller.prototype, "scrubbing").set.call(this, flag);
+    },
+
     get pageScaleFactor()
     {
         return this._pageScaleFactor;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to