Skip to content

Commit ccc51aa

Browse files
author
AutomatedTester
committed
remove unused css transform code from location in view
1 parent 574b37c commit ccc51aa

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

javascript/atoms/dom.js

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -926,51 +926,8 @@ bot.dom.getClientRect = function(elem) {
926926
rect.top -= doc.documentElement.clientTop + doc.body.clientTop;
927927
}
928928

929-
// On Gecko < 12, getBoundingClientRect does not account for CSS transforms.
930-
// TODO: Remove this when we drop support for FF3.6 and FF10.
931-
if (goog.userAgent.GECKO && !bot.userAgent.isEngineVersion(12)) {
932-
transformLegacyFirefoxClientRect(elem);
933-
}
934-
935929
return rect;
936930
}
937-
938-
function transformLegacyFirefoxClientRect(container) {
939-
var win = goog.dom.getWindow(goog.dom.getOwnerDocument(container));
940-
var transform = win.getComputedStyle(container, null)['MozTransform'];
941-
var matches = transform.match(bot.dom.CSS_TRANSFORM_MATRIX_REGEX_);
942-
943-
if (matches) {
944-
var a = parseFloat(matches[1]), b = parseFloat(matches[2]),
945-
c = parseFloat(matches[3]), d = parseFloat(matches[4]),
946-
x = parseFloat(matches[5]), y = parseFloat(matches[6]);
947-
var right = rect.left + rect.width, bottom = rect.top + rect.height;
948-
var leftXa = rect.left * a, rightXa = right * a,
949-
leftXb = rect.left * b, rightXb = right * b,
950-
topXc = rect.top * c, bottomXc = bottom * c,
951-
topXd = rect.top * d, bottomXd = bottom * d;
952-
var topLeftX = leftXa + topXc + x,
953-
topLeftY = leftXb + topXd + y,
954-
topRightX = rightXa + topXc + x,
955-
topRightY = rightXb + topXd + y,
956-
bottomLeftX = leftXa + bottomXc + x,
957-
bottomLeftY = leftXb + bottomXd + y,
958-
bottomRightX = rightXa + bottomXc + x,
959-
bottomRightY = rightXb + bottomXd + y;
960-
rect.left = Math.min(topLeftX, topRightX, bottomLeftX, bottomRightX);
961-
rect.top = Math.min(topLeftY, topRightY, bottomLeftY, bottomRightY);
962-
var newRight = Math.max(topLeftX, topRightX, bottomLeftX, bottomRightX);
963-
var newBottom = Math.max(topLeftY, topRightY, bottomLeftY, bottomRightY);
964-
rect.width = newRight - rect.left;
965-
rect.height = newBottom - rect.top;
966-
}
967-
968-
// The computed transform style not not take into account parent transforms.
969-
var parentContainer = bot.dom.getParentElement(container);
970-
if (parentContainer) {
971-
transformLegacyFirefoxClientRect(parentContainer);
972-
}
973-
}
974931
};
975932

976933

0 commit comments

Comments
 (0)