From da45b23bb498508aa5ff64e4fc082bfc9f702d73 Mon Sep 17 00:00:00 2001 From: "glazman%netscape.com" Date: Tue, 28 May 2002 09:00:25 +0000 Subject: [PATCH] Test Selection debug menu item was horked in Composer; b=146424, r=neil@parkwaycc.co.uk, sr=jst git-svn-id: svn://10.0.0.236/trunk@122216 18797224-902f-48f8-a5cc-f745e15eee43 --- .../ui/composer/content/EditorCommandsDebug.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mozilla/editor/ui/composer/content/EditorCommandsDebug.js b/mozilla/editor/ui/composer/content/EditorCommandsDebug.js index 43572ba1458..0185e61a8b9 100644 --- a/mozilla/editor/ui/composer/content/EditorCommandsDebug.js +++ b/mozilla/editor/ui/composer/content/EditorCommandsDebug.js @@ -84,12 +84,24 @@ function EditorTestSelection() dump("Selection contains:\n"); // 3rd param = column to wrap - dump(selection.toStringWithFormat("text/plain", + dump(selection.QueryInterface(Components.interfaces.nsISelectionPrivate).toStringWithFormat("text/plain", 3, // OutputFormatted & gOutputSelectionOnly 0) + "\n"); var output; + dump("====== Selection as node and offsets==========\n"); + dump("rangeCount = " + selection.rangeCount + "\n"); + for (i = 0; i < selection.rangeCount; i++) + { + var range = selection.getRangeAt(i); + if (range) + { + dump("Range "+i+": StartParent="+range.startContainer.nodeName+", offset="+range.startOffset+"\n"); + dump("Range "+i+": EndParent="+range.endContainer.nodeName+", offset="+range.endOffset+"\n\n"); + } + } + dump("====== Selection as unformatted text ==========\n"); output = editorShell.GetContentsAs("text/plain", 1); dump(output + "\n\n");