mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
+ Cleaned up TabItem bounds getting and setting (the translation between our coordinates and the div style needs to be done carefully, in particular due to the padding in the tab style), and added a unit test for it
This commit is contained in:
parent
f5531e7c7b
commit
555ae49cad
@ -444,14 +444,8 @@ iQ.fn = iQ.prototype = {
|
||||
// Function: bounds
|
||||
bounds: function(unused) {
|
||||
Utils.assert('does not yet support setting', unused === undefined);
|
||||
Utils.assert('does not yet support multi-objects (or null objects)', this.length == 1);
|
||||
var el = this[0];
|
||||
return new Rect(
|
||||
parseInt(el.style.left) || el.offsetLeft,
|
||||
parseInt(el.style.top) || el.offsetTop,
|
||||
el.clientWidth,
|
||||
el.clientHeight
|
||||
);
|
||||
var p = this.position();
|
||||
return new Rect(p.left, p.top, this.width(), this.height());
|
||||
},
|
||||
|
||||
// ----------
|
||||
|
@ -544,16 +544,6 @@ var Utils = {
|
||||
return date.getTime();
|
||||
},
|
||||
|
||||
// ___ Geometry
|
||||
getBounds: function(el) {
|
||||
return new Rect(
|
||||
parseInt(el.style.left) || el.offsetLeft,
|
||||
parseInt(el.style.top) || el.offsetTop,
|
||||
el.clientWidth,
|
||||
el.clientHeight
|
||||
);
|
||||
},
|
||||
|
||||
// ___ Misc
|
||||
isDOMElement: function(object) {
|
||||
return (object && typeof(object.nodeType) != 'undefined' ? true : false);
|
||||
|
Loading…
Reference in New Issue
Block a user