id | Code | Result | Note |
test1 | document.getElementById("test1").getBBox().width | | Integer in Chrome; Float in IE and Firefox. |
test2 | document.getElementById("test2").getBBox().width | | Integer in Chrome; Float in IE and Firefox. |
test3 | document.getElementById("test3").getBBox().width | | IE and Firefox can't get the BBox of a TSPAN and error out. |
test4 | document.getElementById("test4").getBBox().width | | IE and Firefox can't get the BBox of a TSPAN whether it's inside a TEXT or not. |
|
test1 | document.getElementById("test1").getBoundingClientRect().width | | Integer in IE, Chrome and Safari. Same width as "test2" in Chrome eventhough 1 is narrower than 2. |
test2 | document.getElementById("test2").getBoundingClientRect().width | | Integer in IE, Chrome and Safari. Same width as "test1" in Chrome eventhough 2 is wider than 1. |
test3 | document.getElementById("test3").getBoundingClientRect().width | | Integer in Chrome and Safari. |
test4 | document.getElementById("test4").getBoundingClientRect().width | | Integer in Chrome and Safari. |
|
test1 | document.getElementById("test1").getComputedTextLength() | | Integer in Chrome; Float in IE and Firefox. |
test2 | document.getElementById("test2").getComputedTextLength() | | Integer in Chrome; Float in IE and Firefox. |
test3 | document.getElementById("test3").getComputedTextLength() | | Integer in Chrome; Float in IE and Firefox. |
test4 | document.getElementById("test4").getComputedTextLength() | | A TSPAN which is not in a TEXT has no width |