Changeset 65226 in webkit


Ignore:
Timestamp:
Aug 12, 2010 2:41:14 AM (14 years ago)
Author:
bulach@chromium.org
Message:

2010-07-14 Marcus Bulach <bulach@chromium.org>

Reviewed by Darin Adler.

Removes DontCheckEnums from some IDLs and fixes the corresponding enums.
https://bugs.webkit.org/show_bug.cgi?id=42278

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.

  • fast/events/init-events-expected.txt:
  • fast/events/script-tests/init-events.js: (createEventHelper): splits event creation so that we can test without init. (testInitEvent): adds test for OverflowEvent creation.

2010-07-14 Marcus Bulach <bulach@chromium.org>

Reviewed by Darin Adler.

Removes DontCheckEnums from some IDLs and fixes the corresponding enums.
https://bugs.webkit.org/show_bug.cgi?id=42278

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.

Tests: idls should generate valid code.

  • dom/Node.h: (WebCore::Node::):
  • dom/Node.idl:
  • dom/OverflowEvent.h: (WebCore::OverflowEvent::):
  • dom/OverflowEvent.idl:
  • html/FileReader.cpp: (WebCore::FileReader::readyState):
  • html/FileReader.h: (WebCore::FileReader::):
  • html/FileReader.idl:
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r65224 r65226  
     12010-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
    1152010-08-12  Philippe Normand  <pnormand@igalia.com>
    216
  • trunk/LayoutTests/fast/events/init-events-expected.txt

    r58574 r65226  
    117117PASS testInitEvent('Overflow', '1001, false, false').verticalOverflow is false
    118118PASS testInitEvent('Overflow', '1001, false, true').verticalOverflow is true
     119PASS createEventHelper('Overflow').orient is OverflowEvent.VERTICAL
    119120PASS testInitEvent('Progress', '"a", false, false, false, 1001, 1002').type is 'a'
    120121PASS testInitEvent('Progress', 'null, false, false, false, 1001, 1002').type is 'null'
  • trunk/LayoutTests/fast/events/overflow-events.html

    r15191 r65226  
    11<html>
    22<head>
    3         <script>
    4                 function overflowChanged(event) {
    5                     var result = [event.orient, event.horizontalOverflow, event.verticalOverflow];
     3  <script>
     4    function overflowChanged(event) {
     5        var result = [event.orient, event.horizontalOverflow, event.verticalOverflow];
    66
    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    }
    4012
    41                         forceLayout();
    42                         document.getElementById('child').style.width='50px';
    43                         forceLayout();
     13    function forceLayout() {
     14        document.body.offsetTop;
     15    }
    4416
    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();
    4920
    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]];
    5430
    55                         document.getElementById('child').style.width='50px';
    56                         document.getElementById('child').style.height='50px';
    57                         forceLayout();         
     31        currentTest = 0;
     32        numSuccessful = 0;
    5833
    59                         document.getElementById('child').style.height='200px';
    60                         forceLayout();         
     34        var c = document.getElementById('container');
     35        c.addEventListener('overflowchanged', overflowChanged, false);
    6136
    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';
    6539
    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();
    6943
    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>
    7271</head>
    7372<body onload="runTest()">
    74         <div id="container" style="width:100; height:100px; border: solid red 2px; overflow: hidden">
    75                 <div id="child" style="margin-top: 30px; margin-left: 30px; width:50px; height:50px; border: solid blue 2px;"></div>
    76         </div>
    77         This tests that overflowchanged events are fired correctly. If the test is successful, the text "SUCCESS" should be shown below.
    78         <div id="result">FAILURE</div>
     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>
    7978</body>
    8079</html>
  • trunk/LayoutTests/fast/events/script-tests/init-events.js

    r58574 r65226  
    11description("This tests the init functions for all the event DOM classes that have them.");
     2
     3function createEventHelper(prefix)
     4{
     5    var event = document.createEvent(prefix + "Event");
     6    return event;
     7}
    28
    39function testInitEvent(prefix, argumentString)
    410{
    5     var event = document.createEvent(prefix + "Event");
     11    var event = createEventHelper(prefix);
    612    var initExpression = "event.init" + prefix + "Event(" + argumentString + ")";
    713    eval(initExpression);
     
    134140shouldBe("testInitEvent('Overflow', '1001, false, false').verticalOverflow", "false");
    135141shouldBe("testInitEvent('Overflow', '1001, false, true').verticalOverflow", "true");
     142shouldBe("createEventHelper('Overflow').orient", "OverflowEvent.VERTICAL");
    136143
    137144shouldBe("testInitEvent('Progress', '\"a\", false, false, false, 1001, 1002').type", "'a'");
  • trunk/WebCore/ChangeLog

    r65223 r65226  
     12010-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
    1242010-08-12  Alejandro G. Castro  <alex@igalia.com>
    225
  • trunk/WebCore/dom/Node.h

    r65021 r65226  
    8787};
    8888
    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 
    9789// this class implements nodes, which can have a parent but no children:
    9890class Node : public EventTarget, public TreeShared<Node>, public ScriptWrappable {
     
    114106        XPATH_NAMESPACE_NODE = 13
    115107    };
    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
    117118    static bool isSupported(const String& feature, const String& version);
    118119
  • trunk/WebCore/dom/Node.idl

    r63331 r65226  
    2929        GenerateNativeConverter,
    3030        InlineGetOwnPropertySlot,
    31         Polymorphic,
    32         DontCheckEnums
     31        Polymorphic
    3332    ] Node
    3433#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
  • trunk/WebCore/dom/OverflowEvent.h

    r34536 r65226  
    3434    public:
    3535        enum orientType {
    36             VERTICAL  = 0,
    37             HORIZONTAL = 1,
     36            HORIZONTAL = 0,
     37            VERTICAL  = 1,
    3838            BOTH       = 2
    3939        };
  • trunk/WebCore/dom/OverflowEvent.idl

    r63736 r65226  
    2424 */
    2525module events {
    26     // FIXME: Converge these consts and OverflowEvent::orientType values and remove DontCheckEnums attribute.
    27     interface [DontCheckEnums] OverflowEvent : Event {
     26    interface OverflowEvent : Event {
    2827        const unsigned short HORIZONTAL = 0;
    2928        const unsigned short VERTICAL   = 1;
  • trunk/WebCore/html/FileReader.cpp

    r64763 r65226  
    241241    case None:
    242242    case Starting:
    243         return Empty;
     243        return EMPTY;
    244244    case Opening:
    245245    case Reading:
    246         return Loading;
     246        return LOADING;
    247247    case Completed:
    248         return Done;
     248        return DONE;
    249249    }
    250250    ASSERT_NOT_REACHED();
    251     return Empty;
     251    return EMPTY;
    252252}
    253253
  • trunk/WebCore/html/FileReader.h

    r65021 r65226  
    6464
    6565    enum ReadyState {
    66         Empty = 0,
    67         Loading = 1,
    68         Done = 2
     66        EMPTY = 0,
     67        LOADING = 1,
     68        DONE = 2
    6969    };
    7070
  • trunk/WebCore/html/FileReader.idl

    r64763 r65226  
    3535        CallWith=ScriptExecutionContext,
    3636        EventTarget,
    37         NoStaticTables,
    38         DontCheckEnums
     37        NoStaticTables
    3938    ] FileReader {
    4039        // ready states
Note: See TracChangeset for help on using the changeset viewer.