Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: LayoutTests/svg/dom/svglist-immutable.html

Issue 1061263005: Throw NoModificationAllowed in SVG*List.removeItem(...) if immutable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Indentation. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/svg/properties/SVGListPropertyTearOffHelper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>SVG*List immutability</title>
3 <script src=../../resources/testharness.js></script>
4 <script src=../../resources/testharnessreport.js></script>
5 <script>
6 var root = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
7 [
8 {
9 element: 'path', attr: 'd', value: 'M0,0l10,10', listName: 'SVGPathSegLi st',
10 accessor: function(elm) { return elm.animatedPathSegList; },
11 constructItem: function(elm) { return elm.createSVGPathSegLinetoAbs(20, 20); }
12 }, {
13 element: 'polygon', attr: 'points', value: '0,0 10,10', listName: 'SVGPo intList',
14 accessor: function(elm) { return elm.animatedPoints; },
15 constructItem: function(elm) { return root.createSVGPoint(); }
16 }, {
17 element: 'text', attr: 'x', value: '0 10', listName: 'SVGLengthList',
18 accessor: function(elm) { return elm.x.animVal; },
19 constructItem: function(elm) { return root.createSVGLength(); }
20 }, {
21 element: 'rect', attr: 'transform', value: 'rotate(0) scale(1)', listNam e: 'SVGTransformList',
22 accessor: function(elm) { return elm.transform.animVal; },
23 constructItem: function(elm) { return root.createSVGTransform(); }
24 }
25 ].forEach(function(testItem) {
26 var element = document.createElementNS('http://www.w3.org/2000/svg', testIte m.element);
27 element.setAttribute(testItem.attr, testItem.value);
28 var list = testItem.accessor(element);
29 var item = testItem.constructItem(element);
30 test(function() {
31 assert_equals(list.length, 2);
32 assert_throws('NoModificationAllowedError', function() { list.clear(); } );
33 assert_throws('NoModificationAllowedError', function() { list.initialize (item); });
34 assert_throws('NoModificationAllowedError', function() { list[0] = item; });
35 assert_throws('NoModificationAllowedError', function() { list.insertItem Before(item, 0); });
36 assert_throws('NoModificationAllowedError', function() { list.replaceIte m(item, 0); });
37 assert_throws('NoModificationAllowedError', function() { list.removeItem (0); });
38 assert_throws('NoModificationAllowedError', function() { list.appendItem (item); });
39 }, document.title + ', ' + testItem.listName);
40 });
41 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/svg/properties/SVGListPropertyTearOffHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698