Changeset 153495 in webkit
- Timestamp:
- Jul 30, 2013, 2:44:51 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r153480 r153495 1 2013-07-30 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 3 Add 'colno' attribute to ErrorEvent interface 4 https://bugs.webkit.org/show_bug.cgi?id=119257 5 6 Reviewed by Darin Adler. 7 8 Update several test cases to check the new ErrorEvent.colno 9 attribute. 10 11 * fast/events/constructors/error-event-constructor-expected.txt: 12 * fast/events/constructors/error-event-constructor.html: 13 * fast/events/window-onerror9-expected.txt: 14 * fast/events/window-onerror9.html: 15 * fast/workers/worker-script-error-expected.txt: 16 * fast/workers/worker-script-error.html: 17 * http/tests/workers/worker-importScriptsOnError-expected.txt: 18 1 19 2013-07-30 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 20 -
trunk/LayoutTests/fast/events/constructors/error-event-constructor-expected.txt
r95352 r153495 61 61 PASS new ErrorEvent('eventType', { lineno: {moemoe: 12345} }).lineno is 0 62 62 PASS new ErrorEvent('eventType', { lineno: {valueOf: function () { return 12345; }} }).lineno is 12345 63 PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).bubbles is true 64 PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).cancelable is true 65 PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).message is "sakuranbo" 66 PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).filename is "amaenbo" 67 PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).lineno is 12345 63 PASS new ErrorEvent('eventType', { colno: 0 }).colno is 0 64 PASS new ErrorEvent('eventType', { colno: 1 }).colno is 1 65 PASS new ErrorEvent('eventType', { colno: 4294967294 }).colno is 4294967294 66 PASS new ErrorEvent('eventType', { colno: 4294967295 }).colno is 4294967295 67 PASS new ErrorEvent('eventType', { colno: 9007199254740991 }).colno is 4294967295 68 PASS new ErrorEvent('eventType', { colno: 18446744073709551615 }).colno is 0 69 PASS new ErrorEvent('eventType', { colno: 12345678901234567890 }).colno is 3944679424 70 PASS new ErrorEvent('eventType', { colno: -1 }).colno is 4294967295 71 PASS new ErrorEvent('eventType', { colno: 123.45 }).colno is 123 72 PASS new ErrorEvent('eventType', { colno: NaN }).colno is 0 73 PASS new ErrorEvent('eventType', { colno: undefined }).colno is 0 74 PASS new ErrorEvent('eventType', { colno: null }).colno is 0 75 PASS new ErrorEvent('eventType', { colno: '' }).colno is 0 76 PASS new ErrorEvent('eventType', { colno: '12345' }).colno is 12345 77 PASS new ErrorEvent('eventType', { colno: '12345a' }).colno is 0 78 PASS new ErrorEvent('eventType', { colno: 'abc' }).colno is 0 79 PASS new ErrorEvent('eventType', { colno: [] }).colno is 0 80 PASS new ErrorEvent('eventType', { colno: [12345] }).colno is 12345 81 PASS new ErrorEvent('eventType', { colno: [12345, 67890] }).colno is 0 82 PASS new ErrorEvent('eventType', { colno: {} }).colno is 0 83 PASS new ErrorEvent('eventType', { colno: {moemoe: 12345} }).colno is 0 84 PASS new ErrorEvent('eventType', { colno: {valueOf: function () { return 12345; }} }).colno is 12345 85 PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).bubbles is true 86 PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).cancelable is true 87 PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).message is "sakuranbo" 88 PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).filename is "amaenbo" 89 PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).lineno is 12345 90 PASS new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).colno is 23456 68 91 PASS successfullyParsed is true 69 92 -
trunk/LayoutTests/fast/events/constructors/error-event-constructor.html
r98407 r153495 75 75 shouldBe("new ErrorEvent('eventType', { lineno: {valueOf: function () { return 12345; }} }).lineno", "12345"); 76 76 77 // colno is passed. 78 // numbers within the unsigned long range. 79 shouldBe("new ErrorEvent('eventType', { colno: 0 }).colno", "0"); 80 shouldBe("new ErrorEvent('eventType', { colno: 1 }).colno", "1"); 81 shouldBe("new ErrorEvent('eventType', { colno: 4294967294 }).colno", "4294967294"); 82 shouldBe("new ErrorEvent('eventType', { colno: 4294967295 }).colno", "4294967295"); 83 84 // numbers out of the unsigned long range. 85 // 2^{53}-1, the largest number that can be exactly represented by double. 86 shouldBe("new ErrorEvent('eventType', { colno: 9007199254740991 }).colno", "4294967295"); 87 // 2^{64}-1 88 shouldBe("new ErrorEvent('eventType', { colno: 18446744073709551615 }).colno", "0"); 89 shouldBe("new ErrorEvent('eventType', { colno: 12345678901234567890 }).colno", "3944679424"); 90 shouldBe("new ErrorEvent('eventType', { colno: -1 }).colno", "4294967295"); 91 shouldBe("new ErrorEvent('eventType', { colno: 123.45 }).colno", "123"); 92 shouldBe("new ErrorEvent('eventType', { colno: NaN }).colno", "0"); 93 94 // Non-numeric values. 95 shouldBe("new ErrorEvent('eventType', { colno: undefined }).colno", "0"); 96 shouldBe("new ErrorEvent('eventType', { colno: null }).colno", "0"); 97 shouldBe("new ErrorEvent('eventType', { colno: '' }).colno", "0"); 98 shouldBe("new ErrorEvent('eventType', { colno: '12345' }).colno", "12345"); 99 shouldBe("new ErrorEvent('eventType', { colno: '12345a' }).colno", "0"); 100 shouldBe("new ErrorEvent('eventType', { colno: 'abc' }).colno", "0"); 101 shouldBe("new ErrorEvent('eventType', { colno: [] }).colno", "0"); 102 shouldBe("new ErrorEvent('eventType', { colno: [12345] }).colno", "12345"); 103 shouldBe("new ErrorEvent('eventType', { colno: [12345, 67890] }).colno", "0"); 104 shouldBe("new ErrorEvent('eventType', { colno: {} }).colno", "0"); 105 shouldBe("new ErrorEvent('eventType', { colno: {moemoe: 12345} }).colno", "0"); 106 shouldBe("new ErrorEvent('eventType', { colno: {valueOf: function () { return 12345; }} }).colno", "12345"); 107 77 108 // All initializers are passed. 78 shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).bubbles", "true"); 79 shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).cancelable", "true"); 80 shouldBeEqualToString("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).message", "sakuranbo"); 81 shouldBeEqualToString("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).filename", "amaenbo"); 82 shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).lineno", "12345"); 109 shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).bubbles", "true"); 110 shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).cancelable", "true"); 111 shouldBeEqualToString("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).message", "sakuranbo"); 112 shouldBeEqualToString("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).filename", "amaenbo"); 113 shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).lineno", "12345"); 114 shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).colno", "23456"); 83 115 </script> 84 116 <script src="../../js/resources/js-test-post.js"></script> -
trunk/LayoutTests/fast/events/window-onerror9-expected.txt
r153480 r153495 1 1 Test that when window.onerror handler is called, window.event is the corresponding ErrorEvent object. Bug 8519. 2 2 3 Main frame window.onerror: Error: 2010 at window-onerror9.html, line: 3 1, column: 223 Main frame window.onerror: Error: 2010 at window-onerror9.html, line: 32, column: 22 4 4 window.event.type = error 5 5 window.event.message = Error: 2010 6 6 window.event.filename = window-onerror9.html 7 window.event.lineno = 31 7 window.event.lineno = 32 8 window.event.colno = 22 8 9 -
trunk/LayoutTests/fast/events/window-onerror9.html
r153480 r153495 24 24 log("window.event.filename = " + lastPathComponent(window.event.filename)); 25 25 log("window.event.lineno = " + window.event.lineno); 26 log("window.event.colno = " + window.event.colno); 26 27 if (window.testRunner) 27 28 testRunner.notifyDone(); -
trunk/LayoutTests/fast/workers/worker-script-error-expected.txt
r153480 r153495 3 3 4 4 PASS: onerror invoked for a script that has invalid syntax. 5 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1 .6 PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1 .7 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7 .8 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: bar' at line 3 .5 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1 and column 4. 6 PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1 and column 4. 7 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7 and column 4. 8 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: bar' at line 3 and column 8. 9 9 message from worker: "PASS: onerror in worker context invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 10 in worker-script-error-bubbled.js". 10 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 10 .11 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 10 .10 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 10 and column 4. 11 PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 10 and column 4. 12 12 PASS: message received from WorkerGlobalScope.onerror: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 7 and column 14. 13 13 PASS: onerror invoked for an exception in setTimeout callback. -
trunk/LayoutTests/fast/workers/worker-script-error.html
r124680 r153495 52 52 var worker = new Worker("resources/worker-script-error-unhandled.js"); 53 53 worker.onerror = function(evt) { 54 log("PASS: onerror invoked for a script that has script error '" + evt.message + "' at line " + evt.lineno + " .");54 log("PASS: onerror invoked for a script that has script error '" + evt.message + "' at line " + evt.lineno + " and column " + evt.colno + "."); 55 55 runNextTest(); 56 56 return false; … … 68 68 worker.addEventListener("error", 69 69 function(evt) { 70 log("PASS: event listener invoked for a script that has script error '" + evt.message + "' at line " + evt.lineno + " .");70 log("PASS: event listener invoked for a script that has script error '" + evt.message + "' at line " + evt.lineno + " and column " + evt.colno + "."); 71 71 runNextTest(); 72 72 evt.preventDefault(); … … 84 84 var errorCount = 0; 85 85 worker.onerror = function(evt) { 86 log("PASS: onerror invoked for a script that has script error '" + evt.message + "' at line " + evt.lineno + " .");86 log("PASS: onerror invoked for a script that has script error '" + evt.message + "' at line " + evt.lineno + " and column " + evt.colno + "."); 87 87 ++errorCount; 88 88 // Second error happens in the onerror handler. Run next test only when it's reported. … … 105 105 } 106 106 worker.onerror = function(evt) { 107 log("PASS: onerror invoked for a script that has script error '" + evt.message + "' at line " + evt.lineno + " .");107 log("PASS: onerror invoked for a script that has script error '" + evt.message + "' at line " + evt.lineno + " and column " + evt.colno + "."); 108 108 runNextTest(); 109 109 return false; … … 120 120 var worker = new Worker("resources/worker-script-error-bubbled.js"); 121 121 worker.onerror = function(evt) { 122 log("PASS: onerror invoked for a script that has script error '" + evt.message + "' at line " + evt.lineno + " .");122 log("PASS: onerror invoked for a script that has script error '" + evt.message + "' at line " + evt.lineno + " and column " + evt.colno + "."); 123 123 runNextTest(); 124 124 return true; … … 135 135 var worker = new Worker("resources/worker-script-error-handled.js"); 136 136 worker.onerror = function(evt) { 137 log("FAIL: onerror invoked for a script that has script error '" + evt.message + "' at line " + evt.lineno + " .");137 log("FAIL: onerror invoked for a script that has script error '" + evt.message + "' at line " + evt.lineno + " and column " + evt.colno + "."); 138 138 runNextTest(); 139 139 return false; -
trunk/LayoutTests/http/tests/workers/worker-importScriptsOnError-expected.txt
r116070 r153495 27 27 cancelable: true, 28 28 clipboardData: undefined, 29 colno: 0, 29 30 currentTarget: [object Worker], 30 31 defaultPrevented: false, -
trunk/Source/WebCore/ChangeLog
r153494 r153495 1 2013-07-30 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 3 Add 'colno' attribute to ErrorEvent interface 4 https://bugs.webkit.org/show_bug.cgi?id=119257 5 6 Reviewed by Darin Adler. 7 8 Add 'colno' attribute to ErrorEvent interface to match the latest specification: 9 http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#errorevent 10 11 The 'colno' attribute is already supported by IE10 and Blink. 12 13 No new tests, covered by existing tests. 14 15 * dom/ErrorEvent.cpp: 16 (WebCore::ErrorEventInit::ErrorEventInit): 17 (WebCore::ErrorEvent::ErrorEvent): 18 * dom/ErrorEvent.h: 19 * dom/ErrorEvent.idl: 20 1 21 2013-07-30 Andreas Kling <akling@apple.com> 2 22 -
trunk/Source/WebCore/dom/ErrorEvent.cpp
r153480 r153495 40 40 , filename() 41 41 , lineno(0) 42 , colno(0) 42 43 { 43 44 } … … 52 53 , m_fileName(initializer.filename) 53 54 , m_lineNumber(initializer.lineno) 54 , m_columnNumber( 0)55 , m_columnNumber(initializer.colno) 55 56 { 56 57 } -
trunk/Source/WebCore/dom/ErrorEvent.h
r153480 r153495 43 43 String filename; 44 44 unsigned lineno; 45 unsigned colno; 45 46 }; 46 47 -
trunk/Source/WebCore/dom/ErrorEvent.idl
r131172 r153495 36 36 [InitializedByEventConstructor] readonly attribute DOMString filename; 37 37 [InitializedByEventConstructor] readonly attribute unsigned long lineno; 38 [InitializedByEventConstructor] readonly attribute unsigned long colno; 38 39 }; 39 40
Note:
See TracChangeset
for help on using the changeset viewer.