| 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 294 } |
| 295 | 295 |
| 296 | 296 |
| 297 /** | 297 /** |
| 298 * @return {boolean} | 298 * @return {boolean} |
| 299 */ | 299 */ |
| 300 Node.prototype.isComponentSelectionCollapsed = function() | 300 Node.prototype.isComponentSelectionCollapsed = function() |
| 301 { | 301 { |
| 302 // FIXME: crbug.com/447523, use selection.isCollapsed when it is fixed for s
hadow dom. | 302 // FIXME: crbug.com/447523, use selection.isCollapsed when it is fixed for s
hadow dom. |
| 303 var selection = this.getComponentSelection(); | 303 var selection = this.getComponentSelection(); |
| 304 return selection && selection.rangeCount ? selection.getRangeAt(0).collapsed
: true; | 304 var range = selection && selection.rangeCount ? selection.getRangeAt(0) : nu
ll; |
| 305 return range ? range.collapsed : true; |
| 305 } | 306 } |
| 306 | 307 |
| 307 /** | 308 /** |
| 308 * @return {!Selection} | 309 * @return {!Selection} |
| 309 */ | 310 */ |
| 310 Node.prototype.getDeepSelection = function() | 311 Node.prototype.getDeepSelection = function() |
| 311 { | 312 { |
| 312 var activeElement = this.ownerDocument.activeElement; | 313 var activeElement = this.ownerDocument.activeElement; |
| 313 var shadowRoot = null; | 314 var shadowRoot = null; |
| 314 while (activeElement && activeElement.shadowRoot) { | 315 while (activeElement && activeElement.shadowRoot) { |
| (...skipping 670 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 |