Address ESLint warnings in modern-media-controls
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Feb 2017 05:57:45 +0000 (05:57 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Feb 2017 05:57:45 +0000 (05:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168224

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-02-13
Reviewed by Alexey Proskuryakov.

* Modules/modern-media-controls/controls/controls-bar.js:
* Modules/modern-media-controls/controls/fullscreen-button.js:
* Modules/modern-media-controls/controls/layout-node.js:
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
* Modules/modern-media-controls/controls/media-controls.js:
* Modules/modern-media-controls/controls/scheduler.js:
* Modules/modern-media-controls/controls/seek-button.js:
* Modules/modern-media-controls/controls/tracks-panel.js:
* Modules/modern-media-controls/controls/volume-slider.js:
* Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
* Modules/modern-media-controls/gesture-recognizers/pinch.js:
* Modules/modern-media-controls/media/fullscreen-support.js:
* Modules/modern-media-controls/media/media-controller.js:
* Modules/modern-media-controls/media/placard-support.js:
* Modules/modern-media-controls/media/status-support.js:
Address pedantic warnings.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212276 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js
Source/WebCore/Modules/modern-media-controls/controls/fullscreen-button.js
Source/WebCore/Modules/modern-media-controls/controls/layout-node.js
Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js
Source/WebCore/Modules/modern-media-controls/controls/media-controls.js
Source/WebCore/Modules/modern-media-controls/controls/scheduler.js
Source/WebCore/Modules/modern-media-controls/controls/seek-button.js
Source/WebCore/Modules/modern-media-controls/controls/tracks-panel.js
Source/WebCore/Modules/modern-media-controls/controls/volume-slider.js
Source/WebCore/Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js
Source/WebCore/Modules/modern-media-controls/gesture-recognizers/pinch.js
Source/WebCore/Modules/modern-media-controls/media/fullscreen-support.js
Source/WebCore/Modules/modern-media-controls/media/media-controller.js
Source/WebCore/Modules/modern-media-controls/media/placard-support.js
Source/WebCore/Modules/modern-media-controls/media/status-support.js

index 19e3404..67f60e9 100644 (file)
@@ -1,3 +1,27 @@
+2017-02-13  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Address ESLint warnings in modern-media-controls
+        https://bugs.webkit.org/show_bug.cgi?id=168224
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Modules/modern-media-controls/controls/controls-bar.js:
+        * Modules/modern-media-controls/controls/fullscreen-button.js:
+        * Modules/modern-media-controls/controls/layout-node.js:
+        * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
+        * Modules/modern-media-controls/controls/media-controls.js:
+        * Modules/modern-media-controls/controls/scheduler.js:
+        * Modules/modern-media-controls/controls/seek-button.js:
+        * Modules/modern-media-controls/controls/tracks-panel.js:
+        * Modules/modern-media-controls/controls/volume-slider.js:
+        * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
+        * Modules/modern-media-controls/gesture-recognizers/pinch.js:
+        * Modules/modern-media-controls/media/fullscreen-support.js:
+        * Modules/modern-media-controls/media/media-controller.js:
+        * Modules/modern-media-controls/media/placard-support.js:
+        * Modules/modern-media-controls/media/status-support.js:
+        Address pedantic warnings.
+
 2017-02-13  Dan Bernstein  <mitz@apple.com>
 
         Restored changes from r212210 in a way that does not break the build.
index 2a89959..25146b8 100644 (file)
@@ -52,7 +52,7 @@ class ControlsBar extends LayoutNode
     set translation(point)
     {
         if (this._translation.x === point.x && this._translation.y === point.y)
-            return
+            return;
 
         this._translation = new DOMPoint(point.x, point.y);
         this.markDirtyProperty("translation");
index b5116c6..9c7bfd7 100644 (file)
@@ -32,7 +32,7 @@ class FullscreenButton extends IconButton
             cssClassName: "fullscreen",
             layoutDelegate
         });
-        
+
         this.iconName = this.layoutTraits & LayoutTraits.Fullscreen ? Icons.ExitFullscreen : Icons.EnterFullscreen;
     }
 
