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; | 5 package org.chromium.distiller; |
6 | 6 |
7 import org.chromium.distiller.webdocument.WebTable; | 7 import org.chromium.distiller.webdocument.WebTable; |
8 | 8 |
9 import com.google.gwt.core.client.JsArray; | 9 import com.google.gwt.core.client.JsArray; |
10 import com.google.gwt.dom.client.Document; | 10 import com.google.gwt.dom.client.Document; |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 "<td>text</td>" + | 338 "<td>text</td>" + |
339 "<td>text</td>" + | 339 "<td>text</td>" + |
340 "</tr>" + | 340 "</tr>" + |
341 "</tbody>" + | 341 "</tbody>" + |
342 "</table>"; | 342 "</table>"; |
343 | 343 |
344 mBody.setInnerHTML(html); | 344 mBody.setInnerHTML(html); |
345 DomUtil.stripStyleAttributes(mBody); | 345 DomUtil.stripStyleAttributes(mBody); |
346 assertEquals(expected, mBody.getInnerHTML()); | 346 assertEquals(expected, mBody.getInnerHTML()); |
347 } | 347 } |
| 348 |
| 349 public void testIsVisibleParentDisplayNone() { |
| 350 String html = |
| 351 "<div style=\"display: none;\">" + |
| 352 "<div>Some Text</div>" + |
| 353 "</div>"; |
| 354 mBody.setInnerHTML(html); |
| 355 Element child = mBody.getFirstChildElement().getFirstChildElement(); |
| 356 assertFalse(DomUtil.isVisible(child)); |
| 357 } |
| 358 |
| 359 public void testIsVisibleChildDisplayNone() { |
| 360 String html = |
| 361 "<div>" + |
| 362 "<div style=\"display: none;\">Some Text</div>" + |
| 363 "</div>"; |
| 364 mBody.setInnerHTML(html); |
| 365 Element child = mBody.getFirstChildElement().getFirstChildElement(); |
| 366 assertFalse(DomUtil.isVisible(child)); |
| 367 } |
| 368 |
| 369 public void testIsVisibleDisplayBlock() { |
| 370 String html = |
| 371 "<div>" + |
| 372 "<div>Some Text</div>" + |
| 373 "</div>"; |
| 374 mBody.setInnerHTML(html); |
| 375 Element child = mBody.getFirstChildElement().getFirstChildElement(); |
| 376 assertTrue(DomUtil.isVisible(child)); |
| 377 } |
348 } | 378 } |
OLD | NEW |