|
735 | 735 | }
|
736 | 736 | }));
|
737 | 737 |
|
| 738 | + suite.add(new ValidationTestCase({ |
| 739 | + property: "font", |
| 740 | + |
| 741 | + valid: [ |
| 742 | + "italic small-caps 300 1.3em/10% Genova, 'Comic Sans', sans-serif", |
| 743 | + "1.3em Shorties, sans-serif", |
| 744 | + "12px monospace", |
| 745 | + "caption", |
| 746 | + "status-bar", |
| 747 | + "12pt/14pt sans-serif", |
| 748 | + "80% sans-serif", |
| 749 | + "condensed 80% sans-serif", |
| 750 | + "x-large/110% \"new century schoolbook\", serif", |
| 751 | + "bold italic large Palatino, serif", |
| 752 | + "normal small-caps 120%/120% fantasy", |
| 753 | + "normal normal normal normal 12pt cursive", |
| 754 | + "normal bold small-caps italic 18px 'font'", |
| 755 | + "condensed oblique 12pt \"Helvetica Neue\", serif", |
| 756 | + "inherit", |
| 757 | + ], |
| 758 | + |
| 759 | + invalid: { |
| 760 | + "italic oblique bold 1.3em/10% Genova, 'Comic Sans', sans-serif" : "Expected (<font-shorthand> | caption | icon | menu | message-box | small-caption | status-bar | inherit) but found 'italic oblique bold 1.3em / 10% Genova , 'Comic Sans' , sans-serif'.", |
| 761 | + "0.9em Nirwana, 'Comic Sans', sans-serif bold" : "Expected end of value but found 'bold'.", |
| 762 | + "'Helvetica Neue', sans-serif 1.2em" : "Expected (<font-shorthand> | caption | icon | menu | message-box | small-caption | status-bar | inherit) but found ''Helvetica Neue' , sans-serif 1.2em'.", |
| 763 | + "1.3em" : "Expected (<font-shorthand> | caption | icon | menu | message-box | small-caption | status-bar | inherit) but found '1.3em'.", |
| 764 | + "cursive;" : "Expected (<font-shorthand> | caption | icon | menu | message-box | small-caption | status-bar | inherit) but found 'cursive'.", |
| 765 | + "'Dormant', sans-serif;" : "Expected (<font-shorthand> | caption | icon | menu | message-box | small-caption | status-bar | inherit) but found ''Dormant' , sans-serif'." |
| 766 | + } |
| 767 | + })); |
| 768 | + |
| 769 | + suite.add(new ValidationTestCase({ |
| 770 | + property: "font-family", |
| 771 | + |
| 772 | + valid: [ |
| 773 | + "Futura, sans-serif", |
| 774 | + "-Futura, sans-serif", |
| 775 | + '"New Century Schoolbook", serif', |
| 776 | + "'21st Century', fantasy", |
| 777 | + "serif", |
| 778 | + "sans-serif", |
| 779 | + "cursive", |
| 780 | + "fantasy", |
| 781 | + "monospace", |
| 782 | + // solve problem by quoting |
| 783 | + "'Red/Black', sans-serif", |
| 784 | + '"Lucida\\", Grande", sans-serif', |
| 785 | + "'Ahem!}', sans-serif", |
| 786 | + '"test@foo", sans-serif', |
| 787 | + "'#POUND', sans-serif", |
| 788 | + "'Hawaii 5-0', sans-serif", |
| 789 | + // solve problem by escaping |
| 790 | + "Red\\/Black, sans-serif", |
| 791 | + '\\"Lucida\\", Grande, sans-serif', |
| 792 | + "Ahem\\!, sans-serif", |
| 793 | + "test\\@foo, sans-serif", |
| 794 | + "\\#POUND, sans-serif", |
| 795 | + "Hawaii\\ 5\\-0, sans-serif", |
| 796 | + "yellowgreen" |
| 797 | + ], |
738 | 798 |
|
| 799 | + invalid: { |
| 800 | + "--Futura, sans-serif" : "Expected (<font-family> | inherit) but found '--Futura , sans-serif'.", |
| 801 | + "Red/Black, sans-serif" : "Expected end of value but found '/'.", |
| 802 | + "'Lucida' Grande, sans-serif" : "Expected end of value but found 'Grande'.", |
| 803 | + "Hawaii 5-0, sans-serif" : "Expected end of value but found '5'." |
| 804 | + }, |
| 805 | + |
| 806 | + error: { |
| 807 | + "47Futura, sans-serif" : "Unexpected token '47Futura' at line 1, col 20.", |
| 808 | + "-7Futura, sans-serif" : "Unexpected token '7Futura' at line 1, col 21.", |
| 809 | + "Ahem!, sans-serif" : "Expected RBRACE at line 1, col 24.", |
| 810 | + "test@foo, sans-serif" : "Expected RBRACE at line 1, col 24.", |
| 811 | + "#POUND, sans-serif" : "Expected a hex color but found '#POUND' at line 1, col 20." |
| 812 | + } |
| 813 | + })); |
| 814 | + |
| 815 | + suite.add(new ValidationTestCase({ |
| 816 | + property: "font-style", |
| 817 | + |
| 818 | + valid: [ |
| 819 | + "normal", "italic", "oblique", |
| 820 | + "inherit" |
| 821 | + ] |
| 822 | + })); |
| 823 | + |
| 824 | + suite.add(new ValidationTestCase({ |
| 825 | + property: "font-variant", |
| 826 | + |
| 827 | + valid: [ |
| 828 | + "normal", "none", "small-caps", "common-ligatures small-caps", |
| 829 | + "inherit" |
| 830 | + ] |
| 831 | + })); |
| 832 | + |
| 833 | + suite.add(new ValidationTestCase({ |
| 834 | + property: "font-variant-alternates", |
| 835 | + |
| 836 | + valid: [ |
| 837 | + "normal", "historical-forms", |
| 838 | + "stylistic(salt) styleset(ss01, ss02)", |
| 839 | + "character-variant(cv03, cv04, cv05) swash(swsh)", |
| 840 | + "ornaments(ornm2) annotation(nalt2)", |
| 841 | + "inherit" |
| 842 | + ] |
| 843 | + })); |
| 844 | + |
| 845 | + suite.add(new ValidationTestCase({ |
| 846 | + property: "font-variant-caps", |
| 847 | + |
| 848 | + valid: [ |
| 849 | + "normal", "small-caps", "all-small-caps", "petite-caps", |
| 850 | + "all-petite-caps", "unicase", "titling-caps", "inherit" |
| 851 | + ] |
| 852 | + })); |
| 853 | + |
| 854 | + suite.add(new ValidationTestCase({ |
| 855 | + property: "font-variant-east-asian", |
| 856 | + |
| 857 | + valid: [ |
| 858 | + "normal", "ruby", "jis78", "jis83", "jis90", "jis04", |
| 859 | + "simplified", "traditional", "full-width", "proportional-width", |
| 860 | + "ruby full-width jis83", |
| 861 | + "inherit" |
| 862 | + ] |
| 863 | + })); |
| 864 | + |
| 865 | + suite.add(new ValidationTestCase({ |
| 866 | + property: "font-variant-ligatures", |
| 867 | + |
| 868 | + valid: [ |
| 869 | + "normal", "none", |
| 870 | + "common-ligatures discretionary-ligatures historical-ligatures contextual", |
| 871 | + "no-common-ligatures no-discretionary-ligatures no-historical-ligatures no-contextual", |
| 872 | + "inherit" |
| 873 | + ] |
| 874 | + })); |
| 875 | + |
| 876 | + suite.add(new ValidationTestCase({ |
| 877 | + property: "font-variant-numeric", |
| 878 | + |
| 879 | + valid: [ |
| 880 | + "normal", "ordinal", "slashed-zero", "lining-nums", |
| 881 | + "lining-nums proportional-nums diagonal-fractions ordinal", |
| 882 | + "oldstyle-nums tabular-nums stacked-fractions slashed-zero", |
| 883 | + "inherit" |
| 884 | + ] |
| 885 | + })); |
739 | 886 |
|
740 | 887 | suite.add(new ValidationTestCase({
|
741 | 888 | property: "min-height",
|
|
0 commit comments