| OLD | NEW |
| (Empty) |
| 1 description("HTMLFontElement size attribute test"); | |
| 2 | |
| 3 function fontSizeAttributeEffect(value) | |
| 4 { | |
| 5 var element = document.createElement("font"); | |
| 6 element.setAttribute("size", value); | |
| 7 var outerElement = document.createElement("p"); | |
| 8 outerElement.setAttribute("style", "font-size: 100px"); | |
| 9 document.body.appendChild(outerElement); | |
| 10 outerElement.appendChild(element); | |
| 11 var computedStyle = getComputedStyle(element, ""); | |
| 12 var result = computedStyle.fontSize; | |
| 13 document.body.removeChild(outerElement); | |
| 14 return result === "100px" ? null : result; | |
| 15 } | |
| 16 | |
| 17 shouldBe('fontSizeAttributeEffect("")', 'null'); | |
| 18 | |
| 19 shouldBe('fontSizeAttributeEffect("1")', '"10px"'); | |
| 20 shouldBe('fontSizeAttributeEffect("2")', '"13px"'); | |
| 21 shouldBe('fontSizeAttributeEffect("3")', '"16px"'); | |
| 22 shouldBe('fontSizeAttributeEffect("4")', '"18px"'); | |
| 23 shouldBe('fontSizeAttributeEffect("5")', '"24px"'); | |
| 24 shouldBe('fontSizeAttributeEffect("6")', '"32px"'); | |
| 25 shouldBe('fontSizeAttributeEffect("7")', '"48px"'); | |
| 26 | |
| 27 shouldBe('fontSizeAttributeEffect("0")', '"10px"'); | |
| 28 | |
| 29 shouldBe('fontSizeAttributeEffect("-1")', '"13px"'); | |
| 30 shouldBe('fontSizeAttributeEffect("-2")', '"10px"'); | |
| 31 shouldBe('fontSizeAttributeEffect("-3")', '"10px"'); | |
| 32 shouldBe('fontSizeAttributeEffect("-4")', '"10px"'); | |
| 33 shouldBe('fontSizeAttributeEffect("-5")', '"10px"'); | |
| 34 shouldBe('fontSizeAttributeEffect("-6")', '"10px"'); | |
| 35 shouldBe('fontSizeAttributeEffect("-7")', '"10px"'); | |
| 36 shouldBe('fontSizeAttributeEffect("-8")', '"10px"'); | |
| 37 shouldBe('fontSizeAttributeEffect("-9")', '"10px"'); | |
| 38 shouldBe('fontSizeAttributeEffect("-10")', '"10px"'); | |
| 39 | |
| 40 shouldBe('fontSizeAttributeEffect("x6")', 'null'); | |
| 41 shouldBe('fontSizeAttributeEffect(" 6")', '"32px"'); | |
| 42 shouldBe('fontSizeAttributeEffect("\\t6")', '"32px"'); | |
| 43 shouldBe('fontSizeAttributeEffect("\\r6")', '"32px"'); | |
| 44 shouldBe('fontSizeAttributeEffect("\\n6")', '"32px"'); | |
| 45 shouldBe('fontSizeAttributeEffect("\\u20086")', 'null'); | |
| 46 | |
| 47 shouldBe('fontSizeAttributeEffect("x-6")', 'null'); | |
| 48 shouldBe('fontSizeAttributeEffect(" -6")', '"10px"'); | |
| 49 shouldBe('fontSizeAttributeEffect("\\t-6")', '"10px"'); | |
| 50 shouldBe('fontSizeAttributeEffect("\\r-6")', '"10px"'); | |
| 51 shouldBe('fontSizeAttributeEffect("\\n-6")', '"10px"'); | |
| 52 shouldBe('fontSizeAttributeEffect("\\u2008-6")', 'null'); | |
| 53 | |
| 54 shouldBe('fontSizeAttributeEffect("x+6")', 'null'); | |
| 55 shouldBe('fontSizeAttributeEffect(" +6")', '"48px"'); | |
| 56 shouldBe('fontSizeAttributeEffect("\\t+6")', '"48px"'); | |
| 57 shouldBe('fontSizeAttributeEffect("\\r+6")', '"48px"'); | |
| 58 shouldBe('fontSizeAttributeEffect("\\n+6")', '"48px"'); | |
| 59 shouldBe('fontSizeAttributeEffect("\\u2008+6")', 'null'); | |
| 60 | |
| 61 shouldBe('fontSizeAttributeEffect("x+x6")', 'null'); | |
| 62 shouldBe('fontSizeAttributeEffect(" + 6")', 'null'); | |
| 63 shouldBe('fontSizeAttributeEffect("\\t+\\t6")', 'null'); | |
| 64 shouldBe('fontSizeAttributeEffect("\\r+\\r6")', 'null'); | |
| 65 shouldBe('fontSizeAttributeEffect("\\n+\\n6")', 'null'); | |
| 66 shouldBe('fontSizeAttributeEffect("\\u2008+\\u20086")', 'null'); | |
| 67 | |
| 68 shouldBe('fontSizeAttributeEffect("x-x6")', 'null'); | |
| 69 shouldBe('fontSizeAttributeEffect(" - 6")', 'null'); | |
| 70 shouldBe('fontSizeAttributeEffect("\\t-\\t6")', 'null'); | |
| 71 shouldBe('fontSizeAttributeEffect("\\r-\\r6")', 'null'); | |
| 72 shouldBe('fontSizeAttributeEffect("\\n-\\n6")', 'null'); | |
| 73 shouldBe('fontSizeAttributeEffect("\\u2008-\\u20086")', 'null'); | |
| 74 | |
| 75 shouldBe('fontSizeAttributeEffect("8")', '"48px"'); | |
| 76 shouldBe('fontSizeAttributeEffect("9")', '"48px"'); | |
| 77 shouldBe('fontSizeAttributeEffect("10")', '"48px"'); | |
| 78 shouldBe('fontSizeAttributeEffect("100")', '"48px"'); | |
| 79 shouldBe('fontSizeAttributeEffect("1000")', '"48px"'); | |
| 80 | |
| 81 shouldBe('fontSizeAttributeEffect("1x")', '"10px"'); | |
| 82 shouldBe('fontSizeAttributeEffect("1.")', '"10px"'); | |
| 83 shouldBe('fontSizeAttributeEffect("1.9")', '"10px"'); | |
| 84 shouldBe('fontSizeAttributeEffect("2x")', '"13px"'); | |
| 85 shouldBe('fontSizeAttributeEffect("2.")', '"13px"'); | |
| 86 shouldBe('fontSizeAttributeEffect("2.9")', '"13px"'); | |
| 87 | |
| 88 shouldBe('fontSizeAttributeEffect("a")', 'null'); | |
| 89 | |
| 90 var arabicIndicDigitOne = String.fromCharCode(0x661); | |
| 91 shouldBe('fontSizeAttributeEffect(arabicIndicDigitOne)', 'null'); | |
| OLD | NEW |