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

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

Issue 2393763002: [DevTools] Cleanup DOMExtension.js. (Closed)
Patch Set: review comments Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 isSuggestBoxVisible: function() 680 isSuggestBoxVisible: function()
681 { 681 {
682 return this._suggestBox && this._suggestBox.visible(); 682 return this._suggestBox && this._suggestBox.visible();
683 }, 683 },
684 684
685 /** 685 /**
686 * @return {boolean} 686 * @return {boolean}
687 */ 687 */
688 isCaretInsidePrompt: function() 688 isCaretInsidePrompt: function()
689 { 689 {
690 return this._element.isInsertionCaretInside(); 690 var selection = this._element.getComponentSelection();
691 // @see crbug.com/602541
692 var selectionRange = selection && selection.rangeCount ? selection.getRa ngeAt(0) : null;
693 if (!selectionRange || !selection.isCollapsed)
694 return false;
695 return selectionRange.startContainer.isSelfOrDescendant(this._element);
691 }, 696 },
692 697
693 /** 698 /**
694 * @return {boolean} 699 * @return {boolean}
695 */ 700 */
696 isCaretAtEndOfPrompt: function() 701 isCaretAtEndOfPrompt: function()
697 { 702 {
698 var selection = this._element.getComponentSelection(); 703 var selection = this._element.getComponentSelection();
699 var selectionRange = selection && selection.rangeCount ? selection.getRa ngeAt(0) : null; 704 var selectionRange = selection && selection.rangeCount ? selection.getRa ngeAt(0) : null;
700 if (!selectionRange || !selection.isCollapsed) 705 if (!selectionRange || !selection.isCollapsed)
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 }, 1024 },
1020 1025
1021 /** 1026 /**
1022 * @return {string|undefined} 1027 * @return {string|undefined}
1023 */ 1028 */
1024 _currentHistoryItem: function() 1029 _currentHistoryItem: function()
1025 { 1030 {
1026 return this._data[this._data.length - this._historyOffset]; 1031 return this._data[this._data.length - this._historyOffset];
1027 } 1032 }
1028 }; 1033 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698