1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001
#![allow(rustdoc::invalid_html_tags)]
//! HTML elements
// This code is derived from [Moxie DOM] under MIT/Apache-2.0 license on
// 2021-04-23
//
// [Moxie DOM]: https://github.com/anp/moxie
html_element!(
/// The [HTML `<a>` element (or *anchor* element)][mdn], along with its href
/// attribute, creates a hyperlink to other web pages, files, locations
/// within the same page, email addresses, or any other URL.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
a = {
dom_type: web_sys::HtmlAnchorElement;
attributes {
/// Prompts the user to save the linked URL instead of navigating to it.
/// Can be used with or without a value:
///
/// * Without a value, the browser will suggest a filename/extension,
/// generated from various
/// sources:
/// * The Content-Disposition HTTP header
/// * The final segment in the URL path
/// * The media type (from the (Content-Type header, the start of a
/// data: URL, or
/// Blob.type for a blob: URL)
/// * Defining a value suggests it as the filename. `/` and `\`
/// characters are converted to
/// underscores (_). Filesystems may forbid other characters in
/// filenames, so browsers will adjust the suggested name if
/// necessary.
///
/// > Notes:
/// > * download only works for same-origin URLs, or the blob: and data:
/// schemes. > * If Content-Disposition has a different filename
/// than download, the header takes > priority. (If
/// `Content-Disposition: inline`, Firefox prefers the header while
/// Chrome > prefers download.)
download: String,
/// The URL that the hyperlink points to. Links are not restricted to
/// HTTP-based URLs — they can use any URL scheme supported by
/// browsers:
///
/// * Sections of a page with fragment URLs
/// * Pieces of media files with media fragments
/// * Telephone numbers with tel: URLs
/// * Email addresses with mailto: URLs
/// * While web browsers may not support other URL schemes, web sites
/// can with
/// registerProtocolHandler()
href: String,
/// Hints at the human language of the linked URL. No built-in
/// functionality. Allowed values are the same as the global
/// lang attribute.
hreflang: String,
/// A space-separated list of URLs. When the link is followed, the
/// browser will send POST requests with the body PING to the
/// URLs. Typically for tracking.
ping: String,
/// The relationship of the linked URL as space-separated link types.
rel: String,
/// Where to display the linked URL, as the name for a browsing context
/// (a tab, window, or `<iframe>`). The following keywords have
/// special meanings for where to load the URL:
///
/// * `_self`: the current browsing context. (Default)
/// * `_blank`: usually a new tab, but users can configure browsers to
/// open a new window
/// instead.
/// * `_parent`: the parent browsing context of the current one. If no
/// parent, behaves as
/// _self.
/// * `_top`: the topmost browsing context (the "highest" context that’s
/// an ancestor of the
/// current one). If no ancestors, behaves as _self.
///
/// > Note: When using target, add rel="noreferrer noopener" to avoid
/// exploitation of the window.opener API;
///
/// > Note: Linking to another page with target="_blank" will run the
/// new page in the same process as your page. If the new page
/// executes JavaScript, your page's performance may
/// suffer. This can also be avoided by using rel="noreferrer noopener".
target: String,
/// Hints at the linked URL’s format with a MIME type. No built-in
/// functionality.
r#type: String,
};
}
);
parent_element!(a);
html_element!(
/// The [HTML Abbreviation element (`<abbr>`)][mdn] represents an
/// abbreviation or acronym; the optional [`title`][title] attribute can
/// provide an expansion or description for the abbreviation.
///
/// The title attribute has a specific semantic meaning when used with the
/// `<abbr>` element; it must contain a full human-readable description
/// or expansion of the abbreviation. This text is often presented by
/// browsers as a tooltip when the mouse cursor is hovered over the
/// element.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/abbr
/// [title]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#attr-title
abbr = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(abbr);
html_element!(
/// The [HTML Bring Attention To element (`<b>`)][mdn] is used to draw the
/// reader's attention to the element's contents, which are not
/// otherwise granted special importance.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b
b = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(b);
html_element!(
/// The [HTML Bidirectional Isolate element (`<bdi>`)][mdn] tells the
/// browser's bidirectional algorithm to treat the text it contains in
/// isolation from its surrounding text.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdi
bdi = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(bdi);
html_element!(
/// The [HTML Bidirectional Text Override element (`<bdo>`)][mdn] overrides
/// the current directionality of text, so that the text within is
/// rendered in a different direction.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdo
bdo = {
dom_type: web_sys::HtmlElement;
attributes {
/// The direction in which text should be rendered in this element's
/// contents. Possible values are:
///
/// * `ltr`: Indicates that the text should go in a left-to-right
/// direction.
/// * `rtl`: Indicates that the text should go in a right-to-left
/// direction.
dir: String,
};
}
);
parent_element!(bdo);
html_element!(
/// The [HTML `<br>` element][mdn] produces a line break in text
/// (carriage-return). It is useful for writing a poem or an address,
/// where the division of lines is significant.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br
br = {
dom_type: web_sys::HtmlBrElement;
}
);
html_element!(
/// The [HTML Citation element (`<cite>`)][mdn] is used to describe a
/// reference to a cited creative work, and must include the title of
/// that work.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/cite
cite = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(cite);
html_element!(
/// The [HTML `<code>` element][mdn] displays its contents styled in a
/// fashion intended to indicate that the text is a short fragment of
/// computer code.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code
code = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(code);
html_element!(
/// The [HTML `<data>` element][mdn] links a given content with a
/// machine-readable translation. If the content is time- or
/// date-related, the [`<time>`][time] element must be used.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/data
/// [time]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time
data = {
dom_type: web_sys::HtmlDataElement;
attributes {
/// This attribute specifies the machine-readable translation of the
/// content of the element.
value: String,
};
}
);
parent_element!(data);
html_element!(
/// The [HTML Definition element (`<dfn>`)][mdn] is used to indicate the
/// term being defined within the context of a definition phrase or
/// sentence.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dfn
dfn = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(dfn);
html_element!(
/// The [HTML `<em>` element][mdn] marks text that has stress emphasis. The
/// `<em>` element can be nested, with each level of nesting indicating
/// a greater degree of emphasis.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em
em = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(em);
html_element!(
/// The [HTML `<i>` element][mdn] represents a range of text that is set off
/// from the normal text for some reason. Some examples include
/// technical terms, foreign language phrases, or fictional character
/// thoughts. It is typically displayed in italic type.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/i
i = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(i);
html_element!(
/// The [HTML Keyboard Input element (`<kbd>`)][mdn] represents a span of
/// inline text denoting textual user input from a keyboard, voice
/// input, or any other text entry device.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd
kbd = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(kbd);
html_element!(
/// The [HTML Mark Text element (`<mark>`)][mdn] represents text which is
/// marked or highlighted for reference or notation purposes, due to the
/// marked passage's relevance or importance in the enclosing context.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark
mark = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(mark);
html_element!(
/// The [HTML `<q>` element][mdn] indicates that the enclosed text is a
/// short inline quotation. Most modern browsers implement this by
/// surrounding the text in quotation marks.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/q
q = {
dom_type: web_sys::HtmlQuoteElement;
attributes {
/// The value of this attribute is a URL that designates a source
/// document or message for the information quoted. This
/// attribute is intended to point to information explaining the
/// context or the reference for the quote.
cite: String,
};
}
);
parent_element!(q);
html_element!(
/// The [HTML Ruby Base (`<rb>`) element][mdn] is used to delimit the base
/// text component of a [`<ruby>`][ruby] annotation, i.e. the text that
/// is being annotated.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rb
/// [ruby]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ruby
rb = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(rb);
html_element!(
/// The [HTML Ruby Fallback Parenthesis (`<rp>`) element][mdn] is used to
/// provide fall-back parentheses for browsers that do not support
/// display of ruby annotations using the [`<ruby>`][ruby] element.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rp
/// [ruby]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ruby
rp = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(rp);
html_element!(
/// The [HTML Ruby Text (`<rt>`) element][mdn] specifies the ruby text
/// component of a ruby annotation, which is used to provide
/// pronunciation, translation, or transliteration information for East
/// Asian typography. The `<rt>` element must always be contained within a
/// [`<ruby>`][ruby] element.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rt
/// [ruby]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ruby
rt = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(rt);
html_element!(
/// The [HTML Ruby Text Container (`<rtc>`) element][mdn] embraces semantic
/// annotations of characters presented in a ruby of [`<rb>`][rb]
/// elements used inside of [`<ruby>`][ruby] element. [`<rb>`][rb]
/// elements can have both pronunciation ([`<rt>`][rt]) and semantic
/// ([`<rtc>`][rtc]) annotations.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rtc
/// [rb]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rb
/// [ruby]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ruby
/// [rt]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rt
/// [rtc]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rtc
rtc = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(rtc);
html_element!(
/// The [HTML `<ruby>` element][mdn] represents a ruby annotation. Ruby
/// annotations are for showing pronunciation of East Asian characters.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ruby
ruby = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(ruby);
html_element!(
/// The [HTML `<s>` element][mdn] renders text with a strikethrough, or a
/// line through it. Use the `<s>` element to represent things that are
/// no longer relevant or no longer accurate. However, `<s>` is not
/// appropriate when indicating document edits; for that, use the
/// [`<del>`][del] and [`<ins>`][ins] elements, as appropriate.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s
/// [del]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/del
/// [ins]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ins
s = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(s);
html_element!(
/// The [HTML Sample Element (`<samp>`)][mdn] is used to enclose inline text
/// which represents sample (or quoted) output from a computer program.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/samp
samp = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(samp);
html_element!(
/// The [HTML `<small>` element][mdn] represents side-comments and small
/// print, like copyright and legal text, independent of its styled
/// presentation. By default, it renders text within it one font-size
/// small, such as from `small` to `x-small`.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/small
small = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(small);
html_element!(
/// The [HTML `<span>` element][mdn] is a generic inline container for
/// phrasing content, which does not inherently represent anything. It
/// can be used to group elements for styling purposes (using the
/// [`class`][class] or [`id`][id] attributes), or because they share
/// attribute values, such as [`lang`][lang].
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span
/// [class]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#attr-class
/// [id]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#attr-id
/// [lang]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#attr-lang
span = {
dom_type: web_sys::HtmlSpanElement;
}
);
parent_element!(span);
shadow_parent_element!(span);
html_element!(
/// The [HTML Strong Importance Element (`<strong>`)][mdn] indicates that
/// its contents have strong importance, seriousness, or urgency.
/// Browsers typically render the contents in bold type.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong
strong = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(strong);
html_element!(
/// The [HTML Subscript element (`<sub>`)][mdn] specifies inline text which
/// should be displayed as subscript for solely typographical reasons.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub
sub = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(sub);
html_element!(
/// The [HTML Superscript element (`<sup>`)][mdn] specifies inline text
/// which is to be displayed as superscript for solely typographical
/// reasons.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup
sup = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(sup);
html_element!(
/// The [HTML `<time>` element][mdn] represents a specific period in time.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time
time = {
dom_type: web_sys::HtmlTimeElement;
attributes {
/// This attribute indicates the time and/or date of the element and
/// must be in one of the formats described below.
datetime: String,
};
}
);
parent_element!(time);
html_element!(
/// The [HTML Unarticulated Annotation Element (`<u>`)][mdn] represents a
/// span of inline text which should be rendered in a way that indicates
/// that it has a non-textual annotation.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/u
u = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(u);
html_element!(
/// The [HTML Variable element (`<var>`)][mdn] represents the name of a
/// variable in a mathematical expression or a programming context.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/var
var = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(var);
html_element!(
/// The [HTML `<wbr>` element][mdn] represents a word break opportunity—a
/// position within text where the browser may optionally break a line,
/// though its line-breaking rules would not otherwise create a break at
/// that location.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr
wbr = {
dom_type: web_sys::HtmlElement;
}
);
html_element!(
/// The [HTML `<del>` element][mdn] represents a range of text that has been
/// deleted from a document.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/del
del = {
dom_type: web_sys::HtmlModElement;
attributes {
/// A URI for a resource that explains the change (for example,
/// meeting minutes).
cite: String,
/// This attribute indicates the time and date of the change and
/// must be a valid date string with an optional time.
/// If the value cannot be parsed as a date with an
/// optional time string, the element does not have an
/// associated time stamp. For the format of the string
/// without a time, see Date strings. The format of
/// the string if it includes both date and time is covered in
/// Local date and time strings.
datetime: String,
};
}
);
parent_element!(del);
html_element!(
/// The [HTML `<ins>` element][mdn] represents a range of text that has been
/// added to a document.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ins
ins = {
dom_type: web_sys::HtmlModElement;
attributes {
/// A URI for a resource that explains the change (for example,
/// meeting minutes).
cite: String,
/// This attribute indicates the time and date of the change and
/// must be a valid date string with an optional time.
/// If the value cannot be parsed as a date with an
/// optional time string, the element does not have an
/// associated time stamp. For the format of the string
/// without a time, see Date strings. The format of
/// the string if it includes both date and time is covered in
/// Local date and time strings.
datetime: String,
};
}
);
parent_element!(ins);
html_element!(
/// The [HTML `<address>` element][mdn] indicates that the enclosed HTML
/// provides contact information for a person or people, or for an
/// organization.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/address
address = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(address);
html_element!(
/// The [HTML `<article>` element][mdn] represents a self-contained
/// composition in a document, page, application, or site, which is
/// intended to be independently distributable or reusable
/// (e.g., in syndication).
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article
article = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(article);
shadow_parent_element!(article);
html_element!(
/// The [HTML `<aside>` element][mdn] represents a portion of a document
/// whose content is only indirectly related to the document's main
/// content.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/aside
aside = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(aside);
shadow_parent_element!(aside);
html_element!(
/// The [HTML `<footer>` element][mdn] represents a footer for its nearest
/// [sectioning content] or [sectioning root] element. A footer
/// typically contains information about the author of the section,
/// copyright data or links to related documents.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/footer
/// [sectioning content]: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Sectioning_content
/// [sectioning root]: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Sections_and_Outlines_of_an_HTML5_document#Sectioning_roots
footer = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(footer);
shadow_parent_element!(footer);
html_element!(
/// The [HTML `<header>` element][mdn] represents introductory content,
/// typically a group of introductory or navigational aids. It may
/// contain some heading elements but also a logo, a search form, an
/// author name, and other elements.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header
header = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(header);
shadow_parent_element!(header);
html_element!(
/// The [HTML `<h1>`–`<h6>` elements][mdn] represent six levels of section
/// headings. `<h1>` is the highest section level and `<h6>` is the
/// lowest.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h1
h1 = {
dom_type: web_sys::HtmlHeadingElement;
}
);
parent_element!(h1);
shadow_parent_element!(h1);
html_element!(
/// The [HTML `<h1>`–`<h6>` elements][mdn] represent six levels of section
/// headings. `<h1>` is the highest section level and `<h6>` is the
/// lowest.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h2
h2 = {
dom_type: web_sys::HtmlHeadingElement;
}
);
parent_element!(h2);
shadow_parent_element!(h2);
html_element!(
/// The [HTML `<h1>`–`<h6>` elements][mdn] represent six levels of section
/// headings. `<h1>` is the highest section level and `<h6>` is the
/// lowest.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h3
h3 = {
dom_type: web_sys::HtmlHeadingElement;
}
);
parent_element!(h3);
shadow_parent_element!(h3);
html_element!(
/// The [HTML `<h1>`–`<h6>` elements][mdn] represent six levels of section
/// headings. `<h1>` is the highest section level and `<h6>` is the
/// lowest.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h4
h4 = {
dom_type: web_sys::HtmlHeadingElement;
}
);
parent_element!(h4);
shadow_parent_element!(h4);
html_element!(
/// The [HTML `<h1>`–`<h6>` elements][mdn] represent six levels of section
/// headings. `<h1>` is the highest section level and `<h6>` is the
/// lowest.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h5
h5 = {
dom_type: web_sys::HtmlHeadingElement;
}
);
parent_element!(h5);
shadow_parent_element!(h5);
html_element!(
/// The [HTML `<h1>`–`<h6>` elements][mdn] represent six levels of section
/// headings. `<h1>` is the highest section level and `<h6>` is the
/// lowest.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/h6
h6 = {
dom_type: web_sys::HtmlHeadingElement;
}
);
parent_element!(h6);
shadow_parent_element!(h6);
html_element!(
/// The [HTML `<hgroup>` element][mdn] represents a multi-level heading for
/// a section of a document. It groups a set of [`<h1>–<h6>`][heading]
/// elements.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hgroup
/// [heading]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements
hgroup = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(hgroup);
html_element!(
/// The [HTML `<main>` element][mdn] represents the dominant content of the
/// [`<body>`][body] of a document. The main content area consists of
/// content that is directly related to or expands upon the central
/// topic of a document, or the central functionality of an application.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main
/// [body]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
main = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(main);
shadow_parent_element!(main);
html_element!(
/// The [HTML `<nav>` element][mdn] represents a section of a page whose
/// purpose is to provide navigation links, either within the current
/// document or to other documents. Common examples of navigation
/// sections are menus, tables of contents, and indexes.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav
nav = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(nav);
shadow_parent_element!(nav);
html_element!(
/// The [HTML `<section>` element][mdn] represents a standalone section —
/// which doesn't have a more specific semantic element to represent it
/// — contained within an HTML document.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/section
section = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(section);
shadow_parent_element!(section);
html_element!(
/// The [HTML `<embed>` element][mdn] embeds external content at the
/// specified point in the document. This content is provided by an
/// external application or other source of interactive content such as
/// a browser plug-in.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/embed
embed = {
dom_type: web_sys::HtmlEmbedElement;
attributes {
/// The displayed height of the resource, in [CSS pixels]. This must
/// be an absolute value; percentages are not allowed.
///
/// [CSS pixels]: https://drafts.csswg.org/css-values/#px
height: String,
/// The URL of the resource being embedded.
src: String,
/// The [MIME type] to use to select the plug-in to instantiate.
///
/// [MIME type]: https://developer.mozilla.org/en-US/docs/Glossary/MIME_type
r#type: String,
/// The displayed width of the resource, in [CSS pixels]. This must
/// be an absolute value; percentages are not allowed.
///
/// [CSS pixels]: https://drafts.csswg.org/css-values/#px
width: String,
};
}
);
html_element!(
/// The [HTML Inline Frame element (`<iframe>`)][mdn] represents a nested
/// [browsing context], embedding another HTML page into the current
/// one.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
/// [browsing context]: https://developer.mozilla.org/en-US/docs/Glossary/browsing_context
iframe = {
dom_type: web_sys::HtmlIFrameElement;
attributes {
/// Specifies a feature policy for the `<iframe>`.
allow: String,
/// The height of the frame in CSS pixels. Default is 150.
height: String,
/// A targetable name for the embedded browsing context. This can be
/// used in the target attribute of the `<a>`, `<form>`, or
/// `<base>` elements; the formtarget attribute of the `<input>`
/// or `<button>` elements; or the windowName parameter in the
/// window.open() method.
name: String,
/// Indicates which referrer to send when fetching the frame's
/// resource.
referrerpolicy: String,
/// Applies extra restrictions to the content in the frame. The
/// value of the attribute can either be empty to apply
/// all restrictions, or space-separated tokens to lift
/// particular restrictions:
///
/// * allow-downloads-without-user-activation: Allows for downloads
/// to occur without a
/// gesture from the user.
/// * allow-forms: Allows the resource to submit forms. If this
/// keyword is not used, form
/// submission is blocked.
/// * allow-modals: Lets the resource open modal windows.
/// * allow-orientation-lock: Lets the resource lock the screen
/// orientation.
/// * allow-pointer-lock: Lets the resource use the Pointer Lock
/// API.
/// * allow-popups: Allows popups (such as window.open(),
/// target="_blank", or
/// showModalDialog()). If this keyword is not used, the popup will
/// silently fail to open.
/// * allow-popups-to-escape-sandbox: Lets the sandboxed document
/// open new windows without
/// those windows inheriting the sandboxing. For example, this can
/// safely sandbox an advertisement without forcing the same
/// restrictions upon the page the ad links to.
/// * allow-presentation: Lets the resource start a presentation
/// session.
/// * allow-same-origin: If this token is not used, the resource is
/// treated as being from a
/// special origin that always fails the same-origin policy.
/// * allow-scripts: Lets the resource run scripts (but not create
/// popup windows).
/// * allow-storage-access-by-user-activation : Lets the resource
/// request access to the
/// parent's storage capabilities with the Storage Access API.
/// * allow-top-navigation: Lets the resource navigate the top-level
/// browsing context (the
/// one named _top).
/// * allow-top-navigation-by-user-activation: Lets the resource
/// navigate the top-level
/// browsing context, but only if initiated by a user gesture.
///
/// Notes about sandboxing:
///
/// When the embedded document has the same origin as the embedding
/// page, it is strongly discouraged to use both allow-scripts
/// and allow-same-origin, as that lets the embedded
/// document remove the sandbox attribute — making it no more secure
/// than not using the sandbox attribute at all.
///
/// Sandboxing is useless if the attacker can display content
/// outside a sandboxed iframe — such as if the viewer
/// opens the frame in a new tab. Such content should be
/// also served from a separate origin to limit
/// potential damage.
sandbox: String,
/// The URL of the page to embed. Use a value of about:blank to
/// embed an empty page that conforms to the same-origin
/// policy. Also note that programatically removing an
/// `<iframe>`'s src attribute (e.g. via
/// Element.removeAttribute()) causes about:blank to
/// be loaded in the frame in Firefox (from version 65),
/// Chromium-based browsers, and Safari/iOS.
src: String,
/// Inline HTML to embed, overriding the src attribute. If a browser
/// does not support the srcdoc attribute, it will fall back to
/// the URL in the src attribute.
srcdoc: String,
/// The width of the frame in CSS pixels. Default is 300.
width: String,
};
}
);
parent_element!(iframe);
html_element!(
/// The [HTML `<object>` element][mdn] represents an external resource,
/// which can be treated as an image, a nested browsing context, or a
/// resource to be handled by a plugin.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object
object = {
dom_type: web_sys::HtmlObjectElement;
attributes {
/// Specifies the URL of the resource.
data: String,
/// The form element, if any, that the object element is associated
/// with (its form owner). The value of the attribute
/// must be an ID of a `<form>` element in the same
/// document.
form: String,
/// The height of the displayed resource, in CSS pixels. No
/// percentages.
height: String,
/// The name of valid browsing context.
name: String,
/// The content type of the resource specified by data. At least one
/// of data and type must be defined.
r#type: String,
/// Indicates if the type attribute and the actual content type of
/// the resource must match to be used.
typemustmatch: bool,
/// A hash-name reference to a `<map>` element; that is a '#'
/// followed by the value of a name of a map element.
usemap: String,
/// The width of the display resource, in CSS pixels. No
/// percentages.
width: String,
};
}
);
parent_element!(object);
html_element!(
/// The [HTML `<param>` element][param] defines parameters for an
/// [`<object>`][object] element.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/param
/// [object]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object
param = {
dom_type: web_sys::HtmlParamElement;
attributes {
/// Name of the parameter.
name: String,
/// Specifies the value of the parameter.
value: String,
};
}
);
html_element!(
/// The [HTML `<picture>` element][mdn] contains zero or more
/// [`<source>`][source] elements and one [`<img>`][img] element to
/// provide versions of an image for different display/device scenarios.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture
/// [source]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source
/// [img]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
picture = {
dom_type: web_sys::HtmlPictureElement;
}
);
parent_element!(picture);
html_element!(
/// The [HTML `<source>` element][source] specifies multiple media resources
/// for the [`<picture>`][picture], the [`<audio>`][audio] element, or
/// the [`<video>`][video] element.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source
/// [picture]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture
/// [audio]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio
/// [video]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video
source = {
dom_type: web_sys::HtmlSourceElement;
attributes {
/// Media query of the resource's intended media; this should be
/// used only in a `<picture>` element.
media: String,
/// Is a list of source sizes that describes the final rendered
/// width of the image represented by the source. Each
/// source size consists of a comma-separated list of
/// media condition-length pairs. This information is
/// used by the browser to determine, before laying the
/// page out, which image defined in srcset to use. Please
/// note that sizes will have its effect only if width dimension
/// descriptors are provided with srcset instead of pixel ratio
/// values (200w instead of 2x for example).
///
/// The sizes attribute has an effect only when the `<source>`
/// element is the direct child of a `<picture>`
/// element.
sizes: String,
/// Required for `<audio>` and `<video>`, address of the media
/// resource. The value of this attribute is ignored
/// when the `<source>` element is placed inside a
/// `<picture>` element.
src: String,
/// A list of one or more strings separated by commas indicating a
/// set of possible images represented by the source for
/// the browser to use. Each string is composed of:
///
/// 1. One URL specifying an image.
/// 2. A width descriptor, which consists of a string containing a
/// positive integer directly followed by "w", such as 300w. The
/// default value, if missing, is the infinity. 3. A pixel
/// density descriptor, that is a positive floating number directly
/// followed by "x". The default value, if missing, is 1x.
///
/// Each string in the list must have at least a width descriptor or
/// a pixel density descriptor to be valid. Among the
/// list, there must be only one string containing the
/// same tuple of width descriptor and pixel density
/// descriptor. The browser chooses the most adequate
/// image to display at a given point of time.
///
/// The srcset attribute has an effect only when the `<source>`
/// element is the direct child of a `<picture>`
/// element.
srcset: String,
/// The MIME media type of the resource, optionally with a codecs
/// parameter.
r#type: String,
};
}
);
html_element!(
/// Use the [HTML `<canvas>` element][mdn] with either the [canvas scripting
/// API][api] or the [WebGL API][gl] to draw graphics and animations.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas
/// [api]: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API
/// [gl]: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API
canvas = {
dom_type: web_sys::HtmlCanvasElement;
attributes {
/// The height of the coordinate space in CSS pixels. Defaults to
/// 150.
height: String,
/// The width of the coordinate space in CSS pixels. Defaults to
/// 300.
width: String,
};
events {
webglcontextcreationerror: web_sys::WebGlContextEvent,
webglcontextlost: web_sys::WebGlContextEvent,
webglcontextrestored: web_sys::WebGlContextEvent,
};
}
);
parent_element!(canvas);
html_element!(
/// The [HTML `<noscript>` element][mdn] defines a section of HTML to be
/// inserted if a script type on the page is unsupported or if scripting
/// is currently turned off in the browser.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
noscript = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(noscript);
html_element!(
/// The [HTML `<script>` element][mdn] is used to embed or reference
/// executable code; this is typically used to embed or refer to
/// JavaScript code.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
script = {
dom_type: web_sys::HtmlScriptElement;
attributes {
/// For classic scripts, if the async attribute is present, then the
/// classic script will be fetched in parallel to parsing and
/// evaluated as soon as it is available.
///
/// For module scripts, if the async attribute is present then the
/// scripts and all their dependencies will be executed in the
/// defer queue, therefore they will get fetched in parallel to
/// parsing and evaluated as soon as they are available.
///
/// This attribute allows the elimination of parser-blocking
/// JavaScript where the browser would have to load and
/// evaluate scripts before continuing to parse. defer
/// has a similar effect in this case.
r#async: bool,
/// Normal script elements pass minimal information to the
/// window.onerror for scripts which do not pass the standard
/// CORS checks. To allow error logging for sites which use a
/// separate domain for static media, use this attribute.
crossorigin: String,
/// Indicates to a browser that the script is meant to be executed
/// after the document has been parsed, but before
/// firing DOMContentLoaded.
///
/// Scripts with the defer attribute will prevent the
/// DOMContentLoaded event from firing until the script
/// has loaded and finished evaluating.
///
/// This attribute must not be used if the src attribute is absent
/// (i.e. for inline scripts), in this case it would
/// have no effect.
///
/// The defer attribute has no effect on module scripts — they defer
/// by default.
///
/// Scripts with the defer attribute will execute in the order in
/// which they appear in the document.
///
/// This attribute allows the elimination of parser-blocking
/// JavaScript where the browser would have to load and
/// evaluate scripts before continuing to parse. async
/// has a similar effect in this case.
defer: bool,
/// This attribute contains inline metadata that a user agent can
/// use to verify that a fetched resource has been
/// delivered free of unexpected manipulation.
integrity: String,
/// Indicates that the script should not be executed in browsers
/// that support ES2015 modules — in effect, this can be
/// used to serve fallback scripts to older browsers
/// that do not support modular JavaScript code.
nomodule: bool,
/// A cryptographic nonce (number used once) to whitelist scripts in
/// a script-src Content-Security-Policy. The server
/// must generate a unique nonce value each time it
/// transmits a policy. It is critical to provide a
/// nonce that cannot be guessed as bypassing a
/// resource's policy is otherwise trivial.
nonce: String,
/// Indicates which referrer to send when fetching the script, or
/// resources fetched by the script.
referrerpolicy: String,
/// This attribute specifies the URI of an external script; this can
/// be used as an alternative to embedding a script
/// directly within a document.
src: String,
/// This attribute indicates the type of script represented. The
/// value of this attribute will be in one of the
/// following categories:
///
/// * Omitted or a JavaScript MIME type: This indicates the script
/// is JavaScript. The HTML5
/// specification urges authors to omit the attribute rather than
/// provide a redundant MIME type.
/// * `module`: Causes the code to be treated as a JavaScript
/// module. The processing of the
/// script contents is not affected by the charset and defer
/// attributes. Unlike classic scripts, module scripts
/// require the use of the CORS protocol for
/// cross-origin fetching.
/// * Any other value: The embedded content is treated as a data
/// block which won't be
/// processed by the browser. Developers must use a valid MIME type
/// that is not a JavaScript MIME type to denote data
/// blocks. The src attribute will be ignored.
r#type: String,
};
}
);
parent_element!(script);
html_element!(
/// The [HTML `<area>` element][mdn] defines a hot-spot region on an image,
/// and optionally associates it with a [hypertext link]. This element
/// is used only within a [`<map>`][map] element.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/area
/// [hypertext link]: https://developer.mozilla.org/en-US/docs/Glossary/Hyperlink
/// [map]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/map
area = {
dom_type: web_sys::HtmlAreaElement;
attributes {
/// A text string alternative to display on browsers that do not
/// display images. The text should be phrased so that
/// it presents the user with the same kind of choice as
/// the image would offer when displayed without the
/// alternative text. This attribute is required only if
/// the href attribute is used.
alt: String,
/// A set of values specifying the coordinates of the hot-spot
/// region. The number and meaning of the values depend
/// upon the value specified for the shape attribute.
///
/// * rect or rectangle: the coords value is two x,y pairs: left,
/// top, right, bottom.
/// * circle: the value is x,y,r where x,y is a pair specifying the
/// center of the circle and
/// r is a value for the radius.
/// * poly or polygon: the value is a set of x,y pairs for each
/// point in the polygon:
/// x1,y1,x2,y2,x3,y3, and so on.
///
/// The values are numbers of CSS pixels.
coords: String,
/// This attribute, if present, indicates that the author intends
/// the hyperlink to be used for downloading a resource.
/// See `<a>` for a full description of the download
/// attribute.
download: bool,
/// The hyperlink target for the area. Its value is a valid URL.
/// This attribute may be omitted; if so, the area
/// element does not represent a hyperlink.
href: String,
/// Indicates the language of the linked resource. Allowed values
/// are determined by BCP47. Use this attribute only if
/// the href attribute is present.
hreflang: String,
/// Contains a space-separated list of URLs to which, when the
/// hyperlink is followed, POST requests with the body
/// PING will be sent by the browser (in the
/// background). Typically used for tracking.
ping: String,
/// For anchors containing the href attribute, this attribute
/// specifies the relationship of the target object to
/// the link object. The value is a space-separated list
/// of link types values. The values and their semantics
/// will be registered by some authority that might have
/// meaning to the document author. The default
/// relationship, if no other is given, is void. Use
/// this attribute only if the href attribute is present.
rel: String,
/// This attribute specifies where to display the linked resource.
/// It is a name of, or keyword for, a browsing context
/// (for example, tab, window, or inline frame). The
/// following keywords have special meanings:
///
/// * _self: Load the response into the same browsing context as the
/// current one. This value
/// is the default if the attribute is not specified.
/// * _blank: Load the response into a new unnamed browsing context.
/// * _parent: Load the response into the parent browsing context of
/// the current one. If
/// there is no parent, this option behaves the same way as _self.
/// * _top: Load the response into the top-level browsing context
/// (that is, the browsing
/// context that is an ancestor of the current one, and has no
/// parent). If there is no parent, this option behaves
/// the same way as _self.
///
/// Use this attribute only if the `href` attribute is present.
target: String,
};
}
);
html_element!(
/// The [HTML `<audio>` element][mdn] is used to embed sound content in
/// documents. It may contain one or more audio sources, represented
/// using the `src` attribute or the [`<source>`][source] element: the
/// browser will choose the most suitable one. It can also be
/// the destination for streamed media, using a [`MediaStream`][stream].
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio
/// [source]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source
/// [stream]: https://developer.mozilla.org/en-US/docs/Web/API/MediaStream
audio = { dom_type: web_sys::HtmlAudioElement;
attributes {
/// If specified, the audio will automatically begin playback as soon as
/// it can do so, without waiting for the entire audio file to
/// finish downloading.
///
/// Note: Sites that automatically play audio (or videos with an audio
/// track) can be an unpleasant experience for users, so should
/// be avoided when possible. If you must offer
/// autoplay functionality, you should make it opt-in (requiring a user
/// to specifically enable it). However, this can be useful when
/// creating media elements whose source will be set at a later
/// time, under user control. See our autoplay guide for additional
/// information about how to properly use autoplay.
autoplay: bool,
/// If this attribute is present, the browser will offer controls to
/// allow the user to control audio playback, including volume,
/// seeking, and pause/resume playback.
controls: bool,
/// This enumerated attribute indicates whether to use CORS to fetch the
/// related audio file. CORS-enabled resources can be reused in
/// the `<canvas>` element without being tainted.
///
/// When not present, the resource is fetched without a CORS request
/// (i.e. without sending the Origin: HTTP header), preventing
/// its non-tainted used in `<canvas>` elements. If invalid, it
/// is handled as if the enumerated keyword anonymous was used.
///
/// The allowed values are:
///
/// # `anonymous`
///
/// Sends a cross-origin request without a credential. In other words,
/// it sends the `Origin: HTTP` header without a cookie, X.509
/// certificate, or performing HTTP Basic authentication. If the
/// server does not give credentials to the origin site (by not
/// setting the `Access-Control-Allow-Origin: HTTP` header), the image
/// will be tainted, and its usage restricted.
///
/// # `use-credentials`
///
/// Sends a cross-origin request with a credential. In other words, it
/// sends the `Origin: HTTP` header with a cookie, a
/// certificate, or performing HTTP Basic authentication. If the
/// server does not give credentials to the origin site (through
/// `Access-Control-Allow-Credentials: HTTP` header), the image will be
/// tainted and its usage restricted.
crossorigin: String,
/// Reading currentTime returns a double-precision floating-point value
/// indicating the current playback position, in seconds, of the
/// audio. If the audio's metadata isn't available yet—thereby
/// preventing you from knowing the media's start time or
/// duration—currentTime instead indicates, and can be used to change,
/// the time at which playback will begin. Otherwise, setting
/// currentTime sets the current playback position to the given
/// time and seeks the media to that position if the media is currently
/// loaded.
///
/// If the audio is being streamed, it's possible that the user agent
/// may not be able to obtain some parts of the resource if that
/// data has expired from the media buffer. Other audio may have
/// a media timeline that doesn't start at 0 seconds, so setting
/// currentTime to a time before that would fail. For example,
/// if the audio's media timeline starts at 12 hours, setting
/// currentTime to 3600 would be an attempt to set the current playback
/// position well before the beginning of the media, and would fail. The
/// getStartDate() method can be used to determine the beginning
/// point of the media timeline's reference frame.
current_time("currentTime"): String,
/// If specified, the audio player will automatically seek back to the
/// start upon reaching the end of the audio.
r#loop: bool,
/// Indicates whether the audio will be initially silenced. Its default
/// value is false.
muted: bool,
/// This enumerated attribute is intended to provide a hint to the
/// browser about what the author thinks will lead to the best
/// user experience. It may have one of the following values:
///
/// * `none`: Indicates that the audio should not be preloaded.
/// * `metadata`: Indicates that only audio metadata (e.g. length) is
/// fetched.
/// * `auto`: Indicates that the whole audio file can be downloaded,
/// even if the user is not
/// expected to use it.
/// * empty string: A synonym of the auto value.
///
/// The default value is different for each browser. The spec advises it
/// to be set to metadata.
///
/// Usage notes:
///
/// The autoplay attribute has precedence over preload. If autoplay is
/// specified, the browser would obviously need to start
/// downloading the audio for playback.
///
/// The browser is not forced by the specification to follow the value
/// of this attribute; it is a mere hint.
preload: String,
/// The URL of the audio to embed. This is subject to HTTP access
/// controls. This is optional; you may instead use the
/// `<source>` element within the audio block to specify
/// the audio to embed.
src: String,
};
}
);
parent_element!(audio);
html_element!(
/// The [HTML `<img>` element][mdn] embeds an image into the document.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
img = {
dom_type: web_sys::HtmlImageElement;
attributes {
/// Defines an alternative text description of the image.
///
/// > Note: Browsers do not always display images. For example:
/// >
/// > * Non-visual browsers (such as those used by people with visual
/// impairments) > * The user chooses not to display images
/// (saving bandwidth, privacy reasons) > * The image is invalid
/// or an unsupported type > * In these cases, the browser may
/// replace the image with the text in the element's alt
/// attribute. For these reasons and others, provide a useful value for
/// alt whenever possible.
///
/// Omitting alt altogether indicates that the image is a key part of
/// the content and no textual equivalent is available. Setting
/// this attribute to an empty string (alt="") indicates that
/// this image is not a key part of the content (it’s decoration or a
/// tracking pixel), and that non-visual browsers may omit it from
/// rendering. Visual browsers will also hide the broken image
/// icon if the alt is empty and the image failed to display.
///
/// This attribute is also used when copying and pasting the image to
/// text, or saving a linked image to a bookmark.
alt: String,
/// Indicates if the fetching of the image must be done using a CORS
/// request. Image data from a CORS-enabled image returned from
/// a CORS request can be reused in the `<canvas>`
/// element without being marked "tainted".
///
/// If the crossorigin attribute is not specified, then a non-CORS
/// request is sent (without the Origin request header), and the
/// browser marks the image as tainted and restricts
/// access to its image data, preventing its usage in `<canvas>`
/// elements.
///
/// If the crossorigin attribute is specified, then a CORS request is
/// sent (with the Origin request header); but if the server
/// does not opt into allowing cross-origin access to the
/// image data by the origin site (by not sending any
/// Access-Control-Allow-Origin response header, or by not
/// including the site's origin in any Access-Control-Allow-Origin
/// response header it does send), then the browser marks the image as
/// tainted and restricts access to its image data, preventing
/// its usage in `<canvas>` elements.
///
/// Allowed values:
///
/// * `anonymous`: A CORS request is sent with credentials omitted (that
/// is, no cookies,
/// X.509 certificates, or Authorization request header).
/// * `use-credentials`: The CORS request is sent with any credentials
/// included (that is,
/// cookies, X.509 certificates, and the `Authorization` request
/// header). If the server does not opt into sharing credentials
/// with the origin site (by sending back the
/// `Access-Control-Allow-Credentials: true` response header), then the
/// browser marks the image as tainted and restricts access to
/// its image data.
///
/// If the attribute has an invalid value, browsers handle it as if the
/// anonymous value was used.
crossorigin: String,
/// Provides an image decoding hint to the browser. Allowed values:
///
/// * `sync`: Decode the image synchronously, for atomic presentation
/// with other content.
/// * `async`: Decode the image asynchronously, to reduce delay in
/// presenting other content.
/// * `auto`: Default: no preference for the decoding mode. The browser
/// decides what is best
/// for the user.
decoding: String,
/// The intrinsic height of the image, in pixels. Must be an integer
/// without a unit.
height: String,
/// Indicates that the image is part of a server-side map. If so, the
/// coordinates where the user clicked on the image are sent to
/// the server.
///
/// Note: This attribute is allowed only if the `<img>` element is a
/// descendant of an `<a>` element with a valid href attribute.
/// This gives users without pointing devices a
/// fallback destination.
ismap: bool,
/// Indicates how the browser should load the image:
///
/// * `eager`: Loads the image immediately, regardless of whether or not
/// the image is
/// currently within the visible viewport (this is the default value).
/// * `lazy`: Defers loading the image until it reaches a calculated
/// distance from the
/// viewport, as defined by the browser. The intent is to avoid the
/// network and storage bandwidth needed to handle the image
/// until it's reasonably certain that it will be needed. This
/// generally improves the performance of the content in most typical
/// use cases.
///
/// > Note: Loading is only deferred when JavaScript is enabled. This is
/// an anti-tracking measure, because if a user agent supported
/// lazy loading when scripting is disabled, it would still be
/// possible for a site to track a user's approximate scroll position
/// throughout a session, by strategically placing images in a page's
/// markup such that a server can track how many images are
/// requested and when.
loading: String,
/// One or more strings separated by commas, indicating a set of source
/// sizes. Each source size consists of:
///
/// * A media condition. This must be omitted for the last item in the
/// list.
/// * A source size value.
///
/// Media Conditions describe properties of the viewport, not of the
/// image. For example, (max-height: 500px) 1000px proposes to
/// use a source of 1000px width, if the viewport is not higher
/// than 500px.
///
/// Source size values specify the intended display size of the image.
/// User agents use the current source size to select one of the
/// sources supplied by the srcset attribute, when those sources
/// are described using width (w) descriptors. The selected source size
/// affects the intrinsic size of the image (the image’s display size if
/// no CSS styling is applied). If the srcset attribute is
/// absent, or contains no values with a width descriptor, then
/// the sizes attribute has no effect.
sizes: String,
/// The image URL. Mandatory for the `<img>` element. On browsers
/// supporting srcset, src is treated like a candidate image
/// with a pixel density descriptor 1x, unless an image with
/// this pixel density descriptor is already defined in srcset, or
/// unless srcset contains w descriptors.
src: String,
/// One or more strings separated by commas, indicating possible image
/// sources for the user agent to use. Each string is composed
/// of:
///
/// * A URL to an image
/// * Optionally, whitespace followed by one of:
/// * A width descriptor (a positive integer directly followed by w).
/// The width descriptor
/// is divided by the source size given in the sizes attribute to
/// calculate the effective pixel density.
/// * A pixel density descriptor (a positive floating point number
/// directly followed by
/// x).
/// * If no descriptor is specified, the source is assigned the default
/// descriptor of 1x.
///
/// It is incorrect to mix width descriptors and pixel density
/// descriptors in the same srcset attribute. Duplicate
/// descriptors (for instance, two sources in the same srcset
/// which are both described with 2x) are also invalid.
///
/// The user agent selects any of the available sources at its
/// discretion. This provides them with significant leeway to
/// tailor their selection based on things like user preferences
/// or bandwidth conditions. See our Responsive images tutorial for an
/// example.
srcset: String,
/// The intrinsic width of the image in pixels. Must be an integer
/// without a unit.
width: String,
/// The partial URL (starting with #) of an image map associated with
/// the element.
///
/// Note: You cannot use this attribute if the `<img>` element is inside
/// an `<a>` or `<button>` element.
usemap: String,
};
}
);
html_element!(
/// The [HTML `<map>` element][mdn] is used with [`<area>`][area] elements
/// to define an image map (a clickable link area).
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/map
/// [area]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/area
map = {
dom_type: web_sys::HtmlMapElement;
attributes {
/// The name attribute gives the map a name so that it can be
/// referenced. The attribute must be present and must have a
/// non-empty value with no space characters. The value of the
/// name attribute must not be a compatibility-caseless match for
/// the value of the name attribute of another `<map>`
/// element in the same document. If the id attribute is
/// also specified, both attributes must have the same
/// value.
name: String,
};
}
);
parent_element!(map);
html_element!(
/// The [HTML `<track>` element][mdn] is used as a child of the media
/// elements [`<audio>`][audio] and [`<video>`][video]. It lets you
/// specify timed text tracks (or time-based data), for example to
/// automatically handle subtitles. The tracks are formatted in
/// [WebVTT format][vtt] (`.vtt` files) — Web Video Text Tracks or [Timed
/// Text Markup Language (TTML)][ttml].
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track
/// [audio]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio
/// [video]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video
/// [vtt]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Video_Text_Tracks_Format
/// [ttml]: https://w3c.github.io/ttml2/index.html
track = {
dom_type: web_sys::HtmlTrackElement;
attributes {
/// This attribute indicates that the track should be enabled unless
/// the user's preferences indicate that another track
/// is more appropriate. This may only be used on one
/// track element per media element.
default: bool,
/// How the text track is meant to be used. If omitted the default
/// kind is subtitles. If the attribute is not present,
/// it will use the subtitles. If the attribute contains
/// an invalid value, it will use metadata. The
/// following keywords are allowed: Subtitles provide
/// translation of content that cannot be understood
/// by the viewer. For example dialogue or text that is not
/// English in an English language film.
///
/// Subtitles may contain additional content, usually extra
/// background information. For example the text at the
/// beginning of the Star Wars films, or the date, time,
/// and location of a scene.
subtitles: String,
/// Closed captions provide a transcription and possibly a
/// translation of audio.
///
/// It may include important non-verbal information such as music
/// cues or sound effects. It may indicate the cue's
/// source (e.g. music, text, character).
///
/// Suitable for users who are deaf or when the sound is muted.
captions: String,
/// Textual description of the video content.
///
/// * `descriptions`: Suitable for users who are blind or where the
/// video cannot be seen.
/// * `chapters`: Chapter titles are intended to be used when the
/// user is navigating the
/// media resource.
/// * `metadata`: Tracks used by scripts. Not visible to the user.
/// * `label`: A user-readable title of the text track which is used
/// by the browser when
/// listing available text tracks.
kind: String,
/// Address of the track (.vtt file). Must be a valid URL. This
/// attribute must be specified and its URL value must have the
/// same origin as the document — unless the `<audio>` or
/// `<video>` parent element of the track element has a crossorigin
/// attribute.
src: String,
/// Language of the track text data. It must be a valid BCP 47
/// language tag. If the kind attribute is set to
/// subtitles, then srclang must be defined.
srclang: String,
};
events {
cuechange: web_sys::Event,
};
}
);
html_element!(
/// The [HTML Video element (`<video>`)][mdn] embeds a media player which
/// supports video playback into the document.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video
video = { dom_type: web_sys::HtmlVideoElement;
attributes {
/// If specified, the video automatically begins to play back as soon as
/// it can do so without stopping to finish loading the data.
///
/// Note: Sites that automatically play audio (or videos with an audio
/// track) can be an unpleasant experience for users, so should
/// be avoided when possible. If you must offer
/// autoplay functionality, you should make it opt-in (requiring a user
/// to specifically enable it). However, this can be useful when
/// creating media elements whose source will be set at a later
/// time, under user control. See our autoplay guide for additional
/// information about how to properly use autoplay.
///
/// To disable video autoplay, autoplay="false" will not work; the video
/// will autoplay if the attribute is there in the `<video>` tag
/// at all. To remove autoplay, the attribute needs to be
/// removed altogether.
autoplay: bool,
/// An attribute you can read to determine the time ranges of the
/// buffered media. This attribute contains a TimeRanges object.
buffered: String,
/// If this attribute is present, the browser will offer controls to
/// allow the user to control video playback, including volume,
/// seeking, and pause/resume playback.
controls: bool,
/// This enumerated attribute indicates whether to use CORS to fetch the
/// related image. CORS-enabled resources can be reused in the
/// `<canvas>` element without being tainted. The allowed values
/// are:
///
/// * `anonymous`: Sends a cross-origin request without a credential. In
/// other words, it
/// sends the `Origin: HTTP` header without a cookie, X.509 certificate,
/// or performing HTTP Basic authentication. If the server does
/// not give credentials to the origin site (by not setting the
/// `Access-Control-Allow-Origin: HTTP` header), the image will be
/// tainted, and its usage restricted.
/// * `use-credentials`: Sends a cross-origin request with a credential.
/// In other words, it
/// sends the Origin: HTTP header with a cookie, a certificate, or
/// performing HTTP Basic authentication. If the server does not
/// give credentials to the origin site (through
/// `Access-Control-Allow-Credentials: HTTP` header), the image will be
/// tainted and its usage restricted.
///
/// When not present, the resource is fetched without a CORS request
/// (i.e. without sending the `Origin: HTTP` header), preventing
/// its non-tainted used in `<canvas>` elements. If invalid, it
/// is handled as if the enumerated keyword anonymous was used.
crossorigin: String,
/// Reading currentTime returns a double-precision floating-point value
/// indicating the current playback position of the media
/// specified in seconds. If the media has not started playing
/// yet, the time offset at which it will begin is returned. Setting
/// currentTime sets the current playback position to the given time and
/// seeks the media to that position if the media is currently
/// loaded.
///
/// If the media is being streamed, it's possible that the user agent
/// may not be able to obtain some parts of the resource if that
/// data has expired from the media buffer. Other media may have
/// a media timeline that doesn't start at 0 seconds, so setting
/// currentTime to a time before that would fail. The
/// getStartDate() method can be used to determine the beginning
/// point of the media timeline's reference frame.
current_time("currentTime"): String,
/// The height of the video's display area, in CSS pixels (absolute
/// values only; no percentages.)
height: String,
/// If specified, the browser will automatically seek back to the start
/// upon reaching the end of the video.
r#loop: bool,
/// Indicates the default setting of the audio contained in the video.
/// If set, the audio will be initially silenced. Its default
/// value is false, meaning that the audio will be played when
/// the video is played.
muted: bool,
/// Indicating that the video is to be played "inline", that is within
/// the element's playback area. Note that the absence of this
/// attribute does not imply that the video will always be
/// played in fullscreen.
playsinline: bool,
/// A URL for an image to be shown while the video is downloading. If
/// this attribute isn't specified, nothing is displayed until
/// the first frame is available, then the first frame
/// is shown as the poster frame.
poster: String,
/// This enumerated attribute is intended to provide a hint to the
/// browser about what the author thinks will lead to the best
/// user experience with regards to what content is
/// loaded before the video is played. It may have one of the following
/// values:
///
/// * `none`: Indicates that the video should not be preloaded.
/// * `metadata`: Indicates that only video metadata (e.g. length) is
/// fetched.
/// * `auto`: Indicates that the whole video file can be downloaded,
/// even if the user is not
/// expected to use it.
/// * empty string: Synonym of the auto value.
///
/// The default value is different for each browser. The spec advises it
/// to be set to metadata.
///
/// > Note:
/// >
/// > The autoplay attribute has precedence over preload. If autoplay is
/// specified, the browser would obviously need to start
/// downloading the video for playback. >
/// > The specification does not force the browser to follow the value
/// of this attribute; it is a mere hint.
preload: String,
/// The URL of the video to embed. This is optional; you may instead use
/// the `<source>` element within the video block to specify the
/// video to embed.
src: String,
/// The width of the video's display area, in CSS pixels (absolute
/// values only; no percentages).
width: String,
};
events {
enterpictureinpicture: web_sys::Event,
leavepictureinpicture: web_sys::Event,
};
}
);
parent_element!(video);
html_element!(
/// The [HTML Details Element (`<details>`)][mdn] creates a disclosure
/// widget in which information is visible only when the widget is
/// toggled into an "open" state.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
details = {
dom_type: web_sys::HtmlDetailsElement;
attributes {
/// Indicates whether the details will be shown on page load.
open: bool,
};
events {
toggle: web_sys::Event,
};
}
);
parent_element!(details);
html_element!(
/// The [HTML `<dialog>` element][mdn] represents a dialog box or other
/// interactive component, such as an inspector or window.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog
dialog = {
dom_type: web_sys::HtmlDialogElement;
attributes {
/// Indicates that the dialog is active and can be interacted with.
/// When the open attribute is not set, the dialog
/// shouldn't be shown to the user.
open: bool,
};
events {
cancel: web_sys::Event,
close: web_sys::Event,
};
}
);
parent_element!(dialog);
html_element!(
/// The [HTML `<menu>` element][mdn] represents a group of commands that a
/// user can perform or activate. This includes both list menus, which
/// might appear across the top of a screen, as well as context menus,
/// such as those that might appear underneath a button after it has been
/// clicked.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menu
menu = {
dom_type: web_sys::HtmlMenuElement;
}
);
parent_element!(menu);
html_element!(
/// The [HTML Disclosure Summary element (`<summary>`)][mdn] element
/// specifies a summary, caption, or legend for a [`<details>`][details]
/// element's disclosure box.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary
/// [details]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
summary = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(summary);
html_element!(
/// The [HTML `<blockquote>` element][mdn] (or *HTML Block Quotation
/// Element*) indicates that the enclosed text is an extended quotation.
/// Usually, this is rendered visually by indentation. A URL for the
/// source of the quotation may be given using the `cite` attribute,
/// while a text representation of the source can be given using the
/// [`<cite>`][cite] element.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote
/// [cite]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/cite
blockquote = {
dom_type: web_sys::HtmlQuoteElement;
attributes {
/// A URL that designates a source document or message for the
/// information quoted. This attribute is intended to point to
/// information explaining the context or the reference
/// for the quote.
cite: String,
};
}
);
parent_element!(blockquote);
shadow_parent_element!(blockquote);
html_element!(
/// The [HTML `<dd>` element][mdn] provides the description, definition, or
/// value for the preceding term ([`<dt>`][dt]) in a description list
/// ([`<dl>`][dl]).
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dd
/// [dt]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt
/// [dl]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl
dd = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(dd);
html_element!(
/// The [HTML Content Division element (`<div>`)][mdn] is the generic
/// container for flow content. It has no effect on the content or
/// layout until styled using [CSS].
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div
/// [CSS]: https://developer.mozilla.org/en-US/docs/Glossary/CSS
div = {
dom_type: web_sys::HtmlDivElement;
}
);
parent_element!(div);
shadow_parent_element!(div);
html_element!(
/// The [HTML `<dl>` element][mdn] represents a description list. The
/// element encloses a list of groups of terms (specified using the
/// [`<dt>`][dt] element) and descriptions (provided by [`<dd>`][dd]
/// elements). Common uses for this element are to implement a glossary or
/// to display metadata (a list of key-value pairs).
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl
/// [dt]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt
/// [dd]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dd
dl = {
dom_type: web_sys::HtmlDListElement;
}
);
parent_element!(dl);
html_element!(
/// The [HTML `<dt>` element][mdn] specifies a term in a description or
/// definition list, and as such must be used inside a [`<dl>`][dl]
/// element.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt
/// [dl]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl
dt = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(dt);
html_element!(
/// The [HTML `<figcaption>` or Figure Caption element][mdn] represents a
/// caption or legend describing the rest of the contents of its parent
/// [`<figure>`][figure] element.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption
/// [figure]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure
figcaption = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(figcaption);
html_element!(
/// The [HTML `<figure>` (Figure With Optional Caption) element][mdn]
/// represents self-contained content, potentially with an optional
/// caption, which is specified using the ([`<figcaption>`][figcaption])
/// element.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure
/// [figcaption]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption
figure = {
dom_type: web_sys::HtmlElement;
}
);
parent_element!(figure);
html_element!(
/// The [HTML `<hr>` element][mdn] represents a thematic break between
/// paragraph-level elements: for example, a change of scene in a story,
/// or a shift of topic within a section.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr
hr = {
dom_type: web_sys::HtmlHrElement;
}
);
html_element!(
/// The [HTML `<li>` element][mdn] is used to represent an item in a list.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li
li = {
dom_type: web_sys::HtmlLiElement;
}
);
parent_element!(li);
html_element!(
/// The [HTML `<ol>` element][mdn] represents an ordered list of items,
/// typically rendered as a numbered list.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol
ol = {
dom_type: web_sys::HtmlOListElement;
attributes {
/// Specifies that the list’s items are in reverse order. Items will be
/// numbered from high to low.
reversed: bool,
/// An integer to start counting from for the list items. Always an
/// Arabic numeral (1, 2, 3, etc.), even when the numbering type
/// is letters or Roman numerals. For example, to start
/// numbering elements from the letter "d" or the Roman numeral "iv,"
/// use start="4".
start: u32,
/// Sets the numbering type:
///
/// * `a` for lowercase letters
/// * `A` for uppercase letters
/// * `i` for lowercase Roman numerals
/// * `I` for uppercase Roman numerals
/// * `1` for numbers (default)
///
/// The specified type is used for the entire list unless a different
/// type attribute is used on an enclosed `<li>` element.
///
/// > Note: Unless the type of the list number matters (like legal or
/// technical documents where items are referenced by their
/// number/letter), use the CSS list-style-type property
/// instead.
r#type: String,
};
}
);
parent_element!(ol);
html_element!(
/// The [HTML `<p>` element][mdn] represents a paragraph.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p
p = {
dom_type: web_sys::HtmlParagraphElement;
}
);
parent_element!(p);
shadow_parent_element!(p);
html_element!(
/// The [HTML `<pre>` element][mdn] represents preformatted text which is to
/// be presented exactly as written in the HTML file.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre
pre = {
dom_type: web_sys::HtmlPreElement;
}
);
parent_element!(pre);
html_element!(
/// The [HTML `<ul>` element][mdn] represents an unordered list of items,
/// typically rendered as a bulleted list.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul
ul = {
dom_type: web_sys::HtmlUListElement;
}
);
parent_element!(ul);
html_element!(
/// The [HTML Table Caption element (`<caption>`)][mdn] specifies the
/// caption (or title) of a table, and if used is *always* the first
/// child of a [`<table>`][table].
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption
/// [table]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table
caption = {
dom_type: web_sys::HtmlTableCaptionElement;
}
);
parent_element!(caption);
html_element!(
/// The [HTML `<col>` element][mdn] defines a column within a table and is
/// used for defining common semantics on all common cells. It is
/// generally found within a [`<colgroup>`][cg] element.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/col
/// [cg]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup
col = {
dom_type: web_sys::HtmlTableColElement;
attributes {
/// This attribute contains a positive integer indicating the number
/// of consecutive columns the `<col>` element spans. If
/// not present, its default value is 1.
span: String,
};
}
);
html_element!(
/// The [HTML `<colgroup>` element][mdn] defines a group of columns within a
/// table.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup
colgroup = {
dom_type: web_sys::HtmlTableColElement;
attributes {
/// This attribute contains a positive integer indicating the number of
/// consecutive columns the `<colgroup>` element spans. If not
/// present, its default value is 1.
///
/// > Note: This attribute is applied on the attributes of the column
/// group, it has no > effect on the CSS styling rules
/// associated with it or, even more, to the cells of the
/// > column's members of the group.
/// >
/// > The span attribute is not permitted if there are one or more
/// `<col>` elements within > the `<colgroup>`.
span: String,
};
}
);
parent_element!(colgroup);
html_element!(
/// The [HTML `<table>` element][mdn] represents tabular data — that is,
/// information presented in a two-dimensional table comprised of rows
/// and columns of cells containing data.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table
table = {
dom_type: web_sys::HtmlTableElement;
}
);
parent_element!(table);
html_element!(
/// The [HTML Table Body element (`<tbody>`)][mdn] encapsulates a set of
/// table rows ([`<tr>`][tr] elements), indicating that they comprise
/// the body of the table ([`<table>`][table]).
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody
/// [tr]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr
/// [table]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table
tbody = {
dom_type: web_sys::HtmlTableSectionElement;
}
);
parent_element!(tbody);
html_element!(
/// The [HTML `<td>` element][mdn] defines a cell of a table that contains
/// data. It participates in the *table model*.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td
td = {
dom_type: web_sys::HtmlTableCellElement;
attributes {
/// This attribute contains a non-negative integer value that
/// indicates for how many columns the cell extends. Its
/// default value is 1. Values higher than 1000 will be
/// considered as incorrect and will be set to the
/// default value (1).
colspan: String,
/// This attribute contains a list of space-separated strings, each
/// corresponding to the id attribute of the `<th>` elements
/// that apply to this element.
headers: String,
/// This attribute contains a non-negative integer value that
/// indicates for how many rows the cell extends. Its
/// default value is 1; if its value is set to 0, it
/// extends until the end of the table section
/// (`<thead>`, `<tbody>`, `<tfoot>`, even if implicitly
/// defined), that the cell belongs to. Values higher than 65534
/// are clipped down to 65534.
rowspan: String,
};
}
);
parent_element!(td);
html_element!(
/// The [HTML `<tfoot>` element][mdn] defines a set of rows summarizing the
/// columns of the table.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tfoot
tfoot = {
dom_type: web_sys::HtmlTableSectionElement;
}
);
parent_element!(tfoot);
html_element!(
/// The [HTML `<th>` element][mdn] defines a cell as header of a group of
/// table cells. The exact nature of this group is defined by the
/// [`scope`][scope] and [`headers`][headers] attributes.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th
/// [scope]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope
/// [headers]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-headers
th = {
dom_type: web_sys::HtmlTableCellElement;
attributes {
/// This attribute contains a short abbreviated description of the
/// cell's content. Some user-agents, such as speech readers,
/// may present this description before the content itself.
abbr: String,
/// This attribute contains a non-negative integer value that
/// indicates for how many columns the cell extends. Its
/// default value is 1. Values higher than 1000 will be
/// considered as incorrect and will be set to the
/// default value (1).
colspan: String,
/// This attribute contains a list of space-separated strings, each
/// corresponding to the id attribute of the `<th>` elements
/// that apply to this element.
headers: String,
/// This attribute contains a non-negative integer value that
/// indicates for how many rows the cell extends. Its
/// default value is 1; if its value is set to 0, it
/// extends until the end of the table section
/// (`<thead>`, `<tbody>`, `<tfoot>`, even if implicitly
/// defined), that the cell belongs to. Values higher than 65534
/// are clipped down to 65534.
rowspan: String,
/// This enumerated attribute defines the cells that the header
/// (defined in the `<th>`) element relates to. It may
/// have the following values:
///
/// * `row`: The header relates to all cells of the row it belongs
/// to.
/// * `col`: The header relates to all cells of the column it
/// belongs to.
/// * `rowgroup`: The header belongs to a rowgroup and relates to
/// all of its cells. These
/// cells can be placed to the right or the left of the header,
/// depending on the value of the dir attribute in the `<table>`
/// element.
/// * `colgroup`: The header belongs to a colgroup and relates to
/// all of its cells.
/// * `auto`
///
/// The default value when this attribute is not specified is auto.
scope: String,
};
}
);
parent_element!(th);
html_element!(
/// The [HTML `<thead>` element][mdn] defines a set of rows defining the
/// head of the columns of the table.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/thead
thead = {
dom_type: web_sys::HtmlTableSectionElement;
}
);
parent_element!(thead);
html_element!(
/// The [HTML `<tr>` element][mdn] defines a row of cells in a table. The
/// row's cells can then be established using a mix of [`<td>`][td]
/// (data cell) and [`<th>`][th] (header cell) elements.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr
/// [td]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td
/// [th]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th
tr = {
dom_type: web_sys::HtmlTableRowElement;
}
);
parent_element!(tr);
html_element!(
/// The [HTML `<base> element`][mdn] specifies the base URL to use for all
/// relative URLs contained within a document. There can be only one
/// `<base>` element in a document.
///
/// If either of its inherent attributes are specified, this element must
/// come before other elements with attributes whose values are URLs,
/// such as <link>’s href attribute.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
base = {
dom_type: web_sys::HtmlBaseElement;
attributes {
/// The base URL to be used throughout the document for relative
/// URLs. Absolute and relative URLs are allowed.
href: String,
/// A keyword or author-defined name of the default browsing context
/// to display the result when links or forms cause
/// navigation, for `<a>` or `<form>` elements without
/// an explicit target attribute. The attribute value
/// targets a browsing context (such as a tab, window,
/// or `<iframe>`).
///
/// The following keywords have special meanings:
///
/// * `_self`: Load the result into the same browsing context as the
/// current one. (This is
/// the default.)
/// * `_blank`: Load the result into a new, unnamed browsing
/// context.
/// * `_parent`: Load the result into the parent browsing context of
/// the current one. (If
/// the current page is inside a frame.) If there is no parent,
/// behaves the same way as _self.
/// * `_top`: Load the result into the topmost browsing context
/// (that is, the browsing
/// context that is an ancestor of the current one, and has no
/// parent). If there is no parent, behaves the same way
/// as _self.
target: String,
};
}
);
html_element!(
/// The [HTML `<head>` element][mdn] contains machine-readable information
/// ([metadata]) about the document, like its [title], [scripts], and
/// [style sheets].
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head
/// [metadata]: https://developer.mozilla.org/en-US/docs/Glossary/metadata
/// [title]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
/// [scripts]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
/// [style sheets]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
head = {
dom_type: web_sys::HtmlHeadElement;
}
);
parent_element!(head);
html_element!(
/// The [HTML External Resource Link element (`<link>`)][mdn] specifies
/// relationships between the current document and an external resource.
/// This element is most commonly used to link to [stylesheets], but is
/// also used to establish site icons (both "favicon" style icons and
/// icons for the home screen and apps on mobile devices) among other
/// things.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link
/// [stylesheets]: https://developer.mozilla.org/en-US/docs/Glossary/CSS
link = {
dom_type: web_sys::HtmlLinkElement;
attributes {
/// This attribute is only used when rel="preload" or rel="prefetch"
/// has been set on the `<link>` element. It specifies
/// the type of content being loaded by the `<link>`,
/// which is necessary for request matching, application
/// of correct content security policy, and setting of
/// correct Accept request header. Furthermore,
/// rel="preload" uses this as a signal for request
/// prioritization. The table below lists the valid values for this
/// attribute and the elements or resources they apply to.
///
/// | Value | Applies To
/// | | -------- |
/// -------------------------------------------------------------------------
/// | | audio | `<audio>` elements
/// | | document | `<iframe>` and `<frame>` elements
/// | | embed | `<embed>` elements
/// | | fetch | fetch, XHR (also requires `<link>` to contain
/// the crossorigin attribute.) | | font | CSS @font-face
/// | | image | `<img>` and `<picture>` elements with srcset
/// or imageset attributes, | | | SVG `<image>`
/// elements, CSS *-image rules |
/// | object | `<object>` elements
/// | | script | `<script>` elements, Worker importScripts
/// | | style | `<link rel=stylesheet>` elements, CSS @import
/// | | track | `<track>` elements
/// | | video | `<video>` elements
/// | | worker | Worker, SharedWorker
/// |
r#as: String,
/// This enumerated attribute indicates whether CORS must be used
/// when fetching the resource. CORS-enabled images can
/// be reused in the `<canvas>` element without being
/// tainted. The allowed values are:
///
/// * `anonymous`: A cross-origin request (i.e. with an Origin HTTP
/// header) is performed,
/// but no credential is sent (i.e. no cookie, X.509 certificate, or
/// HTTP Basic authentication). If the server does not give
/// credentials to the origin site (by not setting the
/// Access-Control-Allow-Origin HTTP header) the resource will be
/// tainted and its usage restricted.
/// * `use-credentials`: A cross-origin request (i.e. with an Origin
/// HTTP header) is
/// performed along with a credential sent (i.e. a cookie,
/// certificate, and/or HTTP Basic authentication is
/// performed). If the server does not give credentials
/// to the origin site (through
/// Access-Control-Allow-Credentials HTTP header), the resource will
/// be tainted and its usage restricted.
///
/// If the attribute is not present, the resource is fetched without
/// a CORS request (i.e. without sending the Origin HTTP
/// header), preventing its non-tainted usage. If
/// invalid, it is handled as if the enumerated keyword
/// anonymous was used.
crossorigin: String,
/// For rel="stylesheet" only, the disabled Boolean attribute
/// indicates whether or not the described stylesheet
/// should be loaded and applied to the document. If
/// disabled is specified in the HTML when it is loaded,
/// the stylesheet will not be loaded during page load.
/// Instead, the stylesheet will be loaded on-demand, if
/// and when the disabled attribute is changed to false or
/// removed.
///
/// Once the stylesheet has been loaded, however, changes made to
/// the value of the disabled property no longer have
/// any relationship to the value of the
/// StyleSheet.disabled property. Changing the value of
/// this property instead simply enables and disables
/// the stylesheet form being applied to the document.
///
/// This differs from StyleSheet's disabled property; changing it to
/// true removes the stylesheet from the document's
/// document.styleSheets list, and doesn't automatically
/// reload the stylesheet when it's toggled back to false.
disabled: String,
/// This attribute specifies the URL of the linked resource. A URL
/// can be absolute or relative.
href: String,
/// This attribute indicates the language of the linked resource. It
/// is purely advisory. Allowed values are determined by
/// BCP47. Use this attribute only if the href attribute
/// is present.
hreflang: String,
/// This attribute specifies the media that the linked resource
/// applies to. Its value must be a media type / media
/// query. This attribute is mainly useful when linking
/// to external stylesheets — it allows the user agent
/// to pick the best adapted one for the device it runs
/// on.
media: String,
/// This attribute names a relationship of the linked document to
/// the current document. The attribute must be a
/// space-separated list of link type values.
rel: String,
/// This attribute defines the sizes of the icons for visual media
/// contained in the resource. It must be present only if the
/// rel contains a value of icon or a non-standard type such as
/// Apple's apple-touch-icon. It may have the following values:
///
/// * `any`, meaning that the icon can be scaled to any size as it
/// is in a vector format,
/// like image/svg+xml.
/// * a white-space separated list of sizes, each in the format
/// <width in pixels>x<height in
/// pixels> or <width in pixels>X<height in pixels>. Each of these
/// sizes must be contained in the resource.
///
/// Note: Most icon formats are only able to store one single icon;
/// therefore most of the time the sizes attribute contains only
/// one entry. MS's ICO format does, as well as Apple's ICNS.
/// ICO is more ubiquitous, so you should use this format if
/// cross-browser support is a concern (especially for old IE
/// versions).
sizes: String,
/// The title attribute has special semantics on the `<link>`
/// element. When used on a `<link rel="stylesheet">` it
/// defines a preferred or an alternate stylesheet.
/// Incorrectly using it may cause the stylesheet to be
/// ignored.
title: String,
/// This attribute is used to define the type of the content linked
/// to. The value of the attribute should be a MIME type
/// such as text/html, text/css, and so on. The common
/// use of this attribute is to define the type of
/// stylesheet being referenced (such as text/css), but
/// given that CSS is the only stylesheet language used
/// on the web, not only is it possible to omit the type
/// attribute, but is actually now recommended practice.
/// It is also used on rel="preload" link types, to make
/// sure the browser only downloads file types that it
/// supports.
r#type: String,
};
}
);
html_element!(
/// The [HTML `<meta>` element][mdn] represents [metadata] that cannot be
/// represented by other HTML meta-related elements, like [`<base>`],
/// [`<link>`], [`<script>`], [`<style>`] or [`<title>`].
///
/// Note: the attribute `name` has a specific meaning for the `<meta>`
/// element, and the `itemprop` attribute must not be set on the same
/// `<meta>` element that has any existing name, `http-equiv` or
/// `charset` attributes.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
/// [metadata]: https://developer.mozilla.org/en-US/docs/Glossary/Metadata
/// [`<base>`]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
/// [`<link>`]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link
/// [`<script>`]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
/// [`<style>`]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
/// [`<title>`]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
meta = {
dom_type: web_sys::HtmlMetaElement;
attributes {
/// This attribute declares the document's character encoding. If
/// the attribute is present, its value must be an ASCII
/// case-insensitive match for the string "utf-8".
charset: String,
/// This attribute contains the value for the http-equiv or name
/// attribute, depending on which is used.
content: String,
/// Defines a pragma directive. The attribute is named
/// http-equiv(alent) because all the allowed values are
/// names of particular HTTP headers:
///
/// * `content-security-policy`: Allows page authors to define a
/// content policy for the
/// current page. Content policies mostly specify allowed server
/// origins and script endpoints which help guard
/// against cross-site scripting attacks.
/// * `content-type`: If specified, the content attribute must have
/// the value
/// `text/html; charset=utf-8`. Note: Can only be used in documents
/// served with a text/html MIME type — not in documents served
/// with an XML MIME type.
/// * `default-style`: Sets the name of the default CSS style sheet
/// set.
/// * `x-ua-compatible`: If specified, the content attribute must
/// have the value "IE=edge".
/// User agents are required to ignore this pragma.
/// * `refresh`: This instruction specifies:
/// * The number of seconds until the page should be reloaded - only
/// if the content
/// attribute contains a positive integer.
/// * The number of seconds until the page should redirect to
/// another - only if the
/// content attribute contains a positive integer followed by the
/// string ';url=', and a valid URL.
/// * Accessibility concerns: Pages set with a refresh value run the
/// risk of having the
/// time interval being too short. People navigating with the aid of
/// assistive technology such as a screen reader may be unable
/// to read through and understand the page's content before
/// being automatically redirected. The abrupt, unannounced
/// updating of the page content may also be disorienting for people
/// experiencing low vision conditions.
http_equiv: String,
/// The name and content attributes can be used together to provide
/// document metadata in terms of name-value pairs, with the
/// name attribute giving the metadata name, and the
/// content attribute giving the value.
///
/// See [standard metadata names] for details about the set of
/// standard metadata names defined in the HTML
/// specification.
///
/// [standard metadata names]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name
name: String,
};
}
);
html_element!(
/// The [HTML `<style>` element][mdn] contains style information for a
/// document, or part of a document.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
style = {
dom_type: web_sys::HtmlStyleElement;
attributes {
/// This attribute defines which media the style should be applied
/// to. Its value is a media query, which defaults to
/// all if the attribute is missing.
media: String,
/// A cryptographic nonce (number used once) used to whitelist
/// inline styles in a style-src
/// Content-Security-Policy. The server must generate a
/// unique nonce value each time it transmits a
/// policy. It is critical to provide a nonce that cannot be guessed
/// as bypassing a resource’s policy is otherwise
/// trivial.
nonce: String,
/// This attribute specifies alternative style sheet sets.
title: String,
};
}
);
parent_element!(style);
html_element!(
/// The [HTML Title element (`<title>`)][mdn] defines the document's title
/// that is shown in a [browser]'s title bar or a page's tab.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
/// [browser]: https://developer.mozilla.org/en-US/docs/Glossary/Browser
title = {
dom_type: web_sys::HtmlTitleElement;
}
);
parent_element!(title);
html_element!(
/// The [HTML `<button>` element][mdn] represents a clickable button, which
/// can be used in [forms] or anywhere in a document that needs simple,
/// standard button functionality.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button
/// [forms]: https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms
button = {
dom_type: web_sys::HtmlButtonElement;
attributes {
/// Specifies that the button should have input focus when the page
/// loads. Only one element in a document can have this
/// attribute.
autofocus: bool,
/// Prevents the user from interacting with the button: it cannot be
/// pressed or focused.
disabled: bool,
/// The `<form>` element to associate the button with (its form
/// owner). The value of this attribute must be the id
/// of a `<form>` in the same document. (If this
/// attribute is not set, the `<button>` is associated
/// with its ancestor `<form>` element, if any.)
///
/// This attribute lets you associate `<button>` elements to
/// `<form>`s anywhere in the document, not just inside
/// a `<form>`. It can also override an ancestor
/// `<form>` element.
form: String,
/// The URL that processes the information submitted by the button.
/// Overrides the action attribute of the button's form owner.
/// Does nothing if there is no form owner.
formaction: String,
/// If the button is a submit button (it's inside/associated with a
/// `<form>` and doesn't have type="button"), specifies how to
/// encode the form data that is submitted. Possible values:
///
/// * application/x-www-form-urlencoded: The default if the
/// attribute is not used.
/// * multipart/form-data: Use to submit `<input>` elements with
/// their type attributes set
/// to file.
/// * text/plain: Specified as a debugging aid; shouldn’t be used
/// for real form submission.
///
/// If this attribute is specified, it overrides the enctype
/// attribute of the button's form owner.
formenctype: String,
/// If the button is a submit button (it's inside/associated with a
/// `<form>` and doesn't have type="button"), this attribute
/// specifies the HTTP method used to submit the form.
/// Possible values:
///
/// * post: The data from the form are included in the body of the
/// HTTP request when sent to
/// the server. Use when the form contains information that
/// shouldn’t be public, like login credentials.
/// * get: The form data are appended to the form's action URL, with
/// a ? as a separator, and
/// the resulting URL is sent to the server. Use this method when
/// the form has no side effects, like search forms.
///
/// If specified, this attribute overrides the method attribute of
/// the button's form owner.
formmethod: String,
/// If the button is a submit button, specifies that the form is not
/// to be validated when it is submitted. If this
/// attribute is specified, it overrides the novalidate
/// attribute of the button's form owner.
///
/// This attribute is also available on `<input type="image">` and
/// `<input type="submit">` elements.
formnovalidate: bool,
/// If the button is a submit button, this attribute is a
/// author-defined name or standardized,
/// underscore-prefixed keyword indicating
/// where to display the response from submitting the form. This
/// is the name of, or keyword for, a browsing context (a tab,
/// window, or `<iframe>`). If this attribute is specified, it
/// overrides the target attribute of the button's form
/// owner. The following keywords have special meanings:
///
/// * _self: Load the response into the same browsing context as the
/// current one.
/// This is the default if the attribute is not specified.
/// * _blank: Load the response into a new unnamed browsing context
/// — usually a new tab or
/// window, depending on the user’s browser settings.
/// * _parent: Load the response into the parent browsing context of
/// the current one. If
/// there is no parent, this option behaves the same way as _self.
/// * _top: Load the response into the top-level browsing context
/// (that is, the browsing
/// context that is an ancestor of the current one, and has no
/// parent). If there is no parent, this option behaves
/// the same way as _self.
formtarget: String,
/// The name of the button, submitted as a pair with the button’s
/// value as part of the form data.
name: String,
/// The default behavior of the button. Possible values are:
///
/// * submit: The button submits the form data to the server. This
/// is the default if the
/// attribute is not specified for buttons associated with a
/// `<form>`, or if the attribute is an empty or invalid
/// value.
/// * reset: The button resets all the controls to their initial
/// values, like
/// `<input type="reset">`. (This behavior tends to annoy users.)
/// * button: The button has no default behavior, and does nothing
/// when pressed by default.
/// It can have client-side scripts listen to the element's events,
/// which are triggered when the events occur.
r#type: String,
/// Defines the value associated with the button’s name when it’s
/// submitted with the form data. This value is passed to the
/// server in params when the form is submitted.
value: String,
};
}
);
parent_element!(button);
html_element!(
/// The [HTML `<datalist>` element][mdn] contains a set of
/// [`<option>`][option] elements that represent the values available
/// for other controls.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist
/// [option]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option
datalist = {
dom_type: web_sys::HtmlDataListElement;
}
);
parent_element!(datalist);
html_element!(
/// The [HTML `<fieldset>` element][mdn] is used to group several controls
/// as well as labels ([`<label>`][label]) within a web form.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset
/// [label]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label
fieldset = {
dom_type: web_sys::HtmlFieldSetElement;
attributes {
/// If this Boolean attribute is set, all form controls that are
/// descendants of the `<fieldset>` are disabled, meaning they
/// are not editable and won't be submitted along
/// with the `<form>`. They won't receive any browsing events, like
/// mouse clicks or focus-related events. By default browsers
/// display such controls grayed out. Note that form elements
/// inside the `<legend>` element won't be disabled.
disabled: String,
/// This attribute takes the value of the id attribute of a `<form>`
/// element you want the `<fieldset>` to be part of, even if it
/// is not inside the form.
form: String,
/// The name associated with the group.
///
/// Note: The caption for the fieldset is given by the first
/// `<legend>` element inside it.
name: String,
};
}
);
parent_element!(fieldset);
html_element!(
/// The [HTML `<form>` element][mdn] represents a document section that
/// contains interactive controls for submitting information to a web
/// server.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form
form = {
dom_type: web_sys::HtmlFormElement;
attributes {
/// Space-separated [character encodings] the server accepts. The
/// browser uses them in the order in which they are listed. The
/// default value means the same encoding as the page.
///
/// [character encodings]: https://developer.mozilla.org/en-US/docs/Web/Guide/Localizations_and_character_encodings
accept_charset: String,
/// The URI of a program that processes the information submitted
/// via the form.
action: String,
/// Indicates whether input elements can by default have their
/// values automatically completed by the browser.
/// autocomplete attributes on form elements override it
/// on `<form>`. Possible values:
///
/// * off: The browser may not automatically complete entries.
/// (Browsers tend to ignore this
/// for suspected login forms; see The autocomplete attribute and
/// login fields.)
/// * on: The browser may automatically complete entries.
autocomplete: String,
/// If the value of the method attribute is post, enctype is the
/// MIME type of the form submission. Possible values:
///
/// * application/x-www-form-urlencoded: The default value.
/// * multipart/form-data: Use this if the form contains `<input>`
/// elements with type=file.
/// * text/plain: Introduced by HTML5 for debugging purposes.
///
/// This value can be overridden by formenctype attributes on
/// `<button>`, `<input type="submit">`, or `<input
/// type="image">` elements.
enctype: String,
/// The HTTP method to submit the form with. Possible values:
///
/// * post: The POST method; form data sent as the request body.
/// * get: The GET method; form data appended to the action URL with
/// a ? separator. Use this
/// method when the form has no side-effects.
/// * dialog: When the form is inside a `<dialog>`, closes the
/// dialog on submission.
///
/// This value is overridden by formmethod attributes on `<button>`,
/// `<input type="submit">`, or `<input type="image">` elements.
method: String,
/// Indicates that the form shouldn't be validated when submitted.
/// If this attribute is not set (and therefore the form
/// is validated), it can be overridden by a
/// formnovalidate attribute on a `<button>`, `<input
/// type="submit">`, or `<input type="image">` element
/// belonging to the form.
novalidate: bool,
/// Creates a hyperlink or annotation depending on the value.
rel: String,
/// Indicates where to display the response after submitting the
/// form. It is a name/keyword for a browsing context
/// (for example, tab, window, or iframe). The following
/// keywords have special meanings:
///
/// * _self (default): Load into the same browsing context as the
/// current one.
/// * _blank: Load into a new unnamed browsing context.
/// * _parent: Load into the parent browsing context of the current
/// one. If no parent,
/// behaves the same as _self.
/// * _top: Load into the top-level browsing context (i.e., the
/// browsing context that is an
/// ancestor of the current one and has no parent). If no parent,
/// behaves the same as _self.
///
/// This value can be overridden by a formtarget attribute on a
/// `<button>`, `<input type="submit">`, or `<input
/// type="image">` element.
target: String,
};
events {
// The type should be FormDataEvent, but web_sys doesn't support it.
formdata: web_sys::Event,
reset: web_sys::Event,
// The type should be SubmitEvent, but web_sys doesn't support it.
submit: web_sys::Event,
};
}
);
parent_element!(form);
html_element!(
/// The [HTML `<input>` element][mdn] is used to create interactive controls
/// for web-based forms in order to accept data from the user; a wide
/// variety of types of input data and control widgets are available,
/// depending on the device and [user agent].
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
/// [user agent]: https://developer.mozilla.org/en-US/docs/Glossary/user_agent
input = {
dom_type: web_sys::HtmlInputElement;
attributes {
/// Valid for the file input type only, the accept property defines
/// which file types are selectable in a file upload control.
/// See the file input type.
accept: String,
/// Valid for the image button only, the alt attribute provides
/// alternative text for the image, displaying the value of the
/// attribute if the image src is missing or otherwise
/// fails to load. See the image input type.
alt: String,
/// The autocomplete attribute takes as its value a space-separated
/// string that describes what, if any, type of autocomplete
/// functionality the input should provide. A typical
/// implementation of autocomplete simply recalls previous values
/// entered in the same input field, but more complex forms of
/// autocomplete can exist. For instance, a browser could
/// integrate with a device's contacts list to autocomplete email
/// addresses in an email input field. See Values in The HTML
/// autocomplete attribute for permitted values.
///
/// The autocomplete attribute is valid on hidden, text, search,
/// url, tel, email, date, month, week, time,
/// datetime-local, number, range, color, and password.
/// This attribute has no effect on input types that do
/// not return numeric or text data, being valid for all
/// input types except checkbox, radio, file, or any of the button
/// types.
///
/// See The HTML autocomplete attribute for additional information,
/// including information on password security and how
/// autocomplete is slightly different for hidden than for other
/// input types.
autocomplete: String,
/// Indicates if present that the input should automatically have
/// focus when the page has finished loading (or when
/// the `<dialog>` containing the element has been
/// displayed).
///
/// Note: An element with the autofocus attribute may gain focus
/// before the DOMContentLoaded event is fired.
///
/// No more than one element in the document may have the autofocus
/// attribute. The autofocus attribute cannot be used on inputs
/// of type hidden, since hidden inputs cannot be focused.
///
/// If put on more than one element, the first one with the
/// attribute receives focus.
///
/// Warning: Automatically focusing a form control can confuse
/// visually-impaired people using screen-reading technology and
/// people with cognitive impairments. When autofocus is
/// assigned, screen-readers "teleport" their user to the form
/// control without warning them beforehand.
///
/// For better usability, avoid using autofocus. Automatically
/// focusing on a form control can cause the page to
/// scroll on load. The focus can also cause dynamic
/// keyboards to display on some touch devices. While a
/// screen reader will announce the label of the
/// form control receiving focus, the screen reader will not
/// announce anything before the label, and the sighted user on
/// a small device will equally miss the context created by the
/// preceding content.
autofocus: bool,
/// Introduced in the HTML Media Capture specification and valid for
/// the file input type only, the capture attribute
/// defines which media—microphone, video, or
/// camera—should be used to capture a new file for
/// upload with file upload control in supporting
/// scenarios. See the file input type.
capture: String,
/// Valid for both radio and checkbox types, checked is a Boolean
/// attribute. If present on a radio type, it indicates that
/// that radio button is the currently selected one in the group
/// of same-named radio buttons. If present on a checkbox type, it
/// indicates that the checkbox is checked by default (when the
/// page loads). It does not indicate whether this checkbox is
/// currently checked: if the checkbox’s state is changed, this
/// content attribute does not reflect the change. (Only
/// the HTMLInputElement’s checked IDL attribute is
/// updated.)
///
/// Note: Unlike other input controls, a checkboxes and radio
/// buttons value are only included in the submitted
/// data if they are currently checked. If they are, the
/// name and the value(s) of the checked controls are
/// submitted.
///
/// For example, if a checkbox whose name is fruit has a value of
/// cherry, and the checkbox is checked, the form data submitted
/// will include fruit=cherry. If the checkbox isn't active, it
/// isn't listed in the form data at all. The default value for
/// checkboxes and radio buttons is on.
checked: bool,
/// Valid for text and search input types only, the dirname
/// attribute enables the submission of the
/// directionality of the element. When included, the
/// form control will submit with two name/value pairs:
/// the first being the name and value, the second being
/// the value of the dirname as the name with the value of
/// ltr or rtl being set by the browser.
dirname: String,
/// If present indicates that the user should not be able to
/// interact with the input. Disabled inputs are
/// typically rendered with a dimmer color or using some
/// other form of indication that the field is not
/// available for use.
///
/// Specifically, disabled inputs do not receive the click event,
/// and disabled inputs are not submitted with the form.
disabled: bool,
/// A string specifying the `<form>` element with which the input is
/// associated (that is, its form owner). This string's value,
/// if present, must match the id of a `<form>` element in the
/// same document. If this attribute isn't specified, the `<input>`
/// element is associated with the nearest containing form, if
/// any.
///
/// The form attribute lets you place an input anywhere in the
/// document but have it included with a form elsewhere
/// in the document.
///
/// Note: An input can only be associated with one form.
form: String,
/// Valid for the image and submit input types only. See the submit
/// input type for more information.
formaction: String,
/// Valid for the image and submit input types only. See the submit
/// input type for more information.
formenctype: String,
/// Valid for the image and submit input types only. See the submit
/// input type for more information.
formmethod: String,
/// Valid for the image and submit input types only. See the submit
/// input type for more information.
formnovalidate: String,
/// Valid for the image and submit input types only. See the submit
/// input type for more information.
formtarget: String,
/// Valid for the image input button only, the height is the height
/// of the image file to display to represent the
/// graphical submit button. See the image input type.
height: String,
/// Global value valid for all elements, it provides a hint to
/// browsers as to the type of virtual keyboard
/// configuration to use when editing this element or
/// its contents. Values include none, text, tel, url,
/// email, numeric, decimal, and search.
inputmode: String,
/// The values of the list attribute is the id of a `<datalist>`
/// element located in the same document. The
/// `<datalist>` provides a list of predefined values
/// to suggest to the user for this input. Any values in
/// the list that are not compatible with the type are
/// not included in the suggested options. The
/// values provided are suggestions, not requirements: users can
/// select from this predefined list or provide a different value.
///
/// It is valid on text, search, url, tel, email, date, month, week,
/// time, datetime-local, number, range, and color.
///
/// Per the specifications, the list attribute is not supported by
/// the hidden, password, checkbox, radio, file, or any
/// of the button types.
///
/// Depending on the browser, the user may see a custom color
/// palette suggested, tic marks along a range, or even
/// a input that opens like a select but allows for
/// non-listed values. Check out the browser
/// compatibility table for the other input types.
///
/// See the `<datalist>` element.
list: String,
/// Valid for date, month, week, time, datetime-local, number, and
/// range, it defines the greatest value in the range of
/// permitted values. If the value entered into the element
/// exceeds this, the element fails constraint validation. If the
/// value of the max attribute isn't a number, then the
/// element has no maximum value.
///
/// There is a special case: if the data type is periodic (such as
/// for dates or times), the value of max may be lower
/// than the value of min, which indicates that the
/// range may wrap around; for example, this allows you
/// to specify a time range from 10 PM to 4 AM.
max: String,
/// Valid for text, search, url, tel, email, and password, it
/// defines the maximum number of characters (as UTF-16
/// code units) the user can enter into the field. This
/// must be an integer value 0 or higher. If no
/// maxlength is specified, or an invalid value is
/// specified, the field has no maximum length. This value must also
/// be greater than or equal to the value of minlength.
///
/// The input will fail constraint validation if the length of the
/// text entered into the field is greater than
/// maxlength UTF-16 code units long. By default,
/// browsers prevent users from entering more characters
/// than allowed by the maxlength attribute.
maxlength: String,
/// Valid for date, month, week, time, datetime-local, number, and
/// range, it defines the most negative value in the range of
/// permitted values. If the value entered into the element is
/// less than this this, the element fails constraint validation. If
/// the value of the min attribute isn't a number, then
/// the element has no minimum value.
///
/// This value must be less than or equal to the value of the max
/// attribute. If the min attribute is present but is not
/// specified or is invalid, no min value is applied. If the min
/// attribute is valid and a non-empty value is less than the
/// minimum allowed by the min attribute, constraint
/// validation will prevent form submission.
///
/// There is a special case: if the data type is periodic (such as
/// for dates or times), the value of max may be lower
/// than the value of min, which indicates that the
/// range may wrap around; for example, this allows you
/// to specify a time range from 10 PM to 4 AM.
min: String,
/// Valid for text, search, url, tel, email, and password, it
/// defines the minimum number of characters (as UTF-16
/// code units) the user can enter into the entry field.
/// This must be an non-negative integer value smaller
/// than or equal to the value specified by maxlength.
/// If no minlength is specified, or an invalid value is
/// specified, the input has no minimum length.
///
/// The input will fail constraint validation if the length of the
/// text entered into the field is fewer than minlength
/// UTF-16 code units long, preventing form submission.
minlength: String,
/// If set, means the user can enter comma separated email addresses
/// in the email widget or can choose more than one file
/// with the file input. See the email and file input
/// type.
multiple: bool,
/// A string specifying a name for the input control. This name is
/// submitted along with the control's value when the form data
/// is submitted.
///
/// # What's in a name
///
/// Consider the name a required attribute (even though it's not).
/// If an input has no name specified, or name is empty,
/// the input's value is not submitted with the form!
/// (Disabled controls, unchecked radio buttons,
/// unchecked checkboxes, and reset buttons are also not
/// sent.)
///
/// There are two special cases:
///
/// * `_charset_`: If used as the name of an `<input>` element of
/// type hidden, the input's
/// value is automatically set by the user agent to the character
/// encoding being used to submit the form.
/// * `isindex`: For historical reasons, the name isindex is not
/// allowed.
///
/// # name and radio buttons
///
/// The name attribute creates a unique behavior for radio buttons.
///
/// Only one radio button in a same-named group of radio buttons can
/// be checked at a time. Selecting any radio button in
/// that group automatically deselects any
/// currently-selected radio button in the same group.
/// The value of that one checked radio button is
/// sent along with the name if the form is submitted.
///
/// When tabbing into a series of same-named group of radio buttons,
/// if one is checked, that one will receive focus. If
/// they aren't grouped together in source order, if one
/// of the group is checked, tabbing into the group
/// starts when the first one in the group is
/// encountered, skipping all those that aren't checked.
/// In other words, if one is checked, tabbing skips the
/// unchecked radio buttons in the group. If none are checked, the
/// radio button group receives focus when the first button in
/// the same name group is reached.
///
/// Once one of the radio buttons in a group has focus, using the
/// arrow keys will navigate through all the radio
/// buttons of the same name, even if the radio buttons
/// are not grouped together in the source order.
///
/// # HTMLFormElement.elements
///
/// When an input element is given a name, that name becomes a
/// property of the owning form element's
/// HTMLFormElement.elements property.
///
/// Warning: Avoid giving form elements a name that corresponds to a
/// built-in property of the form, since you would then override
/// the predefined property or method with this reference to the
/// corresponding input.
name: String,
/// The pattern attribute, when specified, is a regular expression
/// that the input's value must match in order for the
/// value to pass constraint validation. It must be a
/// valid JavaScript regular expression, as used by the
/// RegExp type, and as documented in our
/// guide on regular expressions; the 'u' flag is specified when
/// compiling the regular expression, so that the pattern is
/// treated as a sequence of Unicode code points, instead
/// of as ASCII. No forward slashes should be specified around the
/// pattern text.
///
/// If the pattern attribute is present but is not specified or is
/// invalid, no regular expression is applied and this attribute
/// is ignored completely. If the pattern attribute is valid and
/// a non-empty value does not match the pattern, constraint
/// validation will prevent form submission.
///
/// Tip: If using the pattern attribute, inform the user about the
/// expected format by including explanatory text nearby. You
/// can also include a title attribute to explain
/// what the requirements are to match the pattern; most browsers
/// will display this title as a tooltip. The visible
/// explanation is required for accessibility. The
/// tooltip is an enhancement.
pattern: String,
/// The placeholder attribute is a string that provides a brief hint
/// to the user as to what kind of information is
/// expected in the field. It should be a word or short
/// phrase that demonstrates the expected type of data,
/// rather than an explanatory message. The
/// text must not include carriage returns or line feeds.
///
/// Note: The placeholder attribute is not as semantically useful as
/// other ways to explain your form, and can cause unexpected
/// technical issues with your content.
placeholder: String,
/// If present, indicates that the user should not be able to edit
/// the value of the input. The readonly attribute is
/// supported text, search, url, tel, email, date,
/// month, week, time, datetime-local, number, and
/// password input types.
readonly: bool,
/// If present, indicates that the user must specify a value for the
/// input before the owning form can be submitted. The required
/// attribute is supported text, search, url, tel, email, date,
/// month, week, time, datetime-local, number, password, checkbox,
/// radio, and file.
required: bool,
/// Valid for email, password, tel, and text input types only.
/// Specifies how much of the input is shown. Basically
/// creates same result as setting CSS width property
/// with a few specialities. The actual unit of the
/// value depends on the input type. For password and
/// text it's number of characters (or em units) and
/// pixels for others. CSS width takes precedence
/// over size attribute.
size: String,
/// Valid for the image input button only, the src is string
/// specifying the URL of the image file to display to
/// represent the graphical submit button. See the image
/// input type.
src: String,
/// Valid for the numeric input types, including number, date/time
/// input types, and range, the step attribute is a
/// number that specifies the granularity that the value
/// must adhere to.
///
/// If not explicitly included, step defaults to 1 for number and
/// range, and 1 unit type (second, week, month, day)
/// for the date/time input types. The value can must be
/// a positive number—integer or float—or the special
/// value any, which means no stepping is implied, and
/// any value is allowed (barring other constraints, such
/// as min and max).
///
/// If any is not explicity set, valid values for the number,
/// date/time input types, and range input types are
/// equal to the basis for stepping - the min value and
/// increments of the step value, up to the max value,
/// if specified.
///
/// For example, if you have `<input type="number" min="10"
/// step="2">`, then any even integer, 10 or greater, is
/// valid. If omitted, `<input type="number">`, any
/// integer is valid, but floats (like 4.2) are not
/// valid, because step defaults to 1. For 4.2 to be
/// valid, step would have had to be set to any, 0.1, 0.2, or any
/// the min value would have had to be a number ending
/// in .2, such as `<input type="number" min="-5.2">`.
///
/// Note: When the data entered by the user doesn't adhere to the
/// stepping configuration, the value is considered invalid in
/// contraint validation and will match the :invalid
/// pseudoclass.
///
/// The default stepping value for number inputs is 1, allowing only
/// integers to be entered, unless the stepping base is not an
/// integer. The default stepping value for time is 1
/// second (with 900 being equal to 15 minutes).
step: String,
/// Global attribute valid for all elements, including all the input
/// types, an integer attribute indicating if the element can
/// take input focus (is focusable), if it should participate to
/// sequential keyboard navigation. As all input types except for
/// input of type hidden are focusable, this attribute
/// should not be used on form controls, because doing
/// so would require the management of the focus order
/// for all elements within the document with the risk
/// of harming usability and accessibility if
/// done incorrectly.
tabindex: String,
/// Global attribute valid for all elements, including all input
/// types, containing a text representing advisory
/// information related to the element it belongs to.
/// Such information can typically, but not necessarily,
/// be presented to the user as a tooltip. The title
/// should NOT be used as the primary explanation of the
/// purpose of the form control. Instead, use
/// the `<label>` element with a for attribute set to the form
/// control's id attribute.
title: String,
/// A string specifying the type of control to render. For example,
/// to create a checkbox, a value of checkbox is used.
/// If omitted (or an unknown value is specified), the
/// input type text is used, creating a plaintext input
/// field.
///
/// Permitted values are listed in `<input>` types above.
r#type: String,
/// The input control's value. When specified in the HTML, this is
/// the initial value, and from then on it can be
/// altered or retrieved at any time using JavaScript to
/// access the respective HTMLInputElement object's
/// value property. The value attribute is always
/// optional, though should be considered mandatory for
/// checkbox, radio, and hidden.
value: String,
/// Valid for the image input button only, the width is the width of
/// the image file to display to represent the graphical
/// submit button. See the image input type.
width: String,
};
events {
invalid: web_sys::Event,
select: web_sys::Event,
};
properties {
checked: bool,
value: String,
};
}
);
html_element!(
/// The [HTML `<label>` element][mdn] represents a caption for an item in a
/// user interface.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label
label = {
dom_type: web_sys::HtmlLabelElement;
attributes {
/// The id of a labelable form-related element in the same document
/// as the `<label>` element. The first element in the
/// document with an id matching the value of the for
/// attribute is the labeled control for this label
/// element, if it is a labelable element. If it is not
/// labelable then the for attribute has no effect. If
/// there are other elements which also match the
/// id value, later in the document, they are not considered.
///
/// Note: A `<label>` element can have both a for attribute and a
/// contained control element, as long as the for attribute
/// points to the contained control element.
r#for: String,
/// The `<form>` element with which the label is associated (its
/// form owner). If specified, the value of the
/// attribute is the id of a `<form>` element in the
/// same document. This lets you place label elements
/// anywhere within a document, not just as descendants
/// of their form elements.
form: String,
};
}
);
parent_element!(label);
html_element!(
/// The [HTML `<legend>` element][mdn] represents a caption for the content
/// of its parent [`<fieldset>`][fieldset].
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/legend
/// [fieldset]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset
legend = {
dom_type: web_sys::HtmlLegendElement;
}
);
parent_element!(legend);
html_element!(
/// The [HTML `<meter>` element][mdn] represents either a scalar value
/// within a known range or a fractional value.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meter
meter = {
dom_type: web_sys::HtmlMeterElement;
attributes {
/// The current numeric value. This must be between the minimum and
/// maximum values (min attribute and max attribute) if they are
/// specified. If unspecified or malformed, the value is 0. If
/// specified, but not within the range given by the min attribute
/// and max attribute, the value is equal to the nearest
/// end of the range.
///
/// Note: Unless the value attribute is between 0 and 1 (inclusive),
/// the min and max attributes should define the range
/// so that the value attribute's value is within it.
value: String,
/// The lower numeric bound of the measured range. This must be less
/// than the maximum value (max attribute), if specified. If
/// unspecified, the minimum value is 0.
min: String,
/// The upper numeric bound of the measured range. This must be
/// greater than the minimum value (min attribute), if
/// specified. If unspecified, the maximum value is 1.
max: String,
/// The `<form>` element to associate the `<meter>` element with
/// (its form owner). The value of this attribute must
/// be the id of a `<form>` in the same document. If
/// this attribute is not set, the `<button>` is
/// associated with its ancestor `<form>` element, if
/// any. This attribute is only used if the `<meter>` element is
/// being used as a form-associated element, such as one
/// displaying a range corresponding to an `<input type="number">`.
form: String,
/// The upper numeric bound of the low end of the measured range.
/// This must be greater than the minimum value (min
/// attribute), and it also must be less than the high
/// value and maximum value (high attribute and max
/// attribute, respectively), if any are specified. If
/// unspecified, or if less than the minimum value, the
/// low value is equal to the minimum value.
high: u32,
/// The lower numeric bound of the high end of the measured range.
/// This must be less than the maximum value (max
/// attribute), and it also must be greater than the low
/// value and minimum value (low attribute and min
/// attribute, respectively), if any are specified. If
/// unspecified, or if greater than the maximum
/// value, the high value is equal to the maximum value.
low: u32,
/// This attribute indicates the optimal numeric value. It must be
/// within the range (as defined by the min attribute and max
/// attribute). When used with the low attribute and
/// high attribute, it gives an indication where along the range is
/// considered preferable. For example, if it is between the min
/// attribute and the low attribute, then the lower
/// range is considered preferred.
optimum: u32,
};
}
);
parent_element!(meter);
html_element!(
/// The [HTML `<optgroup>` element][mdn] creates a grouping of options
/// within a [`<select>`][select] element.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup
/// [select]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
optgroup = {
dom_type: web_sys::HtmlOptGroupElement;
attributes {
/// If set, none of the items in this option group is selectable.
/// Often browsers grey out such control and it won't
/// receive any browsing events, like mouse clicks or
/// focus-related ones.
disabled: bool,
/// The name of the group of options, which the browser can use when
/// labeling the options in the user interface. This attribute
/// is mandatory if this element is used.
label: String,
};
}
);
parent_element!(optgroup);
html_element!(
/// The [HTML `<option>` element][mdn] is used to define an item contained
/// in a [`<select>`][select], an [`<optgroup>`][optgroup], or a
/// [`<datalist>`][datalist] element. As such, `<option>` can represent
/// menu items in popups and other lists of items in an HTML document.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option
/// [select]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
/// [optgroup]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup
/// [datalist]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist
option = {
dom_type: web_sys::HtmlOptionElement;
attributes {
/// If set, this option is not checkable. Often browsers grey out
/// such control and it won't receive any browsing
/// event, like mouse clicks or focus-related ones. If
/// this attribute is not set, the element can still be
/// disabled if one of its ancestors is a
/// disabled `<optgroup>` element.
disabled: bool,
/// This attribute is text for the label indicating the meaning of
/// the option. If the label attribute isn't defined,
/// its value is that of the element text content.
label: String,
/// If present, indicates that the option is initially selected. If
/// the `<option>` element is the descendant of a
/// `<select>` element whose multiple attribute is not
/// set, only one single `<option>` of this `<select>`
/// element may have the selected attribute.
selected: bool,
/// The content of this attribute represents the value to be
/// submitted with the form, should this option be
/// selected. If this attribute is omitted, the value is
/// taken from the text content of the option element.
value: String,
};
}
);
parent_element!(option);
html_element!(
/// The [HTML Output element (`<output>`)][mdn] is a container element into
/// which a site or app can inject the results of a calculation or the
/// outcome of a user action.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/output
output = {
dom_type: web_sys::HtmlOutputElement;
attributes {
/// A space-separated list of other elements’ ids, indicating that
/// those elements contributed input values to (or
/// otherwise affected) the calculation.
r#for: String,
/// The `<form>` element to associate the output with (its form
/// owner). The value of this attribute must be the id
/// of a `<form>` in the same document. (If this
/// attribute is not set, the `<output>` is associated
/// with its ancestor `<form>` element, if any.)
///
/// This attribute lets you associate `<output>` elements to
/// `<form>`s anywhere in the document, not just inside
/// a `<form>`. It can also override an ancestor
/// `<form>` element.
form: String,
/// The element's name. Used in the form.elements API.
name: String,
};
}
);
parent_element!(output);
html_element!(
/// The [HTML `<progress>` element][progress] displays an indicator showing
/// the completion progress of a task, typically displayed as a progress
/// bar.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress
progress = {
dom_type: web_sys::HtmlProgressElement;
attributes {
/// This attribute describes how much work the task indicated by the
/// progress element requires. The max attribute, if present,
/// must have a value greater than 0 and be a valid
/// floating point number. The default value is 1.
max: f32,
/// This attribute specifies how much of the task that has been
/// completed. It must be a valid floating point number between
/// 0 and max, or between 0 and 1 if max is omitted. If there is
/// no value attribute, the progress bar is indeterminate; this
/// indicates that an activity is ongoing with no indication of
/// how long it is expected to take.
value: f32,
};
}
);
parent_element!(progress);
html_element!(
/// The [HTML `<select>` element][mdn] represents a control that provides a
/// menu of options.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
select = {
dom_type: web_sys::HtmlSelectElement;
attributes {
/// A DOMString providing a hint for a user agent's autocomplete
/// feature.
autocomplete: String,
/// Lets you specify that a form control should have input focus
/// when the page loads. Only one form element in a
/// document can have the autofocus attribute.
autofocus: bool,
/// Indicates that the user cannot interact with the control. If
/// this attribute is not specified, the control
/// inherits its setting from the containing element,
/// for example `<fieldset>`; if there is no containing
/// element with the disabled attribute set, then
/// the control is enabled.
disabled: bool,
/// The `<form>` element to associate the `<select>` with (its form
/// owner). The value of this attribute must be the id of a
/// `<form>` in the same document. (If this attribute is
/// not set, the `<select>` is associated with its ancestor `<form>`
/// element, if any.)
///
/// This attribute lets you associate `<select>` elements to
/// `<form>`s anywhere in the document, not just inside
/// a `<form>`. It can also override an ancestor
/// `<form>` element.
form: String,
/// Indicates that multiple options can be selected in the list. If
/// it is not specified, then only one option can be
/// selected at a time. When multiple is specified, most
/// browsers will show a scrolling list box instead of a
/// single line dropdown.
multiple: bool,
/// This attribute is used to specify the name of the control.
name: String,
/// Indicates that an option with a non-empty string value must be
/// selected.
required: bool,
/// If the control is presented as a scrolling list box (e.g. when
/// multiple is specified), this attribute represents the number
/// of rows in the list that should be visible at one
/// time. Browsers are not required to present a select element as a
/// scrolled list box. The default value is 0.
size: String,
};
}
);
parent_element!(select);
html_element!(
/// The [HTML `<textarea>` element][mdn] represents a multi-line plain-text
/// editing control, useful when you want to allow users to enter a
/// sizeable amount of free-form text, for example a comment on a review
/// or feedback form.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
textarea = {
dom_type: web_sys::HtmlTextAreaElement;
attributes {
/// This attribute indicates whether the value of the control can be
/// automatically completed by the browser. Possible values are:
///
/// * off: The user must explicitly enter a value into this field
/// for every use, or the
/// document provides its own auto-completion method; the browser
/// does not automatically complete the entry.
/// * on: The browser can automatically complete the value based on
/// values that the user has
/// entered during previous uses.
///
/// If the autocomplete attribute is not specified on a `<textarea>`
/// element, then the browser uses the autocomplete attribute
/// value of the `<textarea>` element's form owner.
/// The form owner is either the `<form>` element that this
/// `<textarea>` element is a descendant of or the form
/// element whose id is specified by the form attribute
/// of the input element. For more information, see the
/// autocomplete attribute in `<form>`.
autocomplete: String,
/// Lets you specify that a form control should have input focus
/// when the page loads. Only one form-associated
/// element in a document can have this attribute
/// specified.
autofocus: bool,
/// The visible width of the text control, in average character
/// widths. If it is not specified, the default value is
/// 20.
cols: u32,
/// Indicates that the user cannot interact with the control. If
/// this attribute is not specified, the control
/// inherits its setting from the containing element,
/// for example `<fieldset>`; if there is no containing
/// element when the disabled attribute is set,
/// the control is enabled.
disabled: bool,
/// The form element that the `<textarea>` element is associated
/// with (its "form owner"). The value of the attribute
/// must be the id of a form element in the same
/// document. If this attribute is not specified, the
/// `<textarea>` element must be a descendant of a
/// form element. This attribute enables you to place
/// `<textarea>` elements anywhere within a document, not just
/// as descendants of form elements.
form: String,
/// The maximum number of characters (UTF-16 code units) that the
/// user can enter. If this value isn't specified, the
/// user can enter an unlimited number of characters.
maxlength: u32,
/// The minimum number of characters (UTF-16 code units) required
/// that the user should enter.
minlength: u32,
/// The name of the control.
name: String,
/// A hint to the user of what can be entered in the control.
/// Carriage returns or line-feeds within the
/// placeholder text must be treated as line breaks when
/// rendering the hint.
///
/// Note: Placeholders should only be used to show an example of the
/// type of data that should be entered into a form; they are
/// not a substitute for a proper `<label>` element tied to the
/// input.
placeholder: String,
/// Indicates that the user cannot modify the value of the control.
/// Unlike the disabled attribute, the readonly attribute does
/// not prevent the user from clicking or selecting
/// in the control. The value of a read-only control is still
/// submitted with the form.
readonly: bool,
/// This attribute specifies that the user must fill in a value
/// before submitting a form.
required: String,
/// The number of visible text lines for the control.
rows: String,
/// Specifies whether the `<textarea>` is subject to spell checking
/// by the underlying browser/OS. the value can be:
///
/// * true: Indicates that the element needs to have its spelling
/// and grammar checked.
/// * default : Indicates that the element is to act according to a
/// default behavior,
/// possibly based on the parent element's own spellcheck value.
/// * false : Indicates that the element should not be spell
/// checked.
spellcheck: String,
/// Indicates how the control wraps text. Possible values are:
///
/// * hard: The browser automatically inserts line breaks (CR+LF) so
/// that each line has no
/// more than the width of the control; the cols attribute must also
/// be specified for this to take effect.
/// * soft: The browser ensures that all line breaks in the value
/// consist of a CR+LF pair,
/// but does not insert any additional line breaks.
///
/// If this attribute is not specified, soft is its default value.
wrap: String,
};
properties {
value: String,
};
}
);
parent_element!(textarea);
html_element!(
/// The (`<slot>`)[mdn] HTML element—part of the Web Components technology
/// suite—is a placeholder inside a web component that you can fill with
/// your own markup, which lets you create separate DOM trees and present
/// them together.
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot
slot = {
dom_type: web_sys::HtmlSlotElement;
attributes { name: String };
events {
/// The slotchange event is fired on an HTMLSlotElement instance
/// (<slot> element) when the node(s) contained in that slot change.
slotchange: web_sys::Event,
};
}
);