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

Side by Side Diff: Source/devtools/front_end/platform/DOMExtension.js

Issue 1188083002: DevTools: Fix Element.positionAt (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698