Commit bb437151 authored by rginda%netscape.com's avatar rginda%netscape.com
Browse files

bug 203848, landing the latest venkman xpi, a=asa@mozilla.org

Fix the following bugs:
  * Sometimes HTML files would not completely load in the source view.  I had
    been reusing a scriptable input stream in a place where that's not allowed.
  * When you reloaded a file in the source view, the loaded scripts view would
    stop responding to double clicks.
  * If you cycled the ``Exclude Browser Files'' option from on to off, the
    browser files would appear as disabled files, even though they were
    no longer disabled.
  * There was no way to delete a pref with the /pref command.
  * If you moved a tree-based view, it would stop responding to double-clicks.
  * The debugger would get into a bad state if you examined an object that
    had a property named "__proto__".

Adds tabbed views.
parent 15ffd8fe
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -129,6 +129,10 @@ function pm_addpref (prefName, defaultValue)
    
    function prefGetter ()
    {
        //dd ("getter for ``" + prefName + "''");
        //dd ("default: " + defaultValue);
        //dd ("real: " + realValue);

        if (typeof realValue == "undefined" ||
            prefName in prefManager.dirtyPrefs)
        {
@@ -160,8 +164,8 @@ function pm_addpref (prefName, defaultValue)
            }
            catch (ex)
            {
                //dd ("caught exception reading pref ``" + prefName + "'' " +
                //    type + "\n" + ex);
                //dd ("caught exception reading pref ``" + prefName + "''\n" +
                //ex);
                realValue = defaultValue;
            }
        }
+85 −3
Original line number Diff line number Diff line
@@ -167,15 +167,18 @@ BasicOView.prototype.rowCount = 0;

BasicOView.prototype.getCellProperties =
function bov_cellprops (row, colID, properties)
{}
{
}

BasicOView.prototype.getColumnProperties =
function bov_colprops (colID, elem, properties)
{}
{
}

BasicOView.prototype.getRowProperties =
function bov_rowprops (index, properties)
{}
{
}

BasicOView.prototype.isContainer =
function bov_isctr (index)
@@ -228,6 +231,9 @@ function bov_drop (index, orientation)
BasicOView.prototype.getParentIndex =
function bov_getpi (index)
{
    if (index < 0)
        return -1;

    return 0;
}

@@ -313,6 +319,82 @@ function bov_setct (row, colID, value)
{
}

BasicOView.prototype.onRouteFocus =
function bov_rfocus (event)
{
    if ("onFocus" in this)
        this.onFocus(event);
}

BasicOView.prototype.onRouteBlur =
function bov_rblur (event)
{
    if ("onBlur" in this)
        this.onBlur(event);
}

BasicOView.prototype.onRouteDblClick =
function bov_rdblclick (event)
{
    if (!("onRowCommand" in this) || event.target.localName != "treechildren")
        return;

    var rowIndex = this.tree.selection.currentIndex;
    if (rowIndex == -1 || rowIndex > this.rowCount)
        return;
    var rec = this.childData.locateChildByVisualRow(rowIndex);
    if (!rec)
    {
        ASSERT (0, "bogus row index " + rowIndex);
        return;
    }

    this.onRowCommand(rec, event);
}

BasicOView.prototype.onRouteKeyPress =
function bov_rkeypress (event)
{
    var rec;
    
    if ("onRowCommand" in this && (event.keyCode == 13 || event.charCode == 32))
    {
        if (!this.selection)
            return;
        
        var rowIndex = this.tree.selection.currentIndex;
        if (rowIndex == -1 || rowIndex > this.rowCount)
            return;
        rec = this.childData.locateChildByVisualRow(rowIndex);
        if (!rec)
        {
            ASSERT (0, "bogus row index " + rowIndex);
            return;
        }

        this.onRowCommand(rec, event);
    }
    else if ("onKeyPress" in this)
    {
        var rowIndex = this.tree.selection.currentIndex;
        if (rowIndex != -1 && rowIndex < this.rowCount)
        {
            var rec = this.childData.locateChildByVisualRow(rowIndex);
            if (!rec)
            {
                ASSERT (0, "bogus row index " + rowIndex);
                return;
            }
        }
        else
        {
            rec = null;
        }
        
        this.onKeyPress(rec, event);
    }
}