index 22c94a7..2a87f27 100644 (file)
@@ -23,7 +23,7 @@ class LayoutNode
         this._width = 0;
         this._height = 0;
         this._visible = true;
-    
+
         this._needsLayout = false;
         this._dirtyProperties = new Set;
 
@@ -128,7 +128,7 @@ class LayoutNode
     {
         while (this._children.length)
             this.removeChild(this._children[0]);
-        
+
         for (let child of children)
             this.addChild(child);
     }
@@ -268,7 +268,7 @@ class LayoutNode
         for (let i = this.children.length - 1; i >= 0; --i) {
             let child = this.children[i];
             let childElement = child.element;
-        
+
             if (child._pendingDOMManipulation === LayoutNode.DOMManipulation.Addition) {
                 element.insertBefore(childElement, nextChildElement);
                 child._pendingDOMManipulation = LayoutNode.DOMManipulation.None;
index c66f16b..c82e342 100644 (file)
@@ -149,7 +149,7 @@ class MacOSFullscreenMediaControls extends MacOSMediaControls
             this.controlsBar.translation.x + currentDragPoint.x - this._lastDragPoint.x,
             this.controlsBar.translation.y + currentDragPoint.y - this._lastDragPoint.y
         );
-        
+
         this._lastDragPoint = currentDragPoint;
     }
 
index 7f13a9d..30687c5 100644 (file)
@@ -44,7 +44,7 @@ class MediaControls extends LayoutNode
         this.pipButton = new PiPButton(this);
         this.fullscreenButton = new FullscreenButton(this);
 
-        this.statusLabel = new StatusLabel(this)
+        this.statusLabel = new StatusLabel(this);
         this.timeControl = new TimeControl(this);
 
         this.controlsBar = new ControlsBar(this);
@@ -67,7 +67,7 @@ class MediaControls extends LayoutNode
     {
         if (this._showsStartButton === flag)
             return;
-       
+
         this._showsStartButton = flag;
         this._invalidateChildren();
     }
@@ -86,12 +86,12 @@ class MediaControls extends LayoutNode
     {
         return this._scaleFactor;
     }
-    
+
     set scaleFactor(scaleFactor)
     {
         if (this._scaleFactor === scaleFactor)
             return;
-    
+
         this._scaleFactor = scaleFactor;
         this.markDirtyProperty("scaleFactor");
     }
index 251d804..f85beb0 100644 (file)
@@ -47,7 +47,7 @@ const scheduler = new class
 
         this._layout();
         this._frameID = -1;
-        this._requestFrameIfNeeded();   
+        this._requestFrameIfNeeded();
 
         if (typeof scheduler.frameDidFire === "function")
             scheduler.frameDidFire();
@@ -63,4 +63,4 @@ const scheduler = new class
             callback();
     }
 
-}
+};
index 3674529..c72c1f1 100644 (file)
@@ -52,7 +52,7 @@ class SeekButton extends IconButton
         const mediaControls = this.parentOfType(MediaControls);
         if (!mediaControls)
             return;
-            
+
         this._mouseupTarget = mediaControls.element;
         this._mouseupTarget.addEventListener("mouseup", this, true);
         this._notifyDelegateOfPressingState(true);
index af99df3..146c6c1 100644 (file)
@@ -45,7 +45,7 @@ class TracksPanel extends LayoutNode
         this.element.addEventListener("transitionend", this);
 
         // Ensure a transition will indeed happen by starting it only on the next frame.
-        window.requestAnimationFrame(() => { this.element.classList.add("fade-out") });
+        window.requestAnimationFrame(() => { this.element.classList.add("fade-out"); });
     }
 
     get bottomY()
@@ -135,13 +135,13 @@ class TracksPanel extends LayoutNode
         const children = [];
 
         this._trackNodes = [];
-        
+
         const dataSource = this.dataSource;
         if (!dataSource)
             return children;
-        
+
         const numberOfSections = dataSource.tracksPanelNumberOfSections();
