+2015-03-24 Dean Jackson <dino@apple.com>
+
+ 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.
+
2015-03-24 David Hyatt <hyatt@apple.com>
Improve the offsetWidth/Height layout optimization
var midY = height / 2;
- // 1. Draw the outline with a clip path that subtracts the
- // middle of a lozenge. This produces a better result than
- // stroking when we come to filling the parts below.
+ // 1. Draw the buffered part and played parts, using
+ // solid rectangles that are clipped to the outside of
+ // the lozenge.
ctx.save();
ctx.beginPath();
this.addRoundedRect(ctx, 1, midY - 3, width - 2, 6, 3);
- this.addRoundedRect(ctx, 2, midY - 2, width - 4, 4, 2);
ctx.closePath();
- ctx.clip("evenodd");
- ctx.fillStyle = "black";
- ctx.fillRect(0, 0, width, height);
+ ctx.clip();
+ ctx.fillStyle = "white";
+ ctx.fillRect(0, 0, Math.round(width * played) + 2, height);
+ ctx.fillStyle = "rgba(0, 0, 0, 0.55)";
+ ctx.fillRect(Math.round(width * played) + 2, 0, Math.round(width * (buffered - played)) + 2, height);
ctx.restore();
- // 2. Draw the buffered part and played parts, using
- // solid rectangles that are clipped to the outside of
- // the lozenge.
+ // 2. Draw the outline with a clip path that subtracts the
+ // middle of a lozenge. This produces a better result than
+ // stroking.
ctx.save();
ctx.beginPath();
this.addRoundedRect(ctx, 1, midY - 3, width - 2, 6, 3);
+ this.addRoundedRect(ctx, 2, midY - 2, width - 4, 4, 2);
ctx.closePath();
- ctx.clip();
- ctx.fillStyle = "black";
- ctx.fillRect(0, 0, Math.round(width * buffered) + 2, height);
- ctx.fillStyle = "white";
- ctx.fillRect(0, 0, Math.round(width * played) + 2, height);
+ ctx.clip("evenodd");
+ ctx.fillStyle = "rgba(0, 0, 0, 0.55)";
+ ctx.fillRect(Math.round(width * buffered) + 2, 0, width, height);
ctx.restore();
},