| 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 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 */ | 925 */ |
| 926 Document.prototype.deepElementFromPoint = function(x, y) | 926 Document.prototype.deepElementFromPoint = function(x, y) |
| 927 { | 927 { |
| 928 var node = this.elementFromPoint(x, y); | 928 var node = this.elementFromPoint(x, y); |
| 929 while (node && node.shadowRoot) | 929 while (node && node.shadowRoot) |
| 930 node = node.shadowRoot.elementFromPoint(x, y); | 930 node = node.shadowRoot.elementFromPoint(x, y); |
| 931 return node; | 931 return node; |
| 932 } | 932 } |
| 933 | 933 |
| 934 /** | 934 /** |
| 935 * @return {?Element} |
| 936 */ |
| 937 Document.prototype.deepActiveElement = function() |
| 938 { |
| 939 var activeElement = this.activeElement; |
| 940 while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot
.activeElement) |
| 941 activeElement = activeElement.shadowRoot.activeElement; |
| 942 return activeElement; |
| 943 } |
| 944 |
| 945 /** |
| 935 * @param {!Event} event | 946 * @param {!Event} event |
| 936 * @return {boolean} | 947 * @return {boolean} |
| 937 */ | 948 */ |
| 938 function isEnterKey(event) | 949 function isEnterKey(event) |
| 939 { | 950 { |
| 940 // Check if in IME. | 951 // Check if in IME. |
| 941 return event.keyCode !== 229 && event.key === "Enter"; | 952 return event.keyCode !== 229 && event.key === "Enter"; |
| 942 } | 953 } |
| 943 | 954 |
| 944 /** | 955 /** |
| (...skipping 23 matching lines...) Expand all Loading... |
| 968 { | 979 { |
| 969 window.removeEventListener("DOMContentLoaded", windowLoaded, false); | 980 window.removeEventListener("DOMContentLoaded", windowLoaded, false); |
| 970 callback(); | 981 callback(); |
| 971 } | 982 } |
| 972 | 983 |
| 973 if (document.readyState === "complete" || document.readyState === "interacti
ve") | 984 if (document.readyState === "complete" || document.readyState === "interacti
ve") |
| 974 callback(); | 985 callback(); |
| 975 else | 986 else |
| 976 window.addEventListener("DOMContentLoaded", windowLoaded, false); | 987 window.addEventListener("DOMContentLoaded", windowLoaded, false); |
| 977 } | 988 } |
| OLD | NEW |