Title: [202079] trunk/Source/WebCore
Revision
202079
Author
[email protected]
Date
2016-06-14 19:07:38 -0700 (Tue, 14 Jun 2016)

Log Message

[iOS] Play glyph is pixelated when the page zoom is large
https://bugs.webkit.org/show_bug.cgi?id=158770
<rdar://problem/26092124>

Patch by Antoine Quint <[email protected]> on 2016-06-14
Reviewed by Dean Jackson.

Use the same technique that we use to scale the video controls by using a combination
of CSS "zoom" and "transform" properties to have the video play glyph scaled at its
native size regardless of page zoom.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.set pageScaleFactor):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (202078 => 202079)


--- trunk/Source/WebCore/ChangeLog	2016-06-15 01:45:25 UTC (rev 202078)
+++ trunk/Source/WebCore/ChangeLog	2016-06-15 02:07:38 UTC (rev 202079)
@@ -1,3 +1,18 @@
+2016-06-14  Antoine Quint  <[email protected]>
+
+        [iOS] Play glyph is pixelated when the page zoom is large
+        https://bugs.webkit.org/show_bug.cgi?id=158770
+        <rdar://problem/26092124>
+
+        Reviewed by Dean Jackson.
+
+        Use the same technique that we use to scale the video controls by using a combination
+        of CSS "zoom" and "transform" properties to have the video play glyph scaled at its
+        native size regardless of page zoom.
+
+        * Modules/mediacontrols/mediaControlsiOS.js:
+        (ControllerIOS.prototype.set pageScaleFactor):
+
 2016-06-14  Chris Dumez  <[email protected]>
 
         Regression(r201534): Compile time greatly regressed

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js (202078 => 202079)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js	2016-06-15 01:45:25 UTC (rev 202078)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js	2016-06-15 02:07:38 UTC (rev 202079)
@@ -584,22 +584,30 @@
 
         var scaleValue = 1 / newScaleFactor;
         var scaleTransform = "scale(" + scaleValue + ")";
+
+        function applyScaleFactorToElement(element) {
+            if (scaleValue > 1) {
+                element.style.zoom = scaleValue;
+                element.style.webkitTransform = "scale(1)";
+            } else {
+                element.style.zoom = 1;
+                element.style.webkitTransform = scaleTransform;
+            }
+        }
+
         if (this.controls.startPlaybackButton)
-            this.controls.startPlaybackButton.style.webkitTransform = scaleTransform;
+            applyScaleFactorToElement(this.controls.startPlaybackButton);
         if (this.controls.panel) {
+            applyScaleFactorToElement(this.controls.panel);
             if (scaleValue > 1) {
                 this.controls.panel.style.width = "100%";
-                this.controls.panel.style.zoom = scaleValue;
-                this.controls.panel.style.webkitTransform = "scale(1)";
                 this.controls.timelineBox.style.webkitTextSizeAdjust = (100 * scaleValue) + "%";
             } else {
                 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.timelineBox.style.webkitTextSizeAdjust = "auto";
-                this.controls.panel.style.zoom = 1;
             }
             this.controls.panelBackground.style.height = (50 * scaleValue) + "px";
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to