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

Unified Diff: LayoutTests/fast/svg/svglist.html

Issue 1102313002: bindings: Move named/indexed attributes to prototype chains. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/svg/svglist-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/svg/svglist.html
diff --git a/LayoutTests/fast/svg/svglist.html b/LayoutTests/fast/svg/svglist.html
index 6cb5c095c44710be8424ce8516487ae3186e8c64..7f821304e4b77c0bc9c36bbd227eba31077939df 100644
--- a/LayoutTests/fast/svg/svglist.html
+++ b/LayoutTests/fast/svg/svglist.html
@@ -1,4 +1,4 @@
-<!doctype html>
+<!doctype html>
<title>SVG*List array method tests</title>
<script src=../../resources/testharness.js></script>
<script src=../../resources/testharnessreport.js></script>
@@ -14,123 +14,123 @@ var polygon = document.getElementById("polygon");
var path = document.getElementById("path");
var text = document.getElementById("text");
function createSVGPoint(x,y) {
- var o;
- try {
- o = new SVGPoint(x,y);
- }
- catch(e) {
- o = svg.createSVGPoint();
- o.x = x;
- o.y = y;
- }
- return o;
+ var o;
+ try {
+ o = new SVGPoint(x,y);
+ }
+ catch(e) {
+ o = svg.createSVGPoint();
+ o.x = x;
+ o.y = y;
+ }
+ return o;
}
function createSVGLength(value) {
- var o;
- try {
- o = new SVGLength(value);
- }
- catch(e) {
- o = svg.createSVGLength();
- o.value = value;
- }
- return o;
+ var o;
+ try {
+ o = new SVGLength(value);
+ }
+ catch(e) {
+ o = svg.createSVGLength();
+ o.value = value;
+ }
+ return o;
}
function createSVGNumber(value) {
- var o;
- try {
- o = new SVGNumber(value);
- }
- catch(e) {
- o = svg.createSVGNumber();
- o.value = value;
- }
- return o;
+ var o;
+ try {
+ o = new SVGNumber(value);
+ }
+ catch(e) {
+ o = svg.createSVGNumber();
+ o.value = value;
+ }
+ return o;
}
function createSVGTransformTranslate(tx,ty) {
- var o;
- try {
- o = new SVGTransform();
- }
- catch(e) {
- o = svg.createSVGTransform();
- }
- o.setTranslate(tx, ty);
- return o;
+ var o;
+ try {
+ o = new SVGTransform();
+ }
+ catch(e) {
+ o = svg.createSVGTransform();
+ }
+ o.setTranslate(tx, ty);
+ return o;
}
var lists = {
- "SVGPointList" :
- { "impl": polygon.points,
- "type": "SVGPoint",
- "length": 10,
- "insert_value": createSVGPoint(5, 5),
- "equals": function(a,b) { return a.x == b.x && a.y == b.y; }
- },
- "SVGStringList" :
- { "impl": polygon.systemLanguage,
- "type": "DOMString",
- "length": 6,
- "insert_value": "uk",
- "equals": function(a,b) { return a == b; }
- },
- "SVGTransformList" :
- { "impl": path.transform.baseVal,
- "type": "SVGTransform",
- "length": 3,
- "insert_value": createSVGTransformTranslate(5,5),
- "equals": function(a,b) { return a.matrix.a == b.matrix.a &&
- a.matrix.b == b.matrix.b &&
- a.matrix.c == b.matrix.c &&
- a.matrix.d == b.matrix.d &&
- a.matrix.e == b.matrix.e &&
- a.matrix.f == b.matrix.f; }
- },
- "SVGPathSegList" :
- { "impl": path.pathSegList,
- "type": "SVGPathSegMovetoAbs",
- "length": 10,
- "insert_value": path.createSVGPathSegMovetoAbs(5,5),
- "equals": function(a,b) { return a.x == b.x && a.y == b.y; }
- },
- "SVGLengthList" :
- { "impl": text.dx.baseVal,
- "type": "SVGLength",
- "length": 20,
- "insert_value": createSVGLength(5),
- "equals": function(a,b) { return a.valueInSpecifiedUnits == b.valueInSpecifiedUnits &&
- a.unitType == b.unitType; }
- },
- "SVGNumberList" :
- { "impl": text.rotate.baseVal,
- "type": "SVGNumber",
- "length": 13,
- "insert_value": createSVGNumber(5),
- "equals": function(a,b) { return a.value == b.value; }
- }
+ "SVGPointList":
+ { "impl": polygon.points,
+ "type": "SVGPoint",
+ "length": 10,
+ "insert_value": createSVGPoint(5, 5),
+ "equals": function(a,b) { return a.x == b.x && a.y == b.y; }
+ },
+ "SVGStringList":
+ { "impl": polygon.systemLanguage,
+ "type": "DOMString",
+ "length": 6,
+ "insert_value": "uk",
+ "equals": function(a,b) { return a == b; }
+ },
+ "SVGTransformList":
+ { "impl": path.transform.baseVal,
+ "type": "SVGTransform",
+ "length": 3,
+ "insert_value": createSVGTransformTranslate(5,5),
+ "equals": function(a,b) { return a.matrix.a == b.matrix.a &&
+ a.matrix.b == b.matrix.b &&
+ a.matrix.c == b.matrix.c &&
+ a.matrix.d == b.matrix.d &&
+ a.matrix.e == b.matrix.e &&
+ a.matrix.f == b.matrix.f; }
+ },
+ "SVGPathSegList":
+ { "impl": path.pathSegList,
+ "type": "SVGPathSegMovetoAbs",
+ "length": 10,
+ "insert_value": path.createSVGPathSegMovetoAbs(5,5),
+ "equals": function(a,b) { return a.x == b.x && a.y == b.y; }
+ },
+ "SVGLengthList":
+ { "impl": text.dx.baseVal,
+ "type": "SVGLength",
+ "length": 20,
+ "insert_value": createSVGLength(5),
+ "equals": function(a,b) { return a.valueInSpecifiedUnits == b.valueInSpecifiedUnits &&
+ a.unitType == b.unitType; }
+ },
+ "SVGNumberList":
+ { "impl": text.rotate.baseVal,
+ "type": "SVGNumber",
+ "length": 13,
+ "insert_value": createSVGNumber(5),
+ "equals": function(a,b) { return a.value == b.value; }
+ }
};
for (list_type in lists) {
- test(function() {
- assert_idl_attribute(lists[list_type].impl, "length");
- }, list_type + " has length attribute");
- test(function() {
- assert_idl_attribute(lists[list_type].impl, "numberOfItems");
- }, list_type + " has numberOfItems attribute");
- test(function() {
- assert_equals(lists[list_type].impl.length, lists[list_type].impl.numberOfItems);
- assert_equals(lists[list_type].impl.length, lists[list_type].length);
- }, list_type + ".length equals " + list_type + ".numberOfItems.");
- test(function() {
- assert_true(lists[list_type].equals(lists[list_type].impl.getItem(0), lists[list_type].impl[0]));
- }, list_type + " has array getter");
- test(function() {
- var old_value = lists[list_type].impl[0];
- var new_value = lists[list_type].insert_value;
- lists[list_type].impl[0] = lists[list_type].insert_value;
- assert_false(lists[list_type].equals(old_value, new_value));
- assert_true(lists[list_type].equals(lists[list_type].impl[0], new_value));
+ test(function() {
+ assert_idl_attribute(lists[list_type].impl, "length");
+ }, list_type + " has length attribute");
+ test(function() {
+ assert_idl_attribute(lists[list_type].impl, "numberOfItems");
+ }, list_type + " has numberOfItems attribute");
+ test(function() {
+ assert_equals(lists[list_type].impl.length, lists[list_type].impl.numberOfItems);
+ assert_equals(lists[list_type].impl.length, lists[list_type].length);
+ }, list_type + ".length equals " + list_type + ".numberOfItems.");
+ test(function() {
+ assert_true(lists[list_type].equals(lists[list_type].impl.getItem(0), lists[list_type].impl[0]));
+ }, list_type + " has array getter");
+ test(function() {
+ var old_value = lists[list_type].impl[0];
+ var new_value = lists[list_type].insert_value;
+ lists[list_type].impl[0] = lists[list_type].insert_value;
+ assert_false(lists[list_type].equals(old_value, new_value));
+ assert_true(lists[list_type].equals(lists[list_type].impl[0], new_value));
assert_equals(lists[list_type].impl.length, lists[list_type].length);
- }, list_type + " has array setter");
+ }, list_type + " has array setter");
}
</script>
« no previous file with comments | « no previous file | LayoutTests/fast/svg/svglist-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698