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

Side by Side Diff: java/org/chromium/distiller/webdocument/DomConverter.java

Issue 1265533004: Handle lists more appropriately (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | java/org/chromium/distiller/webdocument/ElementAction.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.distiller.webdocument; 5 package org.chromium.distiller.webdocument;
6 6
7 import org.chromium.distiller.DomUtil; 7 import org.chromium.distiller.DomUtil;
8 import org.chromium.distiller.DomWalker; 8 import org.chromium.distiller.DomWalker;
9 import org.chromium.distiller.LogUtil; 9 import org.chromium.distiller.LogUtil;
10 import org.chromium.distiller.TableClassifier; 10 import org.chromium.distiller.TableClassifier;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // later. 107 // later.
108 case "TABLE": 108 case "TABLE":
109 TableClassifier.Type type = TableClassifier.table(TableElement.a s(e)); 109 TableClassifier.Type type = TableClassifier.table(TableElement.a s(e));
110 logTableInfo(e, type); 110 logTableInfo(e, type);
111 if (type == TableClassifier.Type.DATA) { 111 if (type == TableClassifier.Type.DATA) {
112 builder.dataTable(e); 112 builder.dataTable(e);
113 return false; 113 return false;
114 } 114 }
115 break; 115 break;
116 116
117 case "UL":
118 case "OL":
119 // Start list and continue with the dom converter. Builder shoul d handle exiting list.
120 break;
121
117 // Some components are revisited later in context as they break text -flow of a 122 // Some components are revisited later in context as they break text -flow of a
118 // document. e.g. <video> can contain text if format is unsupported . 123 // document. e.g. <video> can contain text if format is unsupported .
119 case "VIDEO": 124 case "VIDEO":
120 builder.embed(new WebVideo(e, e.getClientHeight(), e.getClientHe ight())); 125 builder.embed(new WebVideo(e, e.getClientHeight(), e.getClientHe ight()));
121 return false; 126 return false;
122 127
123 // These element types are all skipped (but may affect document cons truction). 128 // These element types are all skipped (but may affect document cons truction).
124 case "OPTION": 129 case "OPTION":
125 case "OBJECT": 130 case "OBJECT":
126 case "EMBED": 131 case "EMBED":
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 Element parent = e.getParentElement(); 165 Element parent = e.getParentElement();
161 LogUtil.logToConsole("TABLE: " + type + 166 LogUtil.logToConsole("TABLE: " + type +
162 ", id=" + e.getId() + 167 ", id=" + e.getId() +
163 ", class=" + e.getClassName() + 168 ", class=" + e.getClassName() +
164 ", parent=[" + parent.getTagName() + 169 ", parent=[" + parent.getTagName() +
165 ", id=" + parent.getId() + 170 ", id=" + parent.getId() +
166 ", class=" + parent.getClassName() + 171 ", class=" + parent.getClassName() +
167 "]"); 172 "]");
168 } 173 }
169 } 174 }
OLDNEW
« no previous file with comments | « no previous file | java/org/chromium/distiller/webdocument/ElementAction.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698