Title: [185397] trunk/Source/WebCore
- Revision
- 185397
- Author
- [email protected]
- Date
- 2015-06-09 17:53:13 -0700 (Tue, 09 Jun 2015)
Log Message
MediaControls: Reenable resize of controls on pinch zoom
https://bugs.webkit.org/show_bug.cgi?id=145824
<rdar://problem/21212778>
Reviewed by Darin Adler.
Reinstate the code that updated the scaling of the
controls in response to changes in page scale.
This time around we have to change both the controls
panel, and its blurry background.
* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.set pageScaleFactor): Deleted a comment.
* Modules/mediacontrols/mediaControlsiOS.css:
(video::-webkit-media-controls-panel-background): Set the background to pin
to the bottom of its view.
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.get pageScaleFactor): Basic getter, copied from mediaControlsApple.
(ControllerIOS.prototype.set pageScaleFactor): The setter that reacts to the page scale
and applies an inverse scaling on the control panel using a transform, and adjusts the
height on the background similarly.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (185396 => 185397)
--- trunk/Source/WebCore/ChangeLog 2015-06-10 00:46:51 UTC (rev 185396)
+++ trunk/Source/WebCore/ChangeLog 2015-06-10 00:53:13 UTC (rev 185397)
@@ -1,3 +1,27 @@
+2015-06-09 Dean Jackson <[email protected]>
+
+ MediaControls: Reenable resize of controls on pinch zoom
+ https://bugs.webkit.org/show_bug.cgi?id=145824
+ <rdar://problem/21212778>
+
+ Reviewed by Darin Adler.
+
+ Reinstate the code that updated the scaling of the
+ controls in response to changes in page scale.
+ This time around we have to change both the controls
+ panel, and its blurry background.
+
+ * Modules/mediacontrols/mediaControlsApple.js:
+ (Controller.prototype.set pageScaleFactor): Deleted a comment.
+ * Modules/mediacontrols/mediaControlsiOS.css:
+ (video::-webkit-media-controls-panel-background): Set the background to pin
+ to the bottom of its view.
+ * Modules/mediacontrols/mediaControlsiOS.js:
+ (ControllerIOS.prototype.get pageScaleFactor): Basic getter, copied from mediaControlsApple.
+ (ControllerIOS.prototype.set pageScaleFactor): The setter that reacts to the page scale
+ and applies an inverse scaling on the control panel using a transform, and adjusts the
+ height on the background similarly.
+
2015-06-09 Andreas Kling <[email protected]>
GraphicsContext state stack wasting lots of memory when empty.
Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (185396 => 185397)
--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js 2015-06-10 00:46:51 UTC (rev 185396)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js 2015-06-10 00:53:13 UTC (rev 185397)
@@ -2034,12 +2034,6 @@
return;
this._pageScaleFactor = newScaleFactor;
-
- // FIXME: this should react to the scale change by
- // unscaling the controls panel. However, this
- // hits a bug with the backdrop blur layer getting
- // too big and moving to a tiled layer.
- // https://bugs.webkit.org/show_bug.cgi?id=142317
},
handleRootResize: function(event)
Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css (185396 => 185397)
--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css 2015-06-10 00:46:51 UTC (rev 185396)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css 2015-06-10 00:53:13 UTC (rev 185397)
@@ -120,6 +120,8 @@
transition: opacity 0.25s linear;
opacity: 0;
pointer-events: none;
+ bottom: 0;
+ position: absolute;
}
audio::-webkit-media-controls-panel-background {
Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js (185396 => 185397)
--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js 2015-06-10 00:46:51 UTC (rev 185396)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js 2015-06-10 00:53:13 UTC (rev 185397)
@@ -25,7 +25,6 @@
/* Enums */
ControllerIOS.StartPlaybackControls = 2;
-
ControllerIOS.prototype = {
/* Constants */
MinimumTimelineWidth: 200,
@@ -617,7 +616,37 @@
return Controller.prototype.controlsAlwaysVisible.call(this);
},
+ get pageScaleFactor()
+ {
+ return this._pageScaleFactor;
+ },
+ set pageScaleFactor(newScaleFactor)
+ {
+ if (!newScaleFactor || this._pageScaleFactor === newScaleFactor)
+ return;
+
+ this._pageScaleFactor = newScaleFactor;
+
+ var scaleValue = 1 / newScaleFactor;
+ var scaleTransform = "scale(" + scaleValue + ")";
+ if (this.controls.startPlaybackButton)
+ this.controls.startPlaybackButton.style.webkitTransform = scaleTransform;
+ if (this.controls.panel) {
+ var bottomAligment = -2 * scaleValue;
+ this.controls.panel.style.bottom = bottomAligment + "px";
+ this.controls.panel.style.paddingBottom = -(newScaleFactor * bottomAligment) + "px";
+ this.controls.panel.style.width = Math.round(newScaleFactor * 100) + "%";
+ this.controls.panel.style.webkitTransform = scaleTransform;
+
+ this.controls.panelBackground.style.height = (50 * scaleValue) + "px";
+
+ this.setNeedsTimelineMetricsUpdate();
+ this.updateProgress();
+ this.scheduleUpdateLayoutForDisplayedWidth();
+ }
+ },
+
};
Object.create(Controller.prototype).extend(ControllerIOS.prototype);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes