OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import css_checker | 6 import css_checker |
7 from os import path as os_path | 7 from os import path as os_path |
8 import re | 8 import re |
9 from sys import path as sys_path | 9 from sys import path as sys_path |
10 import unittest | 10 import unittest |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 background-position-y: 0ex; | 454 background-position-y: 0ex; |
455 border-width: 0em; | 455 border-width: 0em; |
456 opacity: .0; | 456 opacity: .0; |
457 opacity: 0.0; | 457 opacity: 0.0; |
458 opacity: 0.; | 458 opacity: 0.; |
459 border-width: 0mm; | 459 border-width: 0mm; |
460 height: 0cm; | 460 height: 0cm; |
461 width: 0in; | 461 width: 0in; |
462 """) | 462 """) |
463 | 463 |
464 def testHtmlInlineStyle(self): | 464 def testInlineStyleInHtml(self): |
465 self.VerifyContentsProducesOutput("""<!doctype html> | 465 self.VerifyContentsProducesOutput("""<!doctype html> |
466 <html> | 466 <html> |
467 <head> | 467 <head> |
468 <!-- Don't warn about problems outside of style tags | 468 <!-- Don't warn about problems outside of style tags |
469 html, | 469 html, |
470 body { | 470 body { |
471 margin: 0; | 471 margin: 0; |
472 height: 100%; | 472 height: 100%; |
473 } | 473 } |
474 --> | 474 --> |
475 <style> | 475 <style> |
476 body { | 476 body { |
477 flex-direction:column; | 477 flex-direction:column; |
478 } | 478 } |
479 </style> | 479 </style> |
480 </head> | 480 </head> |
481 </html>""", """ | 481 </html>""", """ |
482 - Colons (:) should have a space after them. | 482 - Colons (:) should have a space after them. |
483 flex-direction:column; | 483 flex-direction:column; |
484 """, filename='test.html') | 484 """, filename='test.html') |
485 | 485 |
486 def testHtmlIncludeStyle(self): | 486 def testInlineStyleInHtmlWithIncludes(self): |
487 self.VerifyContentsProducesOutput("""<!doctype html> | 487 self.VerifyContentsProducesOutput("""<!doctype html> |
488 <html> | 488 <html> |
489 <style include="fake-shared-css"> | 489 <style include="fake-shared-css other-shared-css"> |
490 body { | 490 body { |
491 flex-direction:column; | 491 flex-direction:column; |
492 } | 492 } |
493 </style> | 493 </style> |
494 </head> | 494 </head> |
495 </html>""", """ | 495 </html>""", """ |
496 - Colons (:) should have a space after them. | 496 - Colons (:) should have a space after them. |
497 flex-direction:column; | 497 flex-direction:column; |
498 """, filename='test.html') | 498 """, filename='test.html') |
499 | 499 |
| 500 def testInlineSTyleInHtmlWithTagsInComments(self): |
| 501 self.VerifyContentsProducesOutput("""<!doctype html> |
| 502 <html> |
| 503 <style> |
| 504 body { |
| 505 /* You better ignore the <tag> in this comment! */ |
| 506 flex-direction:column; |
| 507 } |
| 508 </style> |
| 509 </head> |
| 510 </html>""", """ |
| 511 - Colons (:) should have a space after them. |
| 512 flex-direction:column; |
| 513 """, filename='test.html') |
| 514 |
500 | 515 |
501 if __name__ == '__main__': | 516 if __name__ == '__main__': |
502 unittest.main() | 517 unittest.main() |
OLD | NEW |