Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>document.getElementsByTagName and foreign parser-inserted
elements</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="test">
<svg>
<altglyph/>
<altglyphdef/>
<altglyphitem/>
<animatecolor/>
<animatemotion/>
<animatetransform/>
<clippath/>
<feblend/>
<fecolormatrix/>
<fecomponenttransfer/>
<fecomposite/>
<feconvolvematrix/>
<fediffuselighting/>
<fedisplacementmap/>
<fedistantlight/>
<feflood/>
<fefunca/>
<fefuncb/>
<fefuncg/>
<fefuncr/>
<fegaussianblur/>
<feimage/>
<femerge/>
<femergenode/>
<femorphology/>
<feoffset/>
<fepointlight/>
<fespecularlighting/>
<fespotlight/>
<fetile/>
<feturbulence/>
<foreignobject/>
<glyphref/>
<lineargradient/>
<radialgradient/>
<textpath/>
<ALTGLYPH/>
<ALTGLYPHDEF/>
<ALTGLYPHITEM/>
<ANIMATECOLOR/>
<ANIMATEMOTION/>
<ANIMATETRANSFORM/>
<CLIPPATH/>
<FEBLEND/>
<FECOLORMATRIX/>
<FECOMPONENTTRANSFER/>
<FECOMPOSITE/>
<FECONVOLVEMATRIX/>
<FEDIFFUSELIGHTING/>
<FEDISPLACEMENTMAP/>
<FEDISTANTLIGHT/>
<FEFLOOD/>
<FEFUNCA/>
<FEFUNCB/>
<FEFUNCG/>
<FEFUNCR/>
<FEGAUSSIANBLUR/>
<FEIMAGE/>
<FEMERGE/>
<FEMERGENODE/>
<FEMORPHOLOGY/>
<FEOFFSET/>
<FEPOINTLIGHT/>
<FESPECULARLIGHTING/>
<FESPOTLIGHT/>
<FETILE/>
<FETURBULENCE/>
<FOREIGNOBJECT/>
<GLYPHREF/>
<LINEARGRADIENT/>
<RADIALGRADIENT/>
<TEXTPATH/>
</svg>
<script>
var elements = [
"altGlyph",
"altGlyphDef",
"altGlyphItem",
"animateColor",
"animateMotion",
"animateTransform",
"clipPath",
"feBlend",
"feColorMatrix",
"feComponentTransfer",
"feComposite",
"feConvolveMatrix",
"feDiffuseLighting",
"feDisplacementMap",
"feDistantLight",
"feFlood",
"feFuncA",
"feFuncB",
"feFuncG",
"feFuncR",
"feGaussianBlur",
"feImage",
"feMerge",
"feMergeNode",
"feMorphology",
"feOffset",
"fePointLight",
"feSpecularLighting",
"feSpotLight",
"feTile",
"feTurbulence",
"foreignObject",
"glyphRef",
"linearGradient",
"radialGradient",
"textPath"];
</script>
</div>
<script>
function t(el) {
assert_equals(document.getElementsByTagName(el).length, 2);
assert_equals(document.getElementsByTagName(el.toUpperCase()).length, 0);
assert_equals(document.getElementsByTagName(el.toLowerCase()).length, 0);
assert_equals(document.getElementsByTagNameNS(SVG, el).length, 2);
assert_equals(document.getElementsByTagNameNS(SVG, el.toUpperCase()).length, 0);
assert_equals(document.getElementsByTagNameNS(SVG, el.toLowerCase()).length, 0);
}
test(function() {
var tests = [];
assert_equals(document.getElementsByTagName('svg').length, 1);
for (var i = 0, il = elements.length; i < il; ++i) {
tests.push(["Testing " + elements[i], elements[i]]);
}
generate_tests(t, tests);
});
</script>