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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js

Issue 2340403002: DevTools: Don't update ViewportControl selection if there is no selection (Closed)
Patch Set: Created 4 years, 3 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
« 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 offset: offset 280 offset: offset
281 }; 281 };
282 }, 282 },
283 283
284 /** 284 /**
285 * @param {?Selection} selection 285 * @param {?Selection} selection
286 */ 286 */
287 _updateSelectionModel: function(selection) 287 _updateSelectionModel: function(selection)
288 { 288 {
289 var range = selection && selection.rangeCount ? selection.getRangeAt(0) : null; 289 var range = selection && selection.rangeCount ? selection.getRangeAt(0) : null;
290 if (!range || selection.isCollapsed) { 290 if (!range || selection.isCollapsed || !this.element.hasSelection()) {
291 this._headSelection = null; 291 this._headSelection = null;
292 this._anchorSelection = null; 292 this._anchorSelection = null;
293 return false; 293 return false;
294 } 294 }
295 295
296 var firstSelected = Number.MAX_VALUE; 296 var firstSelected = Number.MAX_VALUE;
297 var lastSelected = -1; 297 var lastSelected = -1;
298 298
299 var hasVisibleSelection = false; 299 var hasVisibleSelection = false;
300 for (var i = 0; i < this._renderedItems.length; ++i) { 300 for (var i = 0; i < this._renderedItems.length; ++i) {
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 652
653 /** 653 /**
654 * @return {number} 654 * @return {number}
655 */ 655 */
656 _visibleHeight: function() 656 _visibleHeight: function()
657 { 657 {
658 // Use offsetHeight instead of clientHeight to avoid being affected by h orizontal scroll. 658 // Use offsetHeight instead of clientHeight to avoid being affected by h orizontal scroll.
659 return this.element.offsetHeight; 659 return this.element.offsetHeight;
660 } 660 }
661 } 661 }
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