Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: chrome/browser/resources/ntp4/tile_page.js

Issue 8190008: ntp4: hack around skia gradient brokenness. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('ntp4', function() { 5 cr.define('ntp4', function() {
6 'use strict'; 6 'use strict';
7 7
8 // We can't pass the currently dragging tile via dataTransfer because of 8 // We can't pass the currently dragging tile via dataTransfer because of
9 // http://crbug.com/31037 9 // http://crbug.com/31037
10 var currentlyDraggingTile = null; 10 var currentlyDraggingTile = null;
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 * as they enter or exit the grid. 716 * as they enter or exit the grid.
717 * @private 717 * @private
718 */ 718 */
719 updateMask_: function() { 719 updateMask_: function() {
720 if (!this.isCurrentDragTarget) { 720 if (!this.isCurrentDragTarget) {
721 this.tileGrid_.style.WebkitMaskBoxImage = ''; 721 this.tileGrid_.style.WebkitMaskBoxImage = '';
722 return; 722 return;
723 } 723 }
724 724
725 var leftMargin = this.layoutValues_.leftMargin; 725 var leftMargin = this.layoutValues_.leftMargin;
726 var fadeDistance = Math.min(leftMargin, 20); 726 // The fade distance is the space between tiles.
727 var fadeDistance = (this.gridValues_.tileSpacingFraction *
728 this.layoutValues_.tileWidth);
729 fadeDistance = Math.min(leftMargin, fadeDistance);
730 // On Skia we don't use any fade because it works very poorly. See
731 // http://crbug.com/99373
732 if (!cr.isMac)
Dan Beam 2011/10/07 20:05:42 I still think you should mention in the above comm
733 fadeDistance = 1;
727 var gradient = 734 var gradient =
728 '-webkit-linear-gradient(left,' + 735 '-webkit-linear-gradient(left,' +
729 'transparent, ' + 736 'transparent, ' +
730 'transparent ' + (leftMargin - fadeDistance) + 'px, ' + 737 'transparent ' + (leftMargin - fadeDistance) + 'px, ' +
731 'black ' + leftMargin + 'px, ' + 738 'black ' + leftMargin + 'px, ' +
732 'black ' + (this.tileGrid_.clientWidth - leftMargin) + 'px, ' + 739 'black ' + (this.tileGrid_.clientWidth - leftMargin) + 'px, ' +
733 'transparent ' + (this.tileGrid_.clientWidth - leftMargin + 740 'transparent ' + (this.tileGrid_.clientWidth - leftMargin +
734 fadeDistance) + 'px, ' + 741 fadeDistance) + 'px, ' +
735 'transparent)'; 742 'transparent)';
736 this.tileGrid_.style.WebkitMaskBoxImage = gradient; 743 this.tileGrid_.style.WebkitMaskBoxImage = gradient;
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 assert(false); 1096 assert(false);
1090 }, 1097 },
1091 }; 1098 };
1092 1099
1093 return { 1100 return {
1094 getCurrentlyDraggingTile: getCurrentlyDraggingTile, 1101 getCurrentlyDraggingTile: getCurrentlyDraggingTile,
1095 setCurrentDropEffect: setCurrentDropEffect, 1102 setCurrentDropEffect: setCurrentDropEffect,
1096 TilePage: TilePage, 1103 TilePage: TilePage,
1097 }; 1104 };
1098 }); 1105 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698