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

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

Issue 397073006: DevTools: [Console] fix corner case in viewport text selection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline Created 6 years, 5 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 | « LayoutTests/inspector/console/console-viewport-selection-expected.txt ('k') | 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 }, 502 },
503 503
504 /** 504 /**
505 * @param {!Element} itemElement 505 * @param {!Element} itemElement
506 * @param {!Node} container 506 * @param {!Node} container
507 * @param {number} offset 507 * @param {number} offset
508 * @return {number} 508 * @return {number}
509 */ 509 */
510 _textOffsetInNode: function(itemElement, container, offset) 510 _textOffsetInNode: function(itemElement, container, offset)
511 { 511 {
512 if (!offset)
513 return 0;
514 var chars = 0; 512 var chars = 0;
515 var node = itemElement; 513 var node = itemElement;
516 while ((node = node.traverseNextTextNode()) && node !== container) 514 while ((node = node.traverseNextTextNode()) && node !== container)
517 chars += node.textContent.length; 515 chars += node.textContent.length;
518 return chars + offset; 516 return chars + offset;
519 }, 517 },
520 518
521 /** 519 /**
522 * @param {!Event} event 520 * @param {!Event} event
523 */ 521 */
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 590
593 /** 591 /**
594 * @return {number} 592 * @return {number}
595 */ 593 */
596 _visibleHeight: function() 594 _visibleHeight: function()
597 { 595 {
598 // Use offsetHeight instead of clientHeight to avoid being affected by h orizontal scroll. 596 // Use offsetHeight instead of clientHeight to avoid being affected by h orizontal scroll.
599 return this.element.offsetHeight; 597 return this.element.offsetHeight;
600 } 598 }
601 } 599 }
OLDNEW
« no previous file with comments | « LayoutTests/inspector/console/console-viewport-selection-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698