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

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

Issue 296113004: Start using computed style instead of default tag actions. (Closed) Base URL: https://code.google.com/p/dom-distiller/@master
Patch Set: Fixed nit. Created 6 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: src/com/dom_distiller/client/DomToSaxVisitor.java
diff --git a/src/com/dom_distiller/client/DomToSaxVisitor.java b/src/com/dom_distiller/client/DomToSaxVisitor.java
index 53974a80a8cac4fc6fe0c7d2b142f186054565ea..a392bbb471086363102755efbaac8a32a1bdac3b 100644
--- a/src/com/dom_distiller/client/DomToSaxVisitor.java
+++ b/src/com/dom_distiller/client/DomToSaxVisitor.java
@@ -46,8 +46,8 @@ public class DomToSaxVisitor implements DomWalker.Visitor {
return false;
case Node.ELEMENT_NODE:
Element e = Element.as(n);
- Attributes attrs = getSaxAttributes(e);
- handler.startElement(sHtmlNamespace, e.getTagName(), e.getTagName(), attrs);
+ Attributes attrs = getAttributes(e);
+ handler.startElement(e, attrs);
return true;
case Node.DOCUMENT_NODE: // Don't recurse into sub-documents.
default: // This case is for comment nodes.
@@ -58,20 +58,19 @@ public class DomToSaxVisitor implements DomWalker.Visitor {
@Override
public void exit(Node n) {
Element e = Element.as(n);
- handler.endElement(sHtmlNamespace, e.getTagName(), e.getTagName());
+ handler.endElement(e);
}
/**
* @Return The element's attribute list converted to {@link Attributes}.
*/
- public static Attributes getSaxAttributes(Element e) {
+ public static Attributes getAttributes(Element e) {
AttributesImpl attrs = new AttributesImpl();
JsArray<Node> jsAttrs = DomUtil.getAttributes(e);
for (int i = 0; i < jsAttrs.length(); ++i) {
final Node jsAttr = jsAttrs.get(i);
- attrs.addAttribute("", jsAttr.getNodeName(), jsAttr.getNodeName(), "CDATA",
- jsAttr.getNodeValue());
+ attrs.addAttribute(jsAttr.getNodeName(), jsAttr.getNodeValue());
}
return attrs;
« no previous file with comments | « boilerpipe-core/src/main/de/l3s/boilerpipe/sax/TagAction.java ('k') | src/com/dom_distiller/client/sax/Attributes.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698