<commit_before><html>
<head>
  <script src="../OLLoader.js"></script>
  <script type="text/javascript">
    function test_Handler_Box_constructor(t) {
        t.plan(4);
        var control = new OpenLayers.Control();
        control.id = Math.random();
        var callbacks = {done: "bar"};
        var options = {bar: "foo"};
        
        var handler = new OpenLayers.Handler.Box(control, callbacks, options);

        t.eq(handler.control.id, control.id, "handler created with the correct control");
        t.eq(handler.callbacks.done, "bar", "handler created with the correct callback");
        t.eq(handler.bar, "foo", "handler created with the correct options");
        t.ok(handler.dragHandler instanceof OpenLayers.Handler.Drag, "drag handler created");
    }

    function test_Handler_Box_draw(t) {
        var testAll = true;
        if (document.defaultView && document.defaultView.getComputedStyle &&
                    !document.defaultView.getComputedStyle(document.body)) {
            // we don't get dimensions for hidden frames in FF4, and our test
            // runs in a hidden frame.
            testAll = false;
        }
        
        t.plan(testAll ? 12 : 2);

        var map = new OpenLayers.Map('map');
        var control = new OpenLayers.Control();
        map.addControl(control);
        var handler = new OpenLayers.Handler.Box(control, {done: function(e) {
            t.ok(e.equals(new OpenLayers.Bounds(5, 11, 11, 5)), "box result correct");
        }});
        handler.activate();
        handler.dragHandler.start = {x: 5, y: 5};
        handler.startBox({x: 5, y: 5});
        var offset = handler.getBoxOffsets();
        if (testAll) {
            t.eq(parseInt(handler.zoomBox.style.left), 5 - offset.left, "x position of box correct");
            t.eq(parseInt(handler.zoomBox.style.top), 5 - offset.top, "y position of box correct");
        }
        handler.moveBox({x: 10, y: 10});
        if (testAll) {
            t.eq(parseInt(handler.zoomBox.style.left), 5 - offset.left, "x position of box still correct");
            t.eq(parseInt(handler.zoomBox.style.top), 5 - offset.top, "y position of box still correct");
            t.eq(parseInt(handler.zoomBox.style.width), 5 + offset.width + 1, "x dimension of box correct");
            t.eq(parseInt(handler.zoomBox.style.height), 5 + offset.height + 1, "y dimension of box correct");
        }
        handler.moveBox({x: 0, y: 0});
        if (testAll) {
            t.eq(parseInt(handler.zoomBox.style.left), 0 - offset.left, "new x position of box correct");<commit_msg>fix test_Handler_Box_draw in FF3, providing getComputedStyle with the correct number of arguments, this test still fails in IE8, no functional change<commit_after><html>
<head>
  <script src="../OLLoader.js"></script>
  <script type="text/javascript">
    function test_Handler_Box_constructor(t) {
        t.plan(4);
        var control = new OpenLayers.Control();
        control.id = Math.random();
        var callbacks = {done: "bar"};
        var options = {bar: "foo"};
        
        var handler = new OpenLayers.Handler.Box(control, callbacks, options);

        t.eq(handler.control.id, control.id, "handler created with the correct control");
        t.eq(handler.callbacks.done, "bar", "handler created with the correct callback");
        t.eq(handler.bar, "foo", "handler created with the correct options");
        t.ok(handler.dragHandler instanceof OpenLayers.Handler.Drag, "drag handler created");
    }

    function test_Handler_Box_draw(t) {
        var testAll = true;
        if (document.defaultView && document.defaultView.getComputedStyle &&
                    !document.defaultView.getComputedStyle(document.body, null)) {
            // we don't get dimensions for hidden frames in FF4, and our test
            // runs in a hidden frame.
            testAll = false;
        }
        
        t.plan(testAll ? 12 : 2);

        var map = new OpenLayers.Map('map');
        var control = new OpenLayers.Control();
        map.addControl(control);
        var handler = new OpenLayers.Handler.Box(control, {done: function(e) {
            t.ok(e.equals(new OpenLayers.Bounds(5, 11, 11, 5)), "box result correct");
        }});
        handler.activate();
        handler.dragHandler.start = {x: 5, y: 5};
        handler.startBox({x: 5, y: 5});
        var offset = handler.getBoxOffsets();
        if (testAll) {
            t.eq(parseInt(handler.zoomBox.style.left), 5 - offset.left, "x position of box correct");
            t.eq(parseInt(handler.zoomBox.style.top), 5 - offset.top, "y position of box correct");
        }
        handler.moveBox({x: 10, y: 10});
        if (testAll) {
            t.eq(parseInt(handler.zoomBox.style.left), 5 - offset.left, "x position of box still correct");
            t.eq(parseInt(handler.zoomBox.style.top), 5 - offset.top, "y position of box still correct");
            t.eq(parseInt(handler.zoomBox.style.width), 5 + offset.width + 1, "x dimension of box correct");
            t.eq(parseInt(handler.zoomBox.style.height), 5 + offset.height + 1, "y dimension of box correct");
        }
        handler.moveBox({x: 0, y: 0});
        if (testAll) {
            t.eq(parseInt(handler.zoomBox.style.left), 0 - offset.left, "new x position of box correct");
{'fraction_non_alphanumeric': 0.13453588876362269, 'fraction_numerical': 0.011649755730928222, 'mean_word_length': 2.45201037613489, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '775324', 'n_tokens_mistral': 1632, 'n_tokens_neox': 1564, 'n_words': 422}