⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185397 in webkit


Ignore:
Timestamp:
Jun 9, 2015, 5:53:13 PM (11 years ago)
Author:
dino@apple.com
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.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r185396 r185397  
     12015-06-09  Dean Jackson  <dino@apple.com>
     2
     3        MediaControls: Reenable resize of controls on pinch zoom
     4        https://bugs.webkit.org/show_bug.cgi?id=145824
     5        <rdar://problem/21212778>
     6
     7        Reviewed by Darin Adler.
     8
     9        Reinstate the code that updated the scaling of the
     10        controls in response to changes in page scale.
     11        This time around we have to change both the controls
     12        panel, and its blurry background.
     13
     14        * Modules/mediacontrols/mediaControlsApple.js:
     15        (Controller.prototype.set pageScaleFactor): Deleted a comment.
     16        * Modules/mediacontrols/mediaControlsiOS.css:
     17        (video::-webkit-media-controls-panel-background): Set the background to pin
     18        to the bottom of its view.
     19        * Modules/mediacontrols/mediaControlsiOS.js:
     20        (ControllerIOS.prototype.get pageScaleFactor): Basic getter, copied from mediaControlsApple.
     21        (ControllerIOS.prototype.set pageScaleFactor): The setter that reacts to the page scale
     22        and applies an inverse scaling on the control panel using a transform, and adjusts the
     23        height on the background similarly.
     24
    1252015-06-09  Andreas Kling  <akling@apple.com>
    226
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js

    r185258 r185397  
    20352035
    20362036        this._pageScaleFactor = newScaleFactor;
    2037 
    2038         // FIXME: this should react to the scale change by
    2039         // unscaling the controls panel. However, this
    2040         // hits a bug with the backdrop blur layer getting
    2041         // too big and moving to a tiled layer.
    2042         // https://bugs.webkit.org/show_bug.cgi?id=142317
    20432037    },
    20442038
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css

    r184611 r185397  
    121121    opacity: 0;
    122122    pointer-events: none;
     123    bottom: 0;
     124    position: absolute;
    123125}
    124126
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js

    r184963 r185397  
    2525/* Enums */
    2626ControllerIOS.StartPlaybackControls = 2;
    27 
    2827
    2928ControllerIOS.prototype = {
    … …  
    618617    },
    619618
     619    get pageScaleFactor()
     620    {
     621        return this._pageScaleFactor;
     622    },
     623
     624    set pageScaleFactor(newScaleFactor)
     625    {
     626        if (!newScaleFactor || this._pageScaleFactor === newScaleFactor)
     627            return;
     628
     629        this._pageScaleFactor = newScaleFactor;
     630
     631        var scaleValue = 1 / newScaleFactor;
     632        var scaleTransform = "scale(" + scaleValue + ")";
     633        if (this.controls.startPlaybackButton)
     634            this.controls.startPlaybackButton.style.webkitTransform = scaleTransform;
     635        if (this.controls.panel) {
     636            var bottomAligment = -2 * scaleValue;
     637            this.controls.panel.style.bottom = bottomAligment + "px";
     638            this.controls.panel.style.paddingBottom = -(newScaleFactor * bottomAligment) + "px";
     639            this.controls.panel.style.width = Math.round(newScaleFactor * 100) + "%";
     640            this.controls.panel.style.webkitTransform = scaleTransform;
     641
     642            this.controls.panelBackground.style.height = (50 * scaleValue) + "px";
     643
     644            this.setNeedsTimelineMetricsUpdate();
     645            this.updateProgress();
     646            this.scheduleUpdateLayoutForDisplayedWidth();
     647        }
     648    },
    620649
    621650};
Note: See TracChangeset for help on using the changeset viewer.