| Index: java/org/chromium/distiller/DomUtil.java
|
| diff --git a/java/org/chromium/distiller/DomUtil.java b/java/org/chromium/distiller/DomUtil.java
|
| index d0bcb1bfd7330c1cc8c56be59fdbc6320918284f..973fd62290ca8b1a61b3636f24ea9f2eca539e5f 100644
|
| --- a/java/org/chromium/distiller/DomUtil.java
|
| +++ b/java/org/chromium/distiller/DomUtil.java
|
| @@ -216,6 +216,7 @@ public class DomUtil {
|
| stripFontColorAttributes(clonedSubtree);
|
| stripTableBackgroundColorAttributes(clonedSubtree);
|
| stripStyleAttributes(clonedSubtree);
|
| + stripAlignAttributes(clonedSubtree);
|
|
|
| if (textOnly) {
|
| return DomUtil.getTextFromTree(clonedSubtree);
|
| @@ -260,8 +261,11 @@ public class DomUtil {
|
| }
|
|
|
| public static void makeSrcSetAbsolute(ImageElement ie) {
|
| + String srcset = ie.getAttribute("srcset");
|
| + if (srcset == "") return;
|
| +
|
| String oldsrc = ie.getSrc();
|
| - String[] sizes = StringUtil.jsSplit(ie.getAttribute("srcset"), ",");
|
| + String[] sizes = StringUtil.jsSplit(srcset, ",");
|
| for(int i = 0; i < sizes.length; i++) {
|
| String size = StringUtil.jsTrim(sizes[i]);
|
| if (size.isEmpty()) continue;
|
| @@ -338,6 +342,13 @@ public class DomUtil {
|
| }
|
|
|
| /**
|
| + * Strips all "align" attributes from image elements in the tree rooted at |rootNode|
|
| + */
|
| + public static void stripAlignAttributes(Node rootNode) {
|
| + stripAttributeFromTags(rootNode, "ALIGN", new String[]{"IMG"});
|
| + }
|
| +
|
| + /**
|
| * Get a list of relevant nodes from a subtree.
|
| * @param root The root of the subtree.
|
| * @return A list of relevant nodes.
|
|
|