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

Unified Diff: java/org/chromium/distiller/DomUtil.java

Issue 2004883003: Strip "target" attribute from anchor elements (Closed) Base URL: git@github.com:chromium/dom-distiller.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | java/org/chromium/distiller/webdocument/WebText.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: java/org/chromium/distiller/DomUtil.java
diff --git a/java/org/chromium/distiller/DomUtil.java b/java/org/chromium/distiller/DomUtil.java
index 5d3ace5179e4350fb1b70bb19cd738a2616c68a0..28ec2aca7f8a816f7a8f7fc5e50d6cb563793959 100644
--- a/java/org/chromium/distiller/DomUtil.java
+++ b/java/org/chromium/distiller/DomUtil.java
@@ -213,6 +213,7 @@ public class DomUtil {
stripIds(clonedSubtree);
makeAllLinksAbsolute(clonedSubtree);
+ stripTargetAttributes(clonedSubtree);
stripFontColorAttributes(clonedSubtree);
stripTableBackgroundColorAttributes(clonedSubtree);
stripStyleAttributes(clonedSubtree);
@@ -402,6 +403,13 @@ public class DomUtil {
}
/**
+ * Strips all "target" attributes from anchor nodes in the tree rooted at |rootNode|
+ */
+ public static void stripTargetAttributes(Node rootNode) {
+ stripAttributeFromTags(rootNode, "TARGET", new String[]{"A"});
+ }
+
+ /**
* Get a list of relevant nodes from a subtree.
* @param root The root of the subtree.
* @return A list of relevant nodes.
« no previous file with comments | « no previous file | java/org/chromium/distiller/webdocument/WebText.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698