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

Side by Side Diff: LayoutTests/fast/dom/script-tests/event-handlers.js

Issue 48303003: Handle the onerror content attribute for <body> and <frameset> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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
OLDNEW
1 function getObject(interface) { 1 function getObject(interface) {
2 switch(interface) { 2 switch(interface) {
3 case "Element": 3 case "Element":
4 var e = document.createElementNS("http://example.com/", "example"); 4 var e = document.createElementNS("http://example.com/", "example");
5 assert_true(e instanceof Element); 5 assert_true(e instanceof Element);
6 assert_false(e instanceof HTMLElement); 6 assert_false(e instanceof HTMLElement);
7 assert_false(e instanceof SVGElement); 7 assert_false(e instanceof SVGElement);
8 return e; 8 return e;
9 case "HTMLElement": 9 case "HTMLElement":
10 var e = document.createElement("html"); 10 var e = document.createElement("html");
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 function testReflect(interface, attribute) { 51 function testReflect(interface, attribute) {
52 test(function() { 52 test(function() {
53 var element = getObject(interface); 53 var element = getObject(interface);
54 assert_false(element.hasAttribute(attribute), "Initially missing"); 54 assert_false(element.hasAttribute(attribute), "Initially missing");
55 element.setAttribute(attribute, "return"); 55 element.setAttribute(attribute, "return");
56 assert_equals(element.getAttribute(attribute), "return", "Return same st ring"); 56 assert_equals(element.getAttribute(attribute), "return", "Return same st ring");
57 assert_equals(typeof element[attribute], "function", "Convert to functio n"); 57 assert_equals(typeof element[attribute], "function", "Convert to functio n");
58 element.removeAttribute(attribute); 58 element.removeAttribute(attribute);
59 }, "Reflect " + interface + "." + attribute); 59 }, "Reflect " + interface + "." + attribute);
60 } 60 }
61 function testForwardToWindow(interface, attribute) {
62 test(function() {
63 var element = getObject(interface);
64 window[attribute] = null;
65 element.setAttribute(attribute, "return");
66 assert_equals(typeof window[attribute], "function", "Convert to function ");
67 assert_equals(window[attribute], element[attribute], "Forward content at tribute");
68 function nop() {}
69 element[attribute] = nop;
70 assert_equals(window[attribute], nop, "Forward IDL attribute");
71 window[attribute] = null;
72 }, "Forward " + interface + "." + attribute + " to Window");
73 }
61 // Object.propertyIsEnumerable cannot be used because it doesn't 74 // Object.propertyIsEnumerable cannot be used because it doesn't
62 // work with properties inherited through the prototype chain. 75 // work with properties inherited through the prototype chain.
63 function getEnumerable(interface) { 76 function getEnumerable(interface) {
64 var enumerable = {}; 77 var enumerable = {};
65 for (var attribute in getObject(interface)) { 78 for (var attribute in getObject(interface)) {
66 enumerable[attribute] = true; 79 enumerable[attribute] = true;
67 } 80 }
68 return enumerable; 81 return enumerable;
69 } 82 }
70 var enumerableCache = {}; 83 var enumerableCache = {};
71 function testEnumerate(interface, attribute) { 84 function testEnumerate(interface, attribute) {
72 if (!(interface in enumerableCache)) { 85 if (!(interface in enumerableCache)) {
73 enumerableCache[interface] = getEnumerable(interface); 86 enumerableCache[interface] = getEnumerable(interface);
74 } 87 }
75 test(function() { 88 test(function() {
76 assert_true(enumerableCache[interface][attribute]); 89 assert_true(enumerableCache[interface][attribute]);
77 }, "Enumerate " + interface + "." + attribute); 90 }, "Enumerate " + interface + "." + attribute);
78 } 91 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/body-frameset-event-handlers-expected.txt ('k') | Source/core/html/HTMLBodyElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698