Chromium Code Reviews| 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.JavaScript; | 9 import org.chromium.distiller.JavaScript; |
| 10 import org.chromium.distiller.LogUtil; | 10 import org.chromium.distiller.LogUtil; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 if (isHiddenClass || hasHiddenClassName) { | 105 if (isHiddenClass || hasHiddenClassName) { |
| 106 // See crbug.com/599121 | 106 // See crbug.com/599121 |
| 107 keepAnyway = true; | 107 keepAnyway = true; |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 if (isMobileFriendly) { | 110 if (isMobileFriendly) { |
| 111 if (e.getAttribute("class").contains("continue")) { | 111 if (e.getAttribute("class").contains("continue")) { |
| 112 // See crbug.com/687071 | 112 // See crbug.com/687071 |
| 113 keepAnyway = true; | 113 keepAnyway = true; |
| 114 } | 114 } |
| 115 if (e.getAttribute("aria-expanded").equals("false")) { | |
|
Olivier
2017/03/04 09:26:51
Is there a risk that this fix expands all popup me
wychen
2017/03/14 01:06:01
Could be, but I'd expect menus to be removed down
| |
| 116 // Unhide folded elements, like folded sections on mobile Wi kipedia. | |
| 117 // See crbug.com/647667 | |
| 118 keepAnyway = true; | |
| 119 } | |
| 115 } | 120 } |
| 116 } | 121 } |
| 117 logVisibilityInfo(e, visible || keepAnyway); | 122 logVisibilityInfo(e, visible || keepAnyway); |
| 118 if (!visible && !keepAnyway) { | 123 if (!visible && !keepAnyway) { |
| 119 hiddenElements.add(e); | 124 hiddenElements.add(e); |
| 120 return false; | 125 return false; |
| 121 } | 126 } |
| 122 | 127 |
| 123 // Node-type specific extractors check for elements they are interested in here. Everything | 128 // Node-type specific extractors check for elements they are interested in here. Everything |
| 124 // else will be filtered through the switch below. | 129 // else will be filtered through the switch below. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 Element parent = e.getParentElement(); | 232 Element parent = e.getParentElement(); |
| 228 LogUtil.logToConsole("TABLE: " + type + | 233 LogUtil.logToConsole("TABLE: " + type + |
| 229 ", id=" + e.getId() + | 234 ", id=" + e.getId() + |
| 230 ", class=" + e.getAttribute("class") + | 235 ", class=" + e.getAttribute("class") + |
| 231 ", parent=[" + parent.getTagName() + | 236 ", parent=[" + parent.getTagName() + |
| 232 ", id=" + parent.getId() + | 237 ", id=" + parent.getId() + |
| 233 ", class=" + parent.getAttribute("class") + | 238 ", class=" + parent.getAttribute("class") + |
| 234 "]"); | 239 "]"); |
| 235 } | 240 } |
| 236 } | 241 } |
| OLD | NEW |