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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185397
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-06-09 Dean Jackson <dino@apple.com>
+
+ 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 <akling@apple.com>
GraphicsContext state stack wasting lots of memory when empty.
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)
transition: opacity 0.25s linear;
opacity: 0;
pointer-events: none;
+ bottom: 0;
+ position: absolute;
}
audio::-webkit-media-controls-panel-background {
/* Enums */
ControllerIOS.StartPlaybackControls = 2;
-
ControllerIOS.prototype = {
/* Constants */
MinimumTimelineWidth: 200,
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();
+ }
+ },
};