зеркало из https://github.com/mozilla/pjs.git
bug 419483 - r=sayrer, a=schrep - switch from using getBoxObjectFor to getBoundingClientRect
This commit is contained in:
Родитель
cfb7d24ef2
Коммит
c43e069fd9
|
@ -69,11 +69,19 @@ var Microformats = {
|
|||
for (let i = 0; i < microformatNodes.length; i++) {
|
||||
/* If showHidden undefined or false, don't add microformats to the list that aren't visible */
|
||||
if (!options || !options.hasOwnProperty("showHidden") || !options.showHidden) {
|
||||
var box = (microformatNodes[i].ownerDocument || microformatNodes[i]).getBoxObjectFor(microformatNodes[i]);
|
||||
if (microformatNodes[i].ownerDocument) {
|
||||
if (microformatNodes[i].getBoundingClientRect) {
|
||||
var box = microformatNodes[i].getBoundingClientRect();
|
||||
box.width = box.right - box.left;
|
||||
box.height = box.bottom - box.top;
|
||||
} else {
|
||||
var box = microformatNodes[i].ownerDocument.getBoxObjectFor(microformatNodes[i]);
|
||||
}
|
||||
if ((box.height == 0) || (box.width == 0)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (options && options.debug) {
|
||||
/* Don't validate in the debug case so that we don't get errors thrown */
|
||||
|
|
Загрузка…
Ссылка в новой задаче