DXR will be turned off on Tuesday, December 29th. It will redirect to Searchfox.
See the announcement on Discourse.

DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (c68fe15a81fc)

VCS Links

Line Code
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
<!doctype html>
<html>
<html>
<meta charset="utf-8">
<title>Tests that XML and CSS attributeTypes can be switched between.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>

<svg>
</svg>

<script>
<script>
var rootSVGElement = document.querySelector("svg");
var epsilon = 1.0;

// Setup test document
var polygon = createSVGElement("polygon");
var polygon = createSVGElement("polygon");
polygon.setAttribute("id", "polygon");
polygon.setAttribute("points", "100 0 200 0 200 100 100 100");
polygon.setAttribute("fill", "green");
polygon.setAttribute("onclick", "executeTest()");
polygon.setAttribute("onclick", "executeTest()");

var set = createSVGElement("set");
set.setAttribute("id", "set");
set.setAttribute("attributeName", "points");
set.setAttribute("attributeType", "XML");
set.setAttribute("attributeType", "XML");
set.setAttribute("to", "300 0 400 0 400 100 300 100");
set.setAttribute("begin", "0s");
polygon.appendChild(set);
rootSVGElement.appendChild(polygon);


// Setup animation test
function sample1() {
    assert_approx_equals(polygon.animatedPoints.getItem(0).x, 100, epsilon);
    assert_equals(polygon.points.getItem(0).x, 100);
}
}

function sample2() {
    assert_approx_equals(polygon.animatedPoints.getItem(0).x, 300, epsilon);
    // change the animationType to CSS which is invalid.
    set.setAttribute("attributeType", "CSS");
    set.setAttribute("attributeType", "CSS");
}

function sample3() {
    // verify that the animation resets.
    // verify that the animation resets.
    assert_approx_equals(polygon.animatedPoints.getItem(0).x, 100, epsilon);
    // change the animation to a CSS animatable value.
    set.setAttribute("attributeName", "opacity");
    set.setAttribute("to", "0.8");
}

function sample4() {
function sample4() {
    assert_approx_equals(parseFloat(getComputedStyle(polygon).opacity), 0.8, epsilon);
    // change the animation to a non-CSS animatable value.
    set.setAttribute("attributeName", "points");
    set.setAttribute("to", "200 0 300 0 300 100 200 100");
}
}

function sample5() {
    // verify that the animation does not run.
    assert_approx_equals(polygon.animatedPoints.getItem(0).x, 100, epsilon);
    assert_approx_equals(parseFloat(getComputedStyle(polygon).opacity), 1.0, epsilon);
    assert_approx_equals(parseFloat(getComputedStyle(polygon).opacity), 1.0, epsilon);
    // change the animationType to XML which is valid.
    set.setAttribute("attributeType", "XML");
}

function sample6() {
function sample6() {
    assert_approx_equals(polygon.animatedPoints.getItem(0).x, 200, epsilon);
    assert_equals(polygon.points.getItem(0).x, 100);
}


smil_async_test((t) => {
    const expectedValues = [
        // [animationId, time, sampleCallback]
        ["set", 0.0, sample1],
        ["set", 0.5, sample2],
        ["set", 1.0, sample3],
        ["set", 1.5, sample4],
        ["set", 2.0, sample5],
        ["set", 2.5, sample6]
        ["set", 2.5, sample6]
    ];

    runAnimationTest(t, expectedValues);
});


window.clickX = 150;

</script>