@@ -1399,7 +1399,7 @@ describe("font", () => {
1399
1399
testImplicitPropertyValue (
1400
1400
"font" ,
1401
1401
'normal medium Times, "Times New Roman", Georgia, serif' ,
1402
- 'normal medium Times, "Times New Roman", Georgia, serif' ,
1402
+ 'medium Times, "Times New Roman", Georgia, serif' ,
1403
1403
new Map ( [
1404
1404
[ "font-style" , "normal" ] ,
1405
1405
[ "font-variant" , "normal" ] ,
@@ -1411,14 +1411,174 @@ describe("font", () => {
1411
1411
) ;
1412
1412
} ) ;
1413
1413
1414
+ it ( "font shorthand should set / get values" , ( ) => {
1415
+ testImplicitPropertyValue (
1416
+ "font" ,
1417
+ "normal medium Gill Sans Extrabold, sans-serif" ,
1418
+ "medium Gill Sans Extrabold, sans-serif" ,
1419
+ new Map ( [
1420
+ [ "font-style" , "normal" ] ,
1421
+ [ "font-variant" , "normal" ] ,
1422
+ [ "font-weight" , "normal" ] ,
1423
+ [ "font-size" , "medium" ] ,
1424
+ [ "line-height" , "normal" ] ,
1425
+ [ "font-family" , "Gill Sans Extrabold, sans-serif" ]
1426
+ ] )
1427
+ ) ;
1428
+ } ) ;
1429
+
1430
+ it ( "font shorthand should set / get values" , ( ) => {
1431
+ testImplicitPropertyValue (
1432
+ "font" ,
1433
+ 'normal medium "Goudy Bookletter 1911", sans-serif' ,
1434
+ 'medium "Goudy Bookletter 1911", sans-serif' ,
1435
+ new Map ( [
1436
+ [ "font-style" , "normal" ] ,
1437
+ [ "font-variant" , "normal" ] ,
1438
+ [ "font-weight" , "normal" ] ,
1439
+ [ "font-size" , "medium" ] ,
1440
+ [ "line-height" , "normal" ] ,
1441
+ [ "font-family" , '"Goudy Bookletter 1911", sans-serif' ]
1442
+ ] )
1443
+ ) ;
1444
+ } ) ;
1445
+
1446
+ it ( "font shorthand should not set / get invalid values" , ( ) => {
1447
+ testImplicitPropertyValue (
1448
+ "font" ,
1449
+ "normal medium Goudy Bookletter 1911, sans-serif" ,
1450
+ "" ,
1451
+ new Map ( [
1452
+ [ "font-style" , "" ] ,
1453
+ [ "font-variant" , "" ] ,
1454
+ [ "font-weight" , "" ] ,
1455
+ [ "font-size" , "" ] ,
1456
+ [ "line-height" , "" ] ,
1457
+ [ "font-family" , "" ]
1458
+ ] )
1459
+ ) ;
1460
+ } ) ;
1461
+
1462
+ it ( "font shorthand should not set / get invalid values" , ( ) => {
1463
+ testImplicitPropertyValue (
1464
+ "font" ,
1465
+ "normal medium Red/Black, sans-serif" ,
1466
+ "" ,
1467
+ new Map ( [
1468
+ [ "font-style" , "" ] ,
1469
+ [ "font-variant" , "" ] ,
1470
+ [ "font-weight" , "" ] ,
1471
+ [ "font-size" , "" ] ,
1472
+ [ "line-height" , "" ] ,
1473
+ [ "font-family" , "" ]
1474
+ ] )
1475
+ ) ;
1476
+ } ) ;
1477
+
1478
+ it ( "font shorthand should not set / get invalid values" , ( ) => {
1479
+ testImplicitPropertyValue (
1480
+ "font" ,
1481
+ 'normal medium "Lucida" Grande, sans-serif' ,
1482
+ "" ,
1483
+ new Map ( [
1484
+ [ "font-style" , "" ] ,
1485
+ [ "font-variant" , "" ] ,
1486
+ [ "font-weight" , "" ] ,
1487
+ [ "font-size" , "" ] ,
1488
+ [ "line-height" , "" ] ,
1489
+ [ "font-family" , "" ]
1490
+ ] )
1491
+ ) ;
1492
+ } ) ;
1493
+
1494
+ it ( "font shorthand should not set / get invalid values" , ( ) => {
1495
+ testImplicitPropertyValue (
1496
+ "font" ,
1497
+ 'normal medium Lucida "Grande", sans-serif' ,
1498
+ "" ,
1499
+ new Map ( [
1500
+ [ "font-style" , "" ] ,
1501
+ [ "font-variant" , "" ] ,
1502
+ [ "font-weight" , "" ] ,
1503
+ [ "font-size" , "" ] ,
1504
+ [ "line-height" , "" ] ,
1505
+ [ "font-family" , "" ]
1506
+ ] )
1507
+ ) ;
1508
+ } ) ;
1509
+
1510
+ it ( "font shorthand should not set / get invalid values" , ( ) => {
1511
+ testImplicitPropertyValue (
1512
+ "font" ,
1513
+ "normal medium Ahem!, sans-serif" ,
1514
+ "" ,
1515
+ new Map ( [
1516
+ [ "font-style" , "" ] ,
1517
+ [ "font-variant" , "" ] ,
1518
+ [ "font-weight" , "" ] ,
1519
+ [ "font-size" , "" ] ,
1520
+ [ "line-height" , "" ] ,
1521
+ [ "font-family" , "" ]
1522
+ ] )
1523
+ ) ;
1524
+ } ) ;
1525
+
1526
+ it ( "font shorthand should not set / get invalid values" , ( ) => {
1527
+ testImplicitPropertyValue (
1528
+ "font" ,
1529
+ "normal medium test@foo, sans-serif" ,
1530
+ "" ,
1531
+ new Map ( [
1532
+ [ "font-style" , "" ] ,
1533
+ [ "font-variant" , "" ] ,
1534
+ [ "font-weight" , "" ] ,
1535
+ [ "font-size" , "" ] ,
1536
+ [ "line-height" , "" ] ,
1537
+ [ "font-family" , "" ]
1538
+ ] )
1539
+ ) ;
1540
+ } ) ;
1541
+
1542
+ it ( "font shorthand should not set / get invalid values" , ( ) => {
1543
+ testImplicitPropertyValue (
1544
+ "font" ,
1545
+ "normal medium #POUND, sans-serif" ,
1546
+ "" ,
1547
+ new Map ( [
1548
+ [ "font-style" , "" ] ,
1549
+ [ "font-variant" , "" ] ,
1550
+ [ "font-weight" , "" ] ,
1551
+ [ "font-size" , "" ] ,
1552
+ [ "line-height" , "" ] ,
1553
+ [ "font-family" , "" ]
1554
+ ] )
1555
+ ) ;
1556
+ } ) ;
1557
+
1558
+ it ( "font shorthand should not set / get invalid values" , ( ) => {
1559
+ testImplicitPropertyValue (
1560
+ "font" ,
1561
+ "normal medium Hawaii 5-0, sans-serif" ,
1562
+ "" ,
1563
+ new Map ( [
1564
+ [ "font-style" , "" ] ,
1565
+ [ "font-variant" , "" ] ,
1566
+ [ "font-weight" , "" ] ,
1567
+ [ "font-size" , "" ] ,
1568
+ [ "line-height" , "" ] ,
1569
+ [ "font-family" , "" ]
1570
+ ] )
1571
+ ) ;
1572
+ } ) ;
1573
+
1414
1574
it ( "font shorthand should set / get values" , ( ) => {
1415
1575
testImplicitPropertyValue (
1416
1576
"font" ,
1417
1577
'italic bold medium/1.2 Times, "Times New Roman", Georgia, serif' ,
1418
1578
'italic bold medium / 1.2 Times, "Times New Roman", Georgia, serif' ,
1419
1579
new Map ( [
1420
1580
[ "font-style" , "italic" ] ,
1421
- [ "font-variant" , "" ] ,
1581
+ [ "font-variant" , "normal " ] ,
1422
1582
[ "font-weight" , "bold" ] ,
1423
1583
[ "font-size" , "medium" ] ,
1424
1584
[ "line-height" , "1.2" ] ,
@@ -1434,7 +1594,7 @@ describe("font", () => {
1434
1594
'italic bold calc(1.5em) / 1.2 Times, "Times New Roman", Georgia, serif' ,
1435
1595
new Map ( [
1436
1596
[ "font-style" , "italic" ] ,
1437
- [ "font-variant" , "" ] ,
1597
+ [ "font-variant" , "normal " ] ,
1438
1598
[ "font-weight" , "bold" ] ,
1439
1599
[ "font-size" , "calc(1.5em)" ] ,
1440
1600
[ "line-height" , "1.2" ] ,
0 commit comments