Changeset 65226 in webkit
- Timestamp:
- Aug 12, 2010 2:41:14 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r65224 r65226 1 2010-07-14 Marcus Bulach <bulach@chromium.org> 2 3 Reviewed by darin@apple.com. 4 5 Removes DontCheckEnums from some IDLs and fixes the corresponding enums. 6 https://bugs.webkit.org/show_bug.cgi?id=42278 7 8 This is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=42250: it fixes some IDL/.h and enables generating compile-time checks for enums. 9 10 * fast/events/init-events-expected.txt: 11 * fast/events/script-tests/init-events.js: 12 (createEventHelper): splits event creation so that we can test without init. 13 (testInitEvent): adds test for OverflowEvent creation. 14 1 15 2010-08-12 Philippe Normand <pnormand@igalia.com> 2 16 -
trunk/LayoutTests/fast/events/init-events-expected.txt
r58574 r65226 117 117 PASS testInitEvent('Overflow', '1001, false, false').verticalOverflow is false 118 118 PASS testInitEvent('Overflow', '1001, false, true').verticalOverflow is true 119 PASS createEventHelper('Overflow').orient is OverflowEvent.VERTICAL 119 120 PASS testInitEvent('Progress', '"a", false, false, false, 1001, 1002').type is 'a' 120 121 PASS testInitEvent('Progress', 'null, false, false, false, 1001, 1002').type is 'null' -
trunk/LayoutTests/fast/events/overflow-events.html
r15191 r65226 1 1 <html> 2 2 <head> 3 4 5 3 <script> 4 function overflowChanged(event) { 5 var result = [event.orient, event.horizontalOverflow, event.verticalOverflow]; 6 6 7 if ('' + result == testResults[currentTest++]) 8 numSuccessful ++; 9 10 if (testResults.length == numSuccessful) 11 document.getElementById('result').innerHTML = "SUCCESS"; 12 } 13 14 function forceLayout() { 15 document.body.offsetTop; 16 } 17 18 function runTest() { 19 if (window.layoutTestController) 20 layoutTestController.dumpAsText(); 21 22 testResults = [[1, true, false], 23 [1, false, false], 24 [0, false, true], 25 [0, false, false], 26 [2, true, true], 27 [2, false, false], 28 [0, false, true], 29 [2, true, false], 30 [2, false, true]]; 31 32 currentTest = 0; 33 numSuccessful = 0; 34 35 var c = document.getElementById('container'); 36 c.addEventListener('overflowchanged', overflowChanged, false); 37 38 forceLayout(); 39 document.getElementById('child').style.width='200px'; 7 if ('' + result == testResults[currentTest++]) 8 numSuccessful ++; 9 if (testResults.length == numSuccessful) 10 document.getElementById('result').innerHTML = "SUCCESS"; 11 } 40 12 41 forceLayout(); 42 document.getElementById('child').style.width='50px';43 forceLayout(); 13 function forceLayout() { 14 document.body.offsetTop; 15 } 44 16 45 document.getElementById('child').style.height='200px'; 46 forceLayout(); 47 document.getElementById('child').style.height='50px'; 48 forceLayout(); 17 function runTest() { 18 if (window.layoutTestController) 19 layoutTestController.dumpAsText(); 49 20 50 forceLayout(); 51 document.getElementById('child').style.width='200px'; 52 document.getElementById('child').style.height='200px'; 53 forceLayout(); 21 testResults = [[OverflowEvent.HORIZONTAL, true, false], 22 [OverflowEvent.HORIZONTAL, false, false], 23 [OverflowEvent.VERTICAL, false, true], 24 [OverflowEvent.VERTICAL, false, false], 25 [OverflowEvent.BOTH, true, true], 26 [OverflowEvent.BOTH, false, false], 27 [OverflowEvent.VERTICAL, false, true], 28 [OverflowEvent.BOTH, true, false], 29 [OverflowEvent.BOTH, false, true]]; 54 30 55 document.getElementById('child').style.width='50px'; 56 document.getElementById('child').style.height='50px'; 57 forceLayout(); 31 currentTest = 0; 32 numSuccessful = 0; 58 33 59 document.getElementById('child').style.height='200px';60 forceLayout(); 34 var c = document.getElementById('container'); 35 c.addEventListener('overflowchanged', overflowChanged, false); 61 36 62 document.getElementById('child').style.width='200px'; 63 document.getElementById('child').style.height='50px'; 64 forceLayout(); 37 forceLayout(); 38 document.getElementById('child').style.width='200px'; 65 39 66 document.getElementById('child').style.width='50px';67 document.getElementById('child').style.height='200px';68 forceLayout(); 40 forceLayout(); 41 document.getElementById('child').style.width='50px'; 42 forceLayout(); 69 43 70 } 71 </script> 44 document.getElementById('child').style.height='200px'; 45 forceLayout(); 46 document.getElementById('child').style.height='50px'; 47 forceLayout(); 48 49 forceLayout(); 50 document.getElementById('child').style.width='200px'; 51 document.getElementById('child').style.height='200px'; 52 forceLayout(); 53 54 document.getElementById('child').style.width='50px'; 55 document.getElementById('child').style.height='50px'; 56 forceLayout(); 57 58 document.getElementById('child').style.height='200px'; 59 forceLayout(); 60 61 document.getElementById('child').style.width='200px'; 62 document.getElementById('child').style.height='50px'; 63 forceLayout(); 64 65 document.getElementById('child').style.width='50px'; 66 document.getElementById('child').style.height='200px'; 67 forceLayout(); 68 69 } 70 </script> 72 71 </head> 73 72 <body onload="runTest()"> 74 75 76 77 78 73 <div id="container" style="width:100; height:100px; border: solid red 2px; overflow: hidden"> 74 <div id="child" style="margin-top: 30px; margin-left: 30px; width:50px; height:50px; border: solid blue 2px;"></div> 75 </div> 76 This tests that overflowchanged events are fired correctly. If the test is successful, the text "SUCCESS" should be shown below. 77 <div id="result">FAILURE</div> 79 78 </body> 80 79 </html> -
trunk/LayoutTests/fast/events/script-tests/init-events.js
r58574 r65226 1 1 description("This tests the init functions for all the event DOM classes that have them."); 2 3 function createEventHelper(prefix) 4 { 5 var event = document.createEvent(prefix + "Event"); 6 return event; 7 } 2 8 3 9 function testInitEvent(prefix, argumentString) 4 10 { 5 var event = document.createEvent(prefix + "Event");11 var event = createEventHelper(prefix); 6 12 var initExpression = "event.init" + prefix + "Event(" + argumentString + ")"; 7 13 eval(initExpression); … … 134 140 shouldBe("testInitEvent('Overflow', '1001, false, false').verticalOverflow", "false"); 135 141 shouldBe("testInitEvent('Overflow', '1001, false, true').verticalOverflow", "true"); 142 shouldBe("createEventHelper('Overflow').orient", "OverflowEvent.VERTICAL"); 136 143 137 144 shouldBe("testInitEvent('Progress', '\"a\", false, false, false, 1001, 1002').type", "'a'"); -
trunk/WebCore/ChangeLog
r65223 r65226 1 2010-07-14 Marcus Bulach <bulach@chromium.org> 2 3 Reviewed by darin@apple.com. 4 5 Removes DontCheckEnums from some IDLs and fixes the corresponding enums. 6 https://bugs.webkit.org/show_bug.cgi?id=42278 7 8 This is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=42250: it fixes some IDL/.h and enables generating compile-time checks for enums. 9 10 Tests: idls should generate valid code. 11 12 * dom/Node.h: 13 (WebCore::Node::): 14 * dom/Node.idl: 15 * dom/OverflowEvent.h: 16 (WebCore::OverflowEvent::): 17 * dom/OverflowEvent.idl: 18 * html/FileReader.cpp: 19 (WebCore::FileReader::readyState): 20 * html/FileReader.h: 21 (WebCore::FileReader::): 22 * html/FileReader.idl: 23 1 24 2010-08-12 Alejandro G. Castro <alex@igalia.com> 2 25 -
trunk/WebCore/dom/Node.h
r65021 r65226 87 87 }; 88 88 89 const unsigned short DOCUMENT_POSITION_EQUIVALENT = 0x00;90 const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;91 const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;92 const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;93 const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;94 const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;95 const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;96 97 89 // this class implements nodes, which can have a parent but no children: 98 90 class Node : public EventTarget, public TreeShared<Node>, public ScriptWrappable { … … 114 106 XPATH_NAMESPACE_NODE = 13 115 107 }; 116 108 enum DocumentPosition { 109 DOCUMENT_POSITION_EQUIVALENT = 0x00, 110 DOCUMENT_POSITION_DISCONNECTED = 0x01, 111 DOCUMENT_POSITION_PRECEDING = 0x02, 112 DOCUMENT_POSITION_FOLLOWING = 0x04, 113 DOCUMENT_POSITION_CONTAINS = 0x08, 114 DOCUMENT_POSITION_CONTAINED_BY = 0x10, 115 DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20, 116 }; 117 117 118 static bool isSupported(const String& feature, const String& version); 118 119 -
trunk/WebCore/dom/Node.idl
r63331 r65226 29 29 GenerateNativeConverter, 30 30 InlineGetOwnPropertySlot, 31 Polymorphic, 32 DontCheckEnums 31 Polymorphic 33 32 ] Node 34 33 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C -
trunk/WebCore/dom/OverflowEvent.h
r34536 r65226 34 34 public: 35 35 enum orientType { 36 VERTICAL= 0,37 HORIZONTAL= 1,36 HORIZONTAL = 0, 37 VERTICAL = 1, 38 38 BOTH = 2 39 39 }; -
trunk/WebCore/dom/OverflowEvent.idl
r63736 r65226 24 24 */ 25 25 module events { 26 // FIXME: Converge these consts and OverflowEvent::orientType values and remove DontCheckEnums attribute. 27 interface [DontCheckEnums] OverflowEvent : Event { 26 interface OverflowEvent : Event { 28 27 const unsigned short HORIZONTAL = 0; 29 28 const unsigned short VERTICAL = 1; -
trunk/WebCore/html/FileReader.cpp
r64763 r65226 241 241 case None: 242 242 case Starting: 243 return E mpty;243 return EMPTY; 244 244 case Opening: 245 245 case Reading: 246 return L oading;246 return LOADING; 247 247 case Completed: 248 return D one;248 return DONE; 249 249 } 250 250 ASSERT_NOT_REACHED(); 251 return E mpty;251 return EMPTY; 252 252 } 253 253 -
trunk/WebCore/html/FileReader.h
r65021 r65226 64 64 65 65 enum ReadyState { 66 E mpty= 0,67 L oading= 1,68 D one= 266 EMPTY = 0, 67 LOADING = 1, 68 DONE = 2 69 69 }; 70 70 -
trunk/WebCore/html/FileReader.idl
r64763 r65226 35 35 CallWith=ScriptExecutionContext, 36 36 EventTarget, 37 NoStaticTables, 38 DontCheckEnums 37 NoStaticTables 39 38 ] FileReader { 40 39 // ready states
Note: See TracChangeset
for help on using the changeset viewer.