-        if (numberOfSections == 0)
+        if (numberOfSections === 0)
             return children;
 
         for (let sectionIndex = 0; sectionIndex < numberOfSections; ++sectionIndex) {
@@ -152,13 +152,13 @@ class TracksPanel extends LayoutNode
             let numberOfTracks = dataSource.tracksPanelNumberOfTracksInSection(sectionIndex);
             for (let trackIndex = 0; trackIndex < numberOfTracks; ++trackIndex) {
                 let trackTitle = dataSource.tracksPanelTitleForTrackInSection(trackIndex, sectionIndex);
-                let trackSelected = dataSource.tracksPanelIsTrackInSectionSelected(trackIndex, sectionIndex)
+                let trackSelected = dataSource.tracksPanelIsTrackInSectionSelected(trackIndex, sectionIndex);
                 let trackNode = tracksListNode.addChild(new TrackNode(trackIndex, sectionIndex, trackTitle, trackSelected, this));
                 this._trackNodes.push(trackNode);
             }
             children.push(sectionNode);
         }
-        
+
         return children;
     }
 
index 760f946..c1ec857 100644 (file)
@@ -60,7 +60,7 @@ class GestureRecognizer
     {
         return this._enabled;
     }
-    
+
     set enabled(enabled)
     {
         if (this._enabled === enabled)
@@ -299,14 +299,14 @@ class GestureRecognizer
             if (event.type === GestureRecognizer.Events.TouchEnd)
                 this._targetTouches = [];
             else
-                this._targetTouches = [event]
+                this._targetTouches = [event];
             return;
         }
 
         if (!(event instanceof TouchEvent))
             return;
 
-        // With a touchstart event, event.targetTouches is accurate so 
+        // With a touchstart event, event.targetTouches is accurate so
         // we simply add all of those.
         if (event.type === GestureRecognizer.Events.TouchStart) {
             this._targetTouches = [];
@@ -352,7 +352,7 @@ class GestureRecognizer
         this.modifierKeys.meta = event.metaKey;
         this.modifierKeys.shift = event.shiftKey;
     }
-    
+
 }
 
 GestureRecognizer.SupportsTouches = "createTouch" in document;
index 7359e93..12bf071 100644 (file)
@@ -46,7 +46,7 @@ class PinchGestureRecognizer extends GestureRecognizer
                 return;
             }
 
-            // We can only start tracking touches with 2 fingers. 
+            // We can only start tracking touches with 2 fingers.
             if (this.numberOfTouches !== 2)
                 return;
 
@@ -193,7 +193,7 @@ class PinchGestureRecognizer extends GestureRecognizer
     {
         console.assert(this.numberOfTouches === 2);
 
-        const firstTouch = this._targetTouches[0]
+        const firstTouch = this._targetTouches[0];
         const firstTouchPoint = new DOMPoint(firstTouch.pageX, firstTouch.pageY);
 
         const secondTouch = this._targetTouches[1];
index a18ae7a..56f998c 100644 (file)
@@ -64,7 +64,7 @@ class FullscreenSupport extends MediaControllerSupport
     {
         this.mediaController.media.webkitEnterFullscreen();
     }
-    
+
     syncControl()
     {
         const control = this.control;
index c70c6f3..45b9e73 100644 (file)
@@ -146,7 +146,7 @@ class MediaController
             this.container.replaceChild(this.controls.element, previousControls.element);
             this.controls.usesLTRUserInterfaceLayoutDirection = previousControls.usesLTRUserInterfaceLayoutDirection;
         } else
-            this.container.appendChild(this.controls.element);        
+            this.container.appendChild(this.controls.element);
 
         this.controls.layoutTraits = layoutTraits;
         this._updateControlsSize();
index 25cca28..5ef401c 100644 (file)
@@ -58,7 +58,7 @@ class PlacardSupport extends MediaControllerSupport
         else if (media instanceof HTMLVideoElement && media.error !== null && media.played.length === 0)
             controls.showPlacard(controls.invalidPlacard);
         else
-            controls.hidePlacard();    
+            controls.hidePlacard();
     }
 
 }