| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 if (typeof x === "number") | 154 if (typeof x === "number") |
| 155 this.style.setProperty("left", (shift.x + x) + "px"); | 155 this.style.setProperty("left", (shift.x + x) + "px"); |
| 156 else | 156 else |
| 157 this.style.removeProperty("left"); | 157 this.style.removeProperty("left"); |
| 158 | 158 |
| 159 if (typeof y === "number") | 159 if (typeof y === "number") |
| 160 this.style.setProperty("top", (shift.y + y) + "px"); | 160 this.style.setProperty("top", (shift.y + y) + "px"); |
| 161 else | 161 else |
| 162 this.style.removeProperty("top"); | 162 this.style.removeProperty("top"); |
| 163 |
| 164 if (typeof x === "number" || typeof y === "number") |
| 165 this.style.setProperty("position", "absolute"); |
| 166 else |
| 167 this.style.removeProperty("position"); |
| 163 } | 168 } |
| 164 | 169 |
| 165 /** | 170 /** |
| 166 * @return {boolean} | 171 * @return {boolean} |
| 167 */ | 172 */ |
| 168 Element.prototype.isScrolledToBottom = function() | 173 Element.prototype.isScrolledToBottom = function() |
| 169 { | 174 { |
| 170 // This code works only for 0-width border. | 175 // This code works only for 0-width border. |
| 171 // Both clientHeight and scrollHeight are rounded to integer values, so we t
olerate | 176 // Both clientHeight and scrollHeight are rounded to integer values, so we t
olerate |
| 172 // one pixel error. | 177 // one pixel error. |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 { | 957 { |
| 953 window.removeEventListener("DOMContentLoaded", windowLoaded, false); | 958 window.removeEventListener("DOMContentLoaded", windowLoaded, false); |
| 954 callback(); | 959 callback(); |
| 955 } | 960 } |
| 956 | 961 |
| 957 if (document.readyState === "complete" || document.readyState === "interacti
ve") | 962 if (document.readyState === "complete" || document.readyState === "interacti
ve") |
| 958 callback(); | 963 callback(); |
| 959 else | 964 else |
| 960 window.addEventListener("DOMContentLoaded", windowLoaded, false); | 965 window.addEventListener("DOMContentLoaded", windowLoaded, false); |
| 961 } | 966 } |
| OLD | NEW |