| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |