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

Unified Diff: third_party/document_image_extractor/src/visible_element_filter.js

Issue 1138123002: Update third_party/document_image_extractor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/document_image_extractor/src/visible_element_filter.js
diff --git a/third_party/document_image_extractor/src/visible_element_filter.js b/third_party/document_image_extractor/src/visible_element_filter.js
index e337b1b025d8db3dc3ad257759f0416743994949..3c9aaf7ccb37238fef26db44a6c5f9ef36497530 100644
--- a/third_party/document_image_extractor/src/visible_element_filter.js
+++ b/third_party/document_image_extractor/src/visible_element_filter.js
@@ -2,45 +2,44 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-goog.provide('image.collections.extension.VisibleElementFilter');
+goog.provide('image.collections.extension.domextractor.VisibleElementFilter');
-goog.require('goog.dom');
-goog.require('goog.style');
-goog.require('image.collections.extension.ElementFilter');
+goog.require('image.collections.extension.domextractor.DomUtils');
+goog.require('image.collections.extension.domextractor.ElementFilter');
goog.scope(function() {
-var ElementFilter = image.collections.extension.ElementFilter;
+var DomUtils = image.collections.extension.domextractor.DomUtils;
/**
* Filters elements by visibility.
- * @implements {ElementFilter}
+ * @implements {image.collections.extension.domextractor.ElementFilter}
* @constructor
*/
-image.collections.extension.VisibleElementFilter = function() {};
-var VisibleElementFilter = image.collections.extension.VisibleElementFilter;
+image.collections.extension.domextractor.VisibleElementFilter = function() {};
+var VisibleElementFilter =
+ image.collections.extension.domextractor.VisibleElementFilter;
/** @override */
VisibleElementFilter.prototype.filter = function(element) {
- // TODO(busaryev): handle the overflow: hidden case.
var ancestorElement = element;
while (ancestorElement) {
- if (goog.style.getComputedStyle(ancestorElement, 'display') == 'none') {
+ if (DomUtils.getComputedStyle(ancestorElement, 'display') == 'none') {
return false;
}
- var size = goog.style.getSize(ancestorElement);
- var overflow = goog.style.getComputedStyle(ancestorElement, 'overflow');
- if ((overflow == 'hidden') && size.isEmpty()) {
+ var size = DomUtils.getSize(ancestorElement);
+ var overflow = DomUtils.getComputedStyle(ancestorElement, 'overflow');
+ if ((overflow == 'hidden') && size.area() == 0) {
return false;
}
- if (goog.style.getComputedStyle(ancestorElement, 'visibility') ==
+ if (DomUtils.getComputedStyle(ancestorElement, 'visibility') ==
'hidden') {
return false;
}
- ancestorElement = goog.dom.getParentElement(ancestorElement);
+ ancestorElement = DomUtils.getParentElement(ancestorElement);
}
return true;
};
« no previous file with comments | « third_party/document_image_extractor/src/size.js ('k') | third_party/document_image_extractor/third_party/LICENSE » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698