mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 13:21:28 +00:00
84230 - DOM Inspector revival, rs=hyatt
This commit is contained in:
parent
da02b259d6
commit
5288baff63
@ -32,7 +32,7 @@ public:
|
||||
NS_DECL_INIBITMAP
|
||||
|
||||
inBitmap();
|
||||
~inBitmap();
|
||||
virtual ~inBitmap();
|
||||
|
||||
protected:
|
||||
PRUint32 mWidth;
|
||||
|
@ -165,7 +165,6 @@ NS_IMETHODIMP inBitmapChannel::AsyncOpen(nsIStreamListener *aListener, nsISuppor
|
||||
wbuf[1] = h;
|
||||
buffer = (PRUint8*)(wbuf+2);
|
||||
|
||||
PRUint32 p = 0;
|
||||
for (PRUint32 i = 0; i < w*h; ++i) {
|
||||
buffer[0] = bitmapBuf[0];
|
||||
buffer[1] = bitmapBuf[1];
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
NS_DECL_INIBITMAPDEPOT
|
||||
|
||||
inBitmapDepot();
|
||||
~inBitmapDepot();
|
||||
virtual ~inBitmapDepot();
|
||||
|
||||
protected:
|
||||
nsSupportsHashtable mHash;
|
||||
|
@ -61,7 +61,6 @@ inBitmapURI::GetBitmapName(PRUnichar** aBitmapName)
|
||||
nsresult
|
||||
inBitmapURI::FormatSpec(char* *result)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
nsCString spec(NS_BITMAP_SCHEME);
|
||||
|
||||
spec += "//";
|
||||
|
@ -39,8 +39,12 @@
|
||||
class inCSSValueSearch : public inICSSValueSearch
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_INISEARCHPROCESS
|
||||
NS_DECL_INICSSVALUESEARCH
|
||||
|
||||
inCSSValueSearch();
|
||||
~inCSSValueSearch();
|
||||
virtual ~inCSSValueSearch();
|
||||
|
||||
protected:
|
||||
PRBool mIsActive;
|
||||
@ -64,13 +68,6 @@ protected:
|
||||
nsresult SearchStyleRule(nsIStyleRule* aStyleRule);
|
||||
nsresult SearchStyleValue(nsICSSDeclaration* aDec, nsCSSProperty aProp);
|
||||
nsresult EqualizeURL(nsAutoString* aURL);
|
||||
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_DECL_INISEARCHPROCESS
|
||||
|
||||
NS_DECL_INICSSVALUESEARCH
|
||||
};
|
||||
|
||||
#endif // __inCSSValueSearch_h__
|
||||
|
@ -102,7 +102,6 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
nsCOMPtr<nsIRDFResource> kINS_DOMRoot;
|
||||
nsCOMPtr<nsIRDFResource> kINS_Child;
|
||||
nsCOMPtr<nsIRDFResource> kINS_Attribute;
|
||||
|
@ -54,15 +54,13 @@ public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_INIDOMRDFRESOURCE
|
||||
|
||||
public:
|
||||
inDOMRDFResource();
|
||||
virtual ~inDOMRDFResource();
|
||||
|
||||
static NS_METHOD Create(nsISupports* aOuter, const nsIID& iid, void **result);
|
||||
|
||||
private:
|
||||
protected:
|
||||
nsCOMPtr<nsISupports> mObject;
|
||||
|
||||
};
|
||||
|
||||
#endif // __inDOMRDFResource_h__
|
||||
|
@ -30,15 +30,13 @@
|
||||
|
||||
class inDOMUtils : public inIDOMUtils
|
||||
{
|
||||
public:
|
||||
inDOMUtils();
|
||||
~inDOMUtils();
|
||||
|
||||
protected:
|
||||
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_INIDOMUTILS
|
||||
|
||||
inDOMUtils();
|
||||
virtual ~inDOMUtils();
|
||||
|
||||
};
|
||||
|
||||
#endif // __inDOMUtils_h__
|
||||
|
@ -342,4 +342,4 @@ char* getURL(nsIDOMDocument* aDoc)
|
||||
uri->GetSpec(&s);
|
||||
return s;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
NS_DECL_INIDEEPTREEWALKER
|
||||
|
||||
inDeepTreeWalker();
|
||||
~inDeepTreeWalker();
|
||||
virtual ~inDeepTreeWalker();
|
||||
|
||||
protected:
|
||||
void PushNode(nsIDOMNode* aNode);
|
||||
|
@ -36,6 +36,8 @@ inFileSearch::inFileSearch()
|
||||
|
||||
inFileSearch::~inFileSearch()
|
||||
{
|
||||
delete mSearchLoop;
|
||||
delete mTextCriteria;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS2(inFileSearch, inISearchProcess, inIFileSearch);
|
||||
@ -71,7 +73,6 @@ inFileSearch::SetHoldResults(PRBool aHoldResults)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
inFileSearch::SearchSync()
|
||||
{
|
||||
@ -240,7 +241,7 @@ inFileSearch::SetFilenameCriteria(const PRUnichar* aFilenameCriteria)
|
||||
|
||||
// second pass: split up at commas and insert into array
|
||||
idx = 0;
|
||||
PRUint32 lastComma = -1;
|
||||
PRInt32 lastComma = -1;
|
||||
PRUnichar* buf = new PRUnichar[257];
|
||||
c = aFilenameCriteria;
|
||||
PRBool going = PR_TRUE;
|
||||
|
@ -40,13 +40,13 @@ public:
|
||||
NS_DECL_INIFILESEARCH
|
||||
|
||||
inFileSearch();
|
||||
~inFileSearch();
|
||||
virtual ~inFileSearch();
|
||||
|
||||
protected:
|
||||
// inISearchProcess related
|
||||
PRBool mIsActive;
|
||||
PRInt32 mResultCount;
|
||||
nsIFile* mLastResult;
|
||||
nsCOMPtr<nsIFile> mLastResult;
|
||||
nsCOMPtr<nsISupportsArray> mResults;
|
||||
PRBool mHoldResults;
|
||||
nsAutoString* mBasePath;
|
||||
|
@ -108,7 +108,7 @@ inFlasher::DrawElementOutline(nsIDOMElement* aElement, const PRUnichar* aColor,
|
||||
nsAutoString colorStr;
|
||||
colorStr.Assign(aColor);
|
||||
nscolor color;
|
||||
PRBool rv = NS_HexToRGB(colorStr, &color);
|
||||
NS_HexToRGB(colorStr, &color);
|
||||
|
||||
nsRect rect;
|
||||
frame->GetRect(rect);
|
||||
|
@ -39,8 +39,11 @@
|
||||
class inFlasher : public inIFlasher
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_INIFLASHER
|
||||
|
||||
inFlasher();
|
||||
~inFlasher();
|
||||
virtual ~inFlasher();
|
||||
|
||||
protected:
|
||||
nsIFrame* GetFrameFor(nsIDOMElement* aElement, nsIPresShell* aShell);
|
||||
@ -50,11 +53,6 @@ protected:
|
||||
PRUint32 aThickness, float aP2T, nsIRenderingContext* aRenderContext);
|
||||
NS_IMETHOD DrawLine(nscoord aX, nscoord aY, nscoord aLength, PRUint32 aThickness,
|
||||
PRBool aDir, PRBool aBounds, float aP2T, nsIRenderingContext* aRenderContext);
|
||||
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_DECL_INIFLASHER
|
||||
};
|
||||
|
||||
#endif // __inFlasher_h__
|
||||
|
@ -20,7 +20,6 @@
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
|
||||
#include "inLayoutUtils.h"
|
||||
|
||||
#include "nsIDOMDocumentView.h"
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
NS_DECL_INIPNGENCODER
|
||||
|
||||
inPNGEncoder();
|
||||
~inPNGEncoder();
|
||||
virtual ~inPNGEncoder();
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -30,17 +30,16 @@ class inSearchLoop
|
||||
{
|
||||
public:
|
||||
inSearchLoop(inISearchProcess* aSearchProcess);
|
||||
~inSearchLoop();
|
||||
virtual ~inSearchLoop();
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsITimer> mTimer;
|
||||
nsCOMPtr<inISearchProcess> mSearchProcess;
|
||||
|
||||
public:
|
||||
nsresult Start();
|
||||
nsresult Step();
|
||||
nsresult Stop();
|
||||
static void TimerCallback(nsITimer *aTimer, void *aClosure);
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsITimer> mTimer;
|
||||
nsCOMPtr<inISearchProcess> mSearchProcess;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
var gVersion = "0.5";
|
||||
|
||||
var err = initInstall("Document Inspector", "inspector", gVersion);
|
||||
var err = initInstall("DOM Inspector", "inspector", gVersion);
|
||||
logComment("initInstall: " + err);
|
||||
|
||||
var fProgram = getFolder("Program");
|
||||
|
@ -459,7 +459,7 @@ InspectorApp.prototype =
|
||||
var js, fn, item;
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
item = items[i];
|
||||
fn = item.isDisabled;
|
||||
fn = "isDisabled" in item ? item.isDisabled : null;
|
||||
if (!fn) {
|
||||
js = item.getAttribute("isDisabled");
|
||||
if (js) {
|
||||
|
@ -459,8 +459,9 @@ DOMViewer.prototype =
|
||||
var walker = this.createDOMWalker(aEl);
|
||||
var line = [];
|
||||
var parent = aEl;
|
||||
var index = null;
|
||||
while (parent) {
|
||||
var index = this.getRowIndexFromNode(parent);
|
||||
index = this.getRowIndexFromNode(parent);
|
||||
line.push(parent);
|
||||
if (index < 0) {
|
||||
// row for this node hasn't been created yet
|
||||
@ -475,7 +476,7 @@ DOMViewer.prototype =
|
||||
// we've got all the ancestors, now open them
|
||||
// one-by-one from the top on down
|
||||
for (var i = line.length-1; i >= 0; i--) {
|
||||
var index = this.getRowIndexFromNode(line[i]);
|
||||
index = this.getRowIndexFromNode(line[i]);
|
||||
if (index < 0) return false; // can't find row, so stop trying to descend
|
||||
if ((aExpand || i > 0) && !view.isContainerOpen(index))
|
||||
view.toggleOpenState(index);
|
||||
@ -588,7 +589,7 @@ DOMViewer.prototype =
|
||||
|
||||
get flasher()
|
||||
{
|
||||
if (!this.mFlasher) {
|
||||
if (!("mFlasher" in this)) {
|
||||
this.mFlasher = new Flasher(PrefUtils.getPref("inspector.blink.border-color"),
|
||||
PrefUtils.getPref("inspector.blink.border-width"),
|
||||
PrefUtils.getPref("inspector.blink.duration"),
|
||||
|
@ -34,6 +34,9 @@ var viewer;
|
||||
|
||||
//////////// global constants ////////////////////
|
||||
|
||||
const kClipboardHelperCID = "@mozilla.org/widget/clipboardhelper;1";
|
||||
const kGlobalClipboard = Components.interfaces.nsIClipboard.kGlobalClipboard;
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
window.addEventListener("load", JSObjectViewer_initialize, false);
|
||||
@ -107,8 +110,10 @@ JSObjectViewer.prototype =
|
||||
var sels = this.mTree.selectedItems;
|
||||
if (sels.length > 0) {
|
||||
var val = sels[0].__JSValue__;
|
||||
if (val)
|
||||
ClipboardUtils.writeString(val.toString());
|
||||
if (val) {
|
||||
var helper = XPCU.getService(kClipboardHelperCID, "nsIClipboardHelper");
|
||||
helper.copyStringToClipboard(val, kGlobalClipboard);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/viewers/jsObject/jsObject.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/system/ClipboardUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/hooks.js"/>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user