BasicOView.prototype.performAction =
function bov_pact (action)
{
+38 −5
Original line number Diff line number Diff line
@@ -46,11 +46,11 @@
  <binding id="floatingview">
    <content>
      <xul:vbox id="view-frame-p" flex="1"
        ondragover="console.dnd.dragOver(event, console.viewProxy);"
        ondragexit="console.dnd.dragExit(event, console.viewProxy);"
        ondragdrop="console.dnd.drop(event, console.viewProxy);">
        ondragover="console.dnd.dragOver(event, console.viewDropProxy);"
        ondragexit="console.dnd.dragExit(event, console.viewDropProxy);"
        ondragdrop="console.dnd.drop(event, console.viewDropProxy);">
        <xul:vbox class="view-outer"
          ondraggesture="console.dnd.startDrag(event, console.viewProxyTitle);">
          ondraggesture="console.dnd.startDrag(event, console.viewDragProxy);">
          <xul:hbox id="view-title" flex="1">
            <xul:image class="view-title-pop"
              tooltiptext="&ViewFloat.tooltip;"
@@ -80,7 +80,7 @@
    </implementation>
  </binding>

  <binding id="viewcontainer">
  <binding id="viewcontainer-box">
    <content>
      <xul:box xbl:inherits="orient=type" class="view-container" flex="1">
        <children/>
@@ -92,4 +92,37 @@
    </implementation>
  </binding>

  <binding id="viewcontainer-tab">
    <content>
      <xul:tabbox flex="1">
        <xul:tabpanels flex="1">
          <children/>
        </xul:tabpanels>
        <xul:tabs class="tabs-bottom">
          <xul:little-tab needinit="true"/>
        </xul:tabs>
      </xul:tabbox>
    </content>

    <implementation>
      <property name="ownerWindow" onget="return window;"/>
      <property name="tabs"
        onget="return document.getAnonymousNodes(this)[0].childNodes[1]"/>
      <property name="deck"
        onget="return document.getAnonymousNodes(this)[0].childNodes[0]"/>
    </implementation>
  </binding>

  <binding id="little-tab">
    <content>
      <xul:hbox flex="1"
        ondraggesture="console.dnd.startDrag(event, console.viewDragProxy);"
        ondragover="console.dnd.dragOver(event, console.viewDropProxy);"
        ondragdrop="console.dnd.drop(event, console.viewDropProxy);"
        ondragexit="console.dnd.dragExit(event, console.viewDropProxy);">
        <xul:label xbl:inherits="value=label" crop="right" flex="1"/>
      </xul:hbox>
    </content>
  </binding>

</bindings>
+0 −3
Original line number Diff line number Diff line
@@ -135,12 +135,9 @@ function copyToBreakpoint()
        if (dialog["result-radio"].childNodes[i] ==
            dialog["result-radio"].selectedItem)
        {
            dd ("result radio is " + i);
            breakpoint.resultAction = i;
            break;
        }
        else
            dd ("not at index " + i);
    }
    breakpoint.condition = dialog["condition-textbox"].value;
    breakpoint.passExceptions = dialog["exception-checkbox"].checked;
+71 −23
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ function initCommands()
         ["about-mozilla",  cmdAboutMozilla,                                 0],
         ["break",          cmdBreak,                              CMD_CONSOLE],
         ["break-props",    cmdBreakProps,                         CMD_CONSOLE],
         ["change-container", cmdChangeContainer,                  CMD_CONSOLE],
         ["change-value",   cmdChangeValue,                                  0],
         ["chrome-filter",  cmdChromeFilter,                       CMD_CONSOLE],
         ["clear",          cmdClear,                              CMD_CONSOLE],
