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

Changeset 181899 in webkit


Ignore:
Timestamp:
Mar 24, 2015, 12:53:17 PM (11 years ago)
Author:
dino@apple.com
Message:

MediaControls: Scrubber and Time displays have the incorrect blending
https://bugs.webkit.org/show_bug.cgi?id=143011
<rdar://problem/20245251>

Reviewed by Eric Carlson.

The scrubber in media controls should use plus-darker blending. Then
the scrubber itself should use a slightly transparent black (55% opacity)
when drawing.

  • Modules/mediacontrols/mediaControlsiOS.css:

(audio::-webkit-media-controls-timeline): Add the blend mode.

  • Modules/mediacontrols/mediaControlsiOS.js:

(ControllerIOS.prototype.drawTimelineBackground): Start drawing with
transparency. I changed the order of rendering to make it
more clear we draw the three parts in left to right order.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r181898 r181899  
     12015-03-24  Dean Jackson  <dino@apple.com>
     2
     3        MediaControls: Scrubber and Time displays have the incorrect blending
     4        https://bugs.webkit.org/show_bug.cgi?id=143011
     5        <rdar://problem/20245251>
     6
     7        Reviewed by Eric Carlson.
     8
     9        The scrubber in media controls should use plus-darker blending. Then
     10        the scrubber itself should use a slightly transparent black (55% opacity)
     11        when drawing.
     12
     13        * Modules/mediacontrols/mediaControlsiOS.css:
     14        (audio::-webkit-media-controls-timeline): Add the blend mode.
     15        * Modules/mediacontrols/mediaControlsiOS.js:
     16        (ControllerIOS.prototype.drawTimelineBackground): Start drawing with
     17        transparency. I changed the order of rendering to make it
     18        more clear we draw the three parts in left to right order.
     19
    1202015-03-24  David Hyatt  <hyatt@apple.com>
    221
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css

    r181123 r181899  
    362362    box-sizing: content-box !important;
    363363    -webkit-transform: translate3d(0, 0, 0);
     364    mix-blend-mode: plus-darker;
    364365}
    365366
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js

    r181882 r181899  
    248248        var midY = height / 2;
    249249
    250         // 1. Draw the outline with a clip path that subtracts the
    251         // middle of a lozenge. This produces a better result than
    252         // stroking when we come to filling the parts below.
    253         ctx.save();
    254         ctx.beginPath();
    255         this.addRoundedRect(ctx, 1, midY - 3, width - 2, 6, 3);
    256         this.addRoundedRect(ctx, 2, midY - 2, width - 4, 4, 2);
    257         ctx.closePath();
    258         ctx.clip("evenodd");
    259         ctx.fillStyle = "black";
    260         ctx.fillRect(0, 0, width, height);
    261         ctx.restore();
    262 
    263         // 2. Draw the buffered part and played parts, using
     250        // 1. Draw the buffered part and played parts, using
    264251        // solid rectangles that are clipped to the outside of
    265252        // the lozenge.
     
    269256        ctx.closePath();
    270257        ctx.clip();
    271         ctx.fillStyle = "black";
    272         ctx.fillRect(0, 0, Math.round(width * buffered) + 2, height);
    273258        ctx.fillStyle = "white";
    274259        ctx.fillRect(0, 0, Math.round(width * played) + 2, height);
     260        ctx.fillStyle = "rgba(0, 0, 0, 0.55)";
     261        ctx.fillRect(Math.round(width * played) + 2, 0, Math.round(width * (buffered - played)) + 2, height);
     262        ctx.restore();
     263
     264        // 2. Draw the outline with a clip path that subtracts the
     265        // middle of a lozenge. This produces a better result than
     266        // stroking.
     267        ctx.save();
     268        ctx.beginPath();
     269        this.addRoundedRect(ctx, 1, midY - 3, width - 2, 6, 3);
     270        this.addRoundedRect(ctx, 2, midY - 2, width - 4, 4, 2);
     271        ctx.closePath();
     272        ctx.clip("evenodd");
     273        ctx.fillStyle = "rgba(0, 0, 0, 0.55)";
     274        ctx.fillRect(Math.round(width * buffered) + 2, 0, width, height);
    275275        ctx.restore();
    276276    },
Note: See TracChangeset for help on using the changeset viewer.