| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 if (this.firstChild) | 341 if (this.firstChild) |
| 342 this.textContent = ""; | 342 this.textContent = ""; |
| 343 } | 343 } |
| 344 | 344 |
| 345 /** | 345 /** |
| 346 * @return {boolean} | 346 * @return {boolean} |
| 347 */ | 347 */ |
| 348 Element.prototype.isInsertionCaretInside = function() | 348 Element.prototype.isInsertionCaretInside = function() |
| 349 { | 349 { |
| 350 var selection = this.getComponentSelection(); | 350 var selection = this.getComponentSelection(); |
| 351 if (!selection.rangeCount || !selection.isCollapsed) | 351 // @see crbug.com/602541 |
| 352 var selectionRange = selection && selection.rangeCount ? selection.getRangeA
t(0) : null; |
| 353 if (!selectionRange || !selection.isCollapsed) |
| 352 return false; | 354 return false; |
| 353 var selectionRange = selection.getRangeAt(0); | |
| 354 return selectionRange.startContainer.isSelfOrDescendant(this); | 355 return selectionRange.startContainer.isSelfOrDescendant(this); |
| 355 } | 356 } |
| 356 | 357 |
| 357 /** | 358 /** |
| 358 * @param {string} tagName | 359 * @param {string} tagName |
| 359 * @param {string=} customElementType | 360 * @param {string=} customElementType |
| 360 * @return {!Element} | 361 * @return {!Element} |
| 361 * @suppressGlobalPropertiesCheck | 362 * @suppressGlobalPropertiesCheck |
| 362 */ | 363 */ |
| 363 function createElement(tagName, customElementType) | 364 function createElement(tagName, customElementType) |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 { | 986 { |
| 986 window.removeEventListener("DOMContentLoaded", windowLoaded, false); | 987 window.removeEventListener("DOMContentLoaded", windowLoaded, false); |
| 987 callback(); | 988 callback(); |
| 988 } | 989 } |
| 989 | 990 |
| 990 if (document.readyState === "complete" || document.readyState === "interacti
ve") | 991 if (document.readyState === "complete" || document.readyState === "interacti
ve") |
| 991 callback(); | 992 callback(); |
| 992 else | 993 else |
| 993 window.addEventListener("DOMContentLoaded", windowLoaded, false); | 994 window.addEventListener("DOMContentLoaded", windowLoaded, false); |
| 994 } | 995 } |
| OLD | NEW |