@@ -183,6 +184,8 @@ function initCommands()
                                                     "expression",
                                                     "prefValue"],
                                                     "rest");
    console.commandManager.argTypes.__aliasTypes__ (["deletePref"],
                                                     "state");

    console.commandManager.installKeys(console.mainWindow.document,
                                       console.commandManager.commands);
@@ -304,6 +307,36 @@ function cmdBreakProps (e)
                    "chrome,extrachrome,menubar,resizable", e.breakWrapper);
}

function cmdChangeContainer(e)
{
    if (!(e.viewId in console.views))
    {
        display(getMsg(MSN_ERR_NO_SUCH_VIEW, e.viewId), MT_ERROR);
        return;
    }

    var view = console.views[e.viewIs];
    
    if (!view.currentContent)
    {
        display(getMsg(MSN_ERR_INVALID_PARAM, ["<view-name>", e.viewId]),
                MT_ERROR);
        return;
    }
    
    e.newType = e.newType.toLowerCase();
    
    if (e.newType.search(/^(horizontal|vertical|tab)$/) != 0)
    {
        display(getMsg(MSN_ERR_INVALID_PARAM, ["<new-type>", e.newType]),
                MT_ERROR);
        return;
    }

    console.viewManager.changeContainer(view.currentContent.parentNode,
                                        e.newType);
}

function cmdChangeValue(e)
{
    var obj = e.parentValue.getWrappedValue();
@@ -367,8 +400,6 @@ function cmdChromeFilter (e)
        if (!scriptWrapper.jsdScript.isValid)
            return;
        
        var lastDebugState = scriptWrapper.jsdScript.flags & SCRIPT_NODEBUG;
        
        if (e.toggle)
        {
            scriptWrapper.lastFlags = scriptWrapper.jsdScript.flags;
@@ -391,19 +422,8 @@ function cmdChromeFilter (e)
            }
        }

        if (lastDebugState != scriptWrapper.jsdScript.flags & SCRIPT_NODEBUG)
        {
            if (lastDebugState)
            {
                // went from on to off
                --scriptWrapper.scriptInstance.disabledScripts;
            }
            else
            {
                // went from off to on
        if (scriptWrapper.jsdScript.flags & SCRIPT_NODEBUG)
            ++scriptWrapper.scriptInstance.disabledScripts;
            }
        }
    };
    
    var currentState = console.prefs["enableChromeFilter"];
@@ -450,6 +470,7 @@ function cmdChromeFilter (e)
                for (var i in mgr.instances)
                {
                    var instance = mgr.instances[i];
                    instance.disabledScripts = 0;
                    if (instance.topLevel)
                        setFlag (instance.topLevel);
                    
@@ -1207,6 +1228,9 @@ function cmdMoveView (e)

function cmdMozillaHelp ()
{
    if (typeof openHelp == "undefined")
        toOpenWindowByType('mozilla:help', 'chrome://help/content/help.xul');
    else
        openHelp();
}

@@ -1271,14 +1295,38 @@ function cmdPPrint (e)

function cmdPref (e)
{
    if (e.prefValue)
    if (e.prefName && e.prefName[0] == "-")
    {
        e.prefName = e.prefName.substr(1);
        e.deletePref = true;
    }
        
    if (e.deletePref)
    {
        if (e.prefName[0] == "-")
        try
        {
            console.prefManager.prefBranch.clearUserPref(e.prefName);
            console.prefManager.dirtyPrefs[e.prefName] = true;
            console.prefManager.prefService.savePrefFile(null);
        }
        catch (ex)
        {
            // ignore exception generated by clear of nonexistant pref
            if (!("result" in ex) ||
                ex.result != Components.results.NS_ERROR_UNEXPECTED)
            {
            console.prefs.prefBranch.clearUserPref(e.prefName.substr(1));
                throw ex;
            }
        }

        var prefValue = console.prefs[e.prefName];
        feedback (e, getMsg(MSN_FMT_PREFVALUE,
                            [e.prefName, console.prefs[e.prefName]]));
        return true;
    }

    if (e.prefValue)
    {
        var type = typeof console.prefs[e.prefName];
        switch (type)
        {
Loading