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

Unified Diff: src/com/dom_distiller/client/FilteringDomVisitor.java

Issue 322553005: Improve handling of <video>, <figure> and <br> (Closed) Base URL: https://code.google.com/p/dom-distiller/@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: src/com/dom_distiller/client/FilteringDomVisitor.java
diff --git a/src/com/dom_distiller/client/FilteringDomVisitor.java b/src/com/dom_distiller/client/FilteringDomVisitor.java
index 3c2d6c97de7f2ccd3711b2a036674c1a676b1e28..d803706a7b0b07a03d72eaf0fadad6965e872c1a 100644
--- a/src/com/dom_distiller/client/FilteringDomVisitor.java
+++ b/src/com/dom_distiller/client/FilteringDomVisitor.java
@@ -6,7 +6,6 @@ package com.dom_distiller.client;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Node;
-import com.google.gwt.dom.client.NodeList;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.TableElement;
@@ -57,6 +56,12 @@ public class FilteringDomVisitor implements DomWalker.Visitor {
return false;
}
}
+
+ // Don't traverse into text that will be restored into the DOM as part of a logical
+ // block when reconstructing the HTML.
+ if (e.hasTagName("FIGURE") || e.hasTagName("VIDEO")) {
+ return false;
+ }
}
return domVisitor.visit(n);
}
« no previous file with comments | « src/com/dom_distiller/client/ContentExtractor.java ('k') | src/com/dom_distiller/client/RelevantElementsFinder.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698