OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Unit tests for Web Development Style Guide checker.""" | 6 """Unit tests for Web Development Style Guide checker.""" |
7 | 7 |
8 import os | 8 import os |
9 import re | 9 import re |
10 import sys | 10 import sys |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 -webkit-margin-before: 10px; | 797 -webkit-margin-before: 10px; |
798 -webkit-margin-start: 20px; | 798 -webkit-margin-start: 20px; |
799 -webkit-padding-after: 3px; | 799 -webkit-padding-after: 3px; |
800 -webkit-padding-end: 5px; | 800 -webkit-padding-end: 5px; |
801 } | 801 } |
802 """, """ | 802 """, """ |
803 - Use *-top/bottom instead of -webkit-*-before/after. | 803 - Use *-top/bottom instead of -webkit-*-before/after. |
804 -webkit-margin-before: 10px; (replace with margin-top) | 804 -webkit-margin-before: 10px; (replace with margin-top) |
805 -webkit-padding-after: 3px; (replace with padding-bottom)""") | 805 -webkit-padding-after: 3px; (replace with padding-bottom)""") |
806 | 806 |
807 def testCssZeroLengthTerms(self): | 807 def testCssZeroWidthLengths(self): |
808 self.VerifyContentsProducesOutput(""" | 808 self.VerifyContentsProducesOutput(""" |
809 @-webkit-keyframe anim { | 809 @-webkit-keyframe anim { |
810 0% { /* Ignore key frames */ | 810 0% { /* Ignore key frames */ |
811 width: 0px; | 811 width: 0px; |
812 } | 812 } |
813 10% { | 813 10% { |
814 width: 10px; | 814 width: 10px; |
815 } | 815 } |
816 100% { | 816 100% { |
817 width: 100px; | 817 width: 100px; |
(...skipping 11 matching lines...) Expand all Loading... |
829 /* http://crbug.com/359682 */ | 829 /* http://crbug.com/359682 */ |
830 #spinner-container #spinner { | 830 #spinner-container #spinner { |
831 -webkit-animation-duration: 1.0s; | 831 -webkit-animation-duration: 1.0s; |
832 } | 832 } |
833 | 833 |
834 .media-button.play > .state0.active, | 834 .media-button.play > .state0.active, |
835 .media-button[state='0'] > .state0.normal /* blah */, /* blee */ | 835 .media-button[state='0'] > .state0.normal /* blah */, /* blee */ |
836 .media-button[state='0']:not(.disabled):hover > .state0.hover { | 836 .media-button[state='0']:not(.disabled):hover > .state0.hover { |
837 -webkit-animation: anim 0s; | 837 -webkit-animation: anim 0s; |
838 -webkit-animation-duration: anim 0ms; | 838 -webkit-animation-duration: anim 0ms; |
839 -webkit-transform: scale(0%), | 839 -webkit-transform: scale(0%); |
840 translateX(0deg), | |
841 translateY(0rad), | |
842 translateZ(0grad); | |
843 background-position-x: 0em; | 840 background-position-x: 0em; |
844 background-position-y: 0ex; | 841 background-position-y: 0ex; |
845 border-width: 0em; | 842 border-width: 0em; |
846 color: hsl(0, 0%, 85%); /* Shouldn't trigger error. */ | 843 color: hsl(0, 0%, 85%); /* Shouldn't trigger error. */ |
847 opacity: .0; | 844 opacity: .0; |
848 opacity: 0.0; | 845 opacity: 0.0; |
849 opacity: 0.; | 846 opacity: 0.; |
850 } | 847 } |
851 | 848 |
852 @page { | 849 @page { |
853 border-width: 0mm; | 850 border-width: 0mm; |
854 height: 0cm; | 851 height: 0cm; |
855 width: 0in; | 852 width: 0in; |
856 }""", """ | 853 }""", """ |
857 - Make all zero length terms (i.e. 0px) 0 unless inside of hsl() or part of""" | 854 - Use "0" for zero-width lengths (i.e. 0px -> 0) |
858 """ @keyframe. | |
859 width: 0px; | 855 width: 0px; |
860 -webkit-animation: anim 0s; | 856 -webkit-transform: scale(0%); |
861 -webkit-animation-duration: anim 0ms; | |
862 -webkit-transform: scale(0%), | |
863 translateX(0deg), | |
864 translateY(0rad), | |
865 translateZ(0grad); | |
866 background-position-x: 0em; | 857 background-position-x: 0em; |
867 background-position-y: 0ex; | 858 background-position-y: 0ex; |
868 border-width: 0em; | 859 border-width: 0em; |
869 opacity: .0; | 860 opacity: .0; |
870 opacity: 0.0; | 861 opacity: 0.0; |
871 opacity: 0.; | 862 opacity: 0.; |
872 border-width: 0mm; | 863 border-width: 0mm; |
873 height: 0cm; | 864 height: 0cm; |
874 width: 0in; | 865 width: 0in; |
875 """) | 866 """) |
876 | 867 |
877 if __name__ == '__main__': | 868 if __name__ == '__main__': |
878 unittest.main() | 869 unittest.main() |
OLD | NEW |