SVGTextElement.getRotationOfChar() fails (Acid3 bug) Test 79: expected 90, got: 0 - getRotationOfChar(0) failed. function () { // test 79: SVG textPath and getRotationOfChar(), from Erik Dahlstrom // // The getRotationOfChar[4] method fetches the midpoint rotation // of a glyph defined by a character (in this testcase there is // a simple 1:1 correspondence between the two). The path is // defined in the empty.svg file, and consists of first a line // going down, then followed by a line that has a 45 degree // slope and then followed by a horizontal line. The length of // each path segment have been paired with the advance of each // glyph, so that each glyph will be on each of the three // different path segments (see text on a path layout rules[5]). // Thus the rotation of the first glyph is 90 degrees, the // second 45 degrees and the third 0 degrees. // // [4] http://www.w3.org/TR/SVG11/text.html#InterfaceSVGTextContentElement // [5] http://www.w3.org/TR/SVG11/text.html#TextpathLayoutRules var svgns = "http://www.w3.org/2000/svg"; var xlinkns = "http://www.w3.org/1999/xlink"; var svgdoc = kungFuDeathGrip.firstChild.contentDocument; assert(svgdoc, "contentDocument failed on <object> for svg document."); var svg = svgdoc.documentElement; var text = svgdoc.createElementNS(svgns, "text"); text.setAttribute("font-size", "4000"); text.setAttribute("font-family", "ACID3svgfont"); var textpath = svgdoc.createElementNS(svgns, "textPath"); textpath.setAttributeNS(xlinkns, "xlink:href", "#path"); var textContent = svgdoc.createTextNode("abc"); textpath.appendChild(textContent); text.appendChild(textpath); svg.appendChild(text); assertEquals(text.getRotationOfChar(0), 90, "getRotationOfChar(0) failed."); assertEquals(text.getRotationOfChar(1), 45, "getRotationOfChar(1) failed."); assertEquals(text.getRotationOfChar(2), 0, "getRotationOfChar(2) failed."); var code = -1000; try { var val = text.getRotationOfChar(-1) } catch(e) { code = e.code; } assertEquals(code, DOMException.INDEX_SIZE_ERR, "getRotationOfChar #1 exception failed."); code = -1000; try { var val = text.getRotationOfChar(4) } catch(e) { code = e.code; } assertEquals(code, DOMException.INDEX_SIZE_ERR, "getRotationOfChar #2 exception failed."); return 5; },
I don't see where Acid3 ever bothers to load the empty.svg file... so I think this test is invalid.
Right now they're loaded in test 65.
Ok, so the comment in the test is just wrong. it says "empty.svg" when you mean "svg.xml" http://www.hixie.ch/tests/evil/acid/003/svg.xml
It's actually now empty.svg again.
Wow. How entertaining, this test fails intermittently. It seems to succeed on the first load, but fail on any successive reload. Test 79: expected: 90, got: 0 - getRotationOfChar(0) failed. I doubt that has anything to do with the SVG portion of this test.
I think it does have to do with SVG. SVG is reporting an angle of 0 in its own code for the character. I suspect something going wrong with the SVG font, but I'm not sure what.
This was a bug in the test. Eric was right. Because Hixie did not use the custom svg font at all, it never downloaded until attempts were made to use it in tests. But because the font downloaded async it isn't necessarily coming in in time. Acid3 has been changed so that svg.xml now uses the custom font, forcing it to load and delay the onload handler.
The test "Test 78: expected: 90, got: 0 - getRotationOfChar(0) failed." still sometimes fails. The behavior is similar to the one observed in test 80. I think we should reopen the bug to track the issue.
WildFox was having some trouble making the "use the font to delay the onload" handler trick work. Which would suggest that Acid3 is still timing dependent... and that Robert might not be seeing ghosts. :) @hyatt: WildFox said he'd ask you about it tomorrow.
I have not seen this failure at all in the last few weeks.
(In reply to comment #10) > I have not seen this failure at all in the last few weeks. > Darin, I still able to reproduce the problem. Try to reload the Acid3 test a couple of times. The test should shows you 89/100 score sometimes or crash sometimes ;)
I can reproduce this on Qt/Windows CE, here is the exact error; Test 78 failed: expected '90' but got '89.99998474121094' - getRotationOfChar(0) failed. Looks like there is a rounding problem somewhere.
I am not able to reproduce the problem on Mac. However, it's consistently reproducible on Qt Linux (Ubuntu 10.04). I will investigate it.
(In reply to comment #13) > I am not able to reproduce the problem on Mac. However, it's consistently reproducible on Qt Linux (Ubuntu 10.04). I will investigate it. for Qt, this is a regression, introduced by http://trac.webkit.org/changeset/66979 I have a fix on this and going to reopen https://bugs.webkit.org/show_bug.cgi?id=43837
(In reply to comment #14) > (In reply to comment #13) > > I am not able to reproduce the problem on Mac. However, it's consistently reproducible on Qt Linux (Ubuntu 10.04). I will investigate it. > > for Qt, this is a regression, introduced by http://trac.webkit.org/changeset/66979 > I have a fix on this and going to reopen https://bugs.webkit.org/show_bug.cgi?id=43837 The problem I saw on QtLinux is the same as what Zalan is working on. But it's not related to the original problems reported earlier. I will get myself off the hook. :)
I run the test 2 dozen times and can't reproduce it on Mac. Does it still fail for someone else?
Closing the bug now. If someone can reproduce it, or better has a test, please reopen the bug again.