2001-09-25 05:32:19 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-03-10 08:37:31 +03:00
|
|
|
|
1999-08-18 08:25:24 +04:00
|
|
|
/*
|
|
|
|
|
1999-10-20 22:55:32 +04:00
|
|
|
The base XUL element class and associates.
|
1999-08-18 08:25:24 +04:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
1999-03-10 08:37:31 +03:00
|
|
|
#ifndef nsXULElement_h__
|
|
|
|
#define nsXULElement_h__
|
|
|
|
|
2014-04-12 02:19:05 +04:00
|
|
|
#include "js/TracingAPI.h"
|
2013-05-30 00:43:41 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
1999-10-20 22:55:32 +04:00
|
|
|
#include "nsIDOMEvent.h"
|
2001-08-24 00:07:10 +04:00
|
|
|
#include "nsIServiceManager.h"
|
1999-10-19 03:05:35 +04:00
|
|
|
#include "nsIAtom.h"
|
2014-06-20 06:01:40 +04:00
|
|
|
#include "mozilla/dom/NodeInfo.h"
|
1999-10-19 03:05:35 +04:00
|
|
|
#include "nsIControllers.h"
|
|
|
|
#include "nsIDOMElement.h"
|
1999-03-10 08:37:31 +03:00
|
|
|
#include "nsIDOMXULElement.h"
|
2002-01-12 04:20:29 +03:00
|
|
|
#include "nsIDOMXULMultSelectCntrlEl.h"
|
1999-10-19 03:05:35 +04:00
|
|
|
#include "nsIRDFCompositeDataSource.h"
|
|
|
|
#include "nsIRDFResource.h"
|
1999-10-29 05:21:15 +04:00
|
|
|
#include "nsIURI.h"
|
2001-03-23 13:56:18 +03:00
|
|
|
#include "nsIXULTemplateBuilder.h"
|
2002-05-03 07:04:34 +04:00
|
|
|
#include "nsLayoutCID.h"
|
2004-02-10 12:08:06 +03:00
|
|
|
#include "nsAttrAndChildArray.h"
|
2006-12-26 20:47:52 +03:00
|
|
|
#include "nsGkAtoms.h"
|
2004-02-10 12:08:06 +03:00
|
|
|
#include "nsAutoPtr.h"
|
2010-02-24 07:37:46 +03:00
|
|
|
#include "nsStyledElement.h"
|
2008-03-21 14:18:10 +03:00
|
|
|
#include "nsIFrameLoader.h"
|
2013-01-29 21:51:55 +04:00
|
|
|
#include "nsFrameLoader.h"
|
2013-09-20 14:21:03 +04:00
|
|
|
#include "mozilla/dom/DOMRect.h"
|
2013-10-03 00:09:18 +04:00
|
|
|
#include "mozilla/dom/ElementInlines.h"
|
2001-10-18 07:47:32 +04:00
|
|
|
|
1999-10-19 03:05:35 +04:00
|
|
|
class nsIDocument;
|
|
|
|
class nsString;
|
2013-08-20 03:24:27 +04:00
|
|
|
class nsXULPrototypeDocument;
|
1999-10-20 22:55:32 +04:00
|
|
|
|
2001-07-31 23:05:34 +04:00
|
|
|
class nsIObjectInputStream;
|
|
|
|
class nsIObjectOutputStream;
|
2014-03-17 10:56:53 +04:00
|
|
|
class nsIOffThreadScriptReceiver;
|
2008-10-08 15:41:52 +04:00
|
|
|
class nsXULPrototypeNode;
|
|
|
|
typedef nsTArray<nsRefPtr<nsXULPrototypeNode> > nsPrototypeArray;
|
2001-07-31 23:05:34 +04:00
|
|
|
|
2011-03-11 05:48:57 +03:00
|
|
|
namespace mozilla {
|
2014-03-18 08:48:19 +04:00
|
|
|
class EventChainPreVisitor;
|
2014-03-17 10:56:53 +04:00
|
|
|
class EventListenerManager;
|
2011-03-11 05:48:57 +03:00
|
|
|
namespace css {
|
|
|
|
class StyleRule;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace css
|
2014-10-15 00:15:21 +04:00
|
|
|
namespace dom {
|
|
|
|
class BoxObject;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2011-03-11 05:48:57 +03:00
|
|
|
|
2014-04-25 18:11:57 +04:00
|
|
|
namespace JS {
|
|
|
|
class SourceBufferHolder;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace JS
|
2014-04-25 18:11:57 +04:00
|
|
|
|
1999-10-20 22:55:32 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-12-07 05:06:10 +03:00
|
|
|
#ifdef XUL_PROTOTYPE_ATTRIBUTE_METERING
|
|
|
|
#define XUL_PROTOTYPE_ATTRIBUTE_METER(counter) (nsXULPrototypeAttribute::counter++)
|
|
|
|
#else
|
|
|
|
#define XUL_PROTOTYPE_ATTRIBUTE_METER(counter) ((void) 0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1999-10-20 22:55:32 +04:00
|
|
|
/**
|
|
|
|
|
|
|
|
A prototype attribute for an nsXULPrototypeElement.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
1999-10-29 05:21:15 +04:00
|
|
|
class nsXULPrototypeAttribute
|
1999-10-20 22:55:32 +04:00
|
|
|
{
|
1999-10-29 05:21:15 +04:00
|
|
|
public:
|
1999-12-03 06:40:30 +03:00
|
|
|
nsXULPrototypeAttribute()
|
2012-07-19 13:18:01 +04:00
|
|
|
: mName(nsGkAtoms::id) // XXX this is a hack, but names have to have a value
|
1999-12-03 06:40:30 +03:00
|
|
|
{
|
1999-12-07 05:06:10 +03:00
|
|
|
XUL_PROTOTYPE_ATTRIBUTE_METER(gNumAttributes);
|
2003-10-30 04:40:33 +03:00
|
|
|
MOZ_COUNT_CTOR(nsXULPrototypeAttribute);
|
1999-12-03 06:40:30 +03:00
|
|
|
}
|
1999-10-29 05:21:15 +04:00
|
|
|
|
1999-12-06 11:23:47 +03:00
|
|
|
~nsXULPrototypeAttribute();
|
|
|
|
|
2004-02-10 12:08:06 +03:00
|
|
|
nsAttrName mName;
|
|
|
|
nsAttrValue mValue;
|
1999-12-03 06:40:30 +03:00
|
|
|
|
|
|
|
#ifdef XUL_PROTOTYPE_ATTRIBUTE_METERING
|
2012-08-22 19:56:38 +04:00
|
|
|
static uint32_t gNumElements;
|
|
|
|
static uint32_t gNumAttributes;
|
|
|
|
static uint32_t gNumCacheTests;
|
|
|
|
static uint32_t gNumCacheHits;
|
|
|
|
static uint32_t gNumCacheSets;
|
|
|
|
static uint32_t gNumCacheFills;
|
1999-12-07 05:06:10 +03:00
|
|
|
#endif /* !XUL_PROTOTYPE_ATTRIBUTE_METERING */
|
1999-10-20 22:55:32 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
A prototype content model element that holds the "primordial" values
|
2012-07-19 13:18:01 +04:00
|
|
|
that have been parsed from the original XUL document.
|
1999-10-20 22:55:32 +04:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
2012-08-24 20:50:06 +04:00
|
|
|
class nsXULPrototypeNode
|
1999-10-20 22:55:32 +04:00
|
|
|
{
|
1999-10-29 05:21:15 +04:00
|
|
|
public:
|
2006-11-12 01:27:00 +03:00
|
|
|
enum Type { eType_Element, eType_Script, eType_Text, eType_PI };
|
1999-10-29 05:21:15 +04:00
|
|
|
|
|
|
|
Type mType;
|
2001-11-03 13:12:20 +03:00
|
|
|
|
2001-07-31 23:05:34 +04:00
|
|
|
virtual nsresult Serialize(nsIObjectOutputStream* aStream,
|
2013-08-20 03:24:27 +04:00
|
|
|
nsXULPrototypeDocument* aProtoDoc,
|
2014-06-20 06:01:40 +04:00
|
|
|
const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) = 0;
|
2001-07-31 23:05:34 +04:00
|
|
|
virtual nsresult Deserialize(nsIObjectInputStream* aStream,
|
2013-08-20 03:24:27 +04:00
|
|
|
nsXULPrototypeDocument* aProtoDoc,
|
2002-07-24 02:16:45 +04:00
|
|
|
nsIURI* aDocumentURI,
|
2014-06-20 06:01:40 +04:00
|
|
|
const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) = 0;
|
1999-10-29 05:21:15 +04:00
|
|
|
|
2004-01-09 03:01:05 +03:00
|
|
|
#ifdef NS_BUILD_REFCNT_LOGGING
|
|
|
|
virtual const char* ClassName() = 0;
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual uint32_t ClassSize() = 0;
|
2004-01-09 03:01:05 +03:00
|
|
|
#endif
|
|
|
|
|
2007-07-06 02:40:26 +04:00
|
|
|
/**
|
|
|
|
* The prototype document must call ReleaseSubtree when it is going
|
|
|
|
* away. This makes the parents through the tree stop owning their
|
|
|
|
* children, whether or not the parent's reference count is zero.
|
|
|
|
* Individual elements may still own individual prototypes, but
|
|
|
|
* those prototypes no longer remember their children to allow them
|
|
|
|
* to be constructed.
|
|
|
|
*/
|
2008-10-08 15:41:52 +04:00
|
|
|
virtual void ReleaseSubtree() { }
|
2001-11-05 09:45:04 +03:00
|
|
|
|
2012-08-24 20:50:06 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsXULPrototypeNode)
|
|
|
|
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsXULPrototypeNode)
|
2007-05-24 18:10:02 +04:00
|
|
|
|
1999-10-29 05:21:15 +04:00
|
|
|
protected:
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit nsXULPrototypeNode(Type aType)
|
2008-10-08 15:41:52 +04:00
|
|
|
: mType(aType) {}
|
2014-06-25 06:09:15 +04:00
|
|
|
virtual ~nsXULPrototypeNode() {}
|
1999-10-29 05:21:15 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class nsXULPrototypeElement : public nsXULPrototypeNode
|
|
|
|
{
|
|
|
|
public:
|
2002-09-25 13:56:09 +04:00
|
|
|
nsXULPrototypeElement()
|
|
|
|
: nsXULPrototypeNode(eType_Element),
|
1999-10-29 05:21:15 +04:00
|
|
|
mNumAttributes(0),
|
2011-10-17 18:59:28 +04:00
|
|
|
mHasIdAttribute(false),
|
|
|
|
mHasClassAttribute(false),
|
|
|
|
mHasStyleAttribute(false),
|
2012-07-30 18:20:58 +04:00
|
|
|
mAttributes(nullptr)
|
1999-10-29 05:21:15 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsXULPrototypeElement()
|
|
|
|
{
|
2007-10-29 16:45:07 +03:00
|
|
|
Unlink();
|
2001-11-05 09:45:04 +03:00
|
|
|
}
|
1999-10-29 05:21:15 +04:00
|
|
|
|
2004-01-09 03:01:05 +03:00
|
|
|
#ifdef NS_BUILD_REFCNT_LOGGING
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual const char* ClassName() override { return "nsXULPrototypeElement"; }
|
|
|
|
virtual uint32_t ClassSize() override { return sizeof(*this); }
|
2004-01-09 03:01:05 +03:00
|
|
|
#endif
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ReleaseSubtree() override
|
2001-11-05 09:45:04 +03:00
|
|
|
{
|
2012-08-22 19:56:38 +04:00
|
|
|
for (int32_t i = mChildren.Length() - 1; i >= 0; i--) {
|
2008-10-08 15:41:52 +04:00
|
|
|
if (mChildren[i].get())
|
|
|
|
mChildren[i]->ReleaseSubtree();
|
2002-06-09 14:31:00 +04:00
|
|
|
}
|
2008-10-08 15:41:52 +04:00
|
|
|
mChildren.Clear();
|
|
|
|
nsXULPrototypeNode::ReleaseSubtree();
|
1999-10-29 05:21:15 +04:00
|
|
|
}
|
|
|
|
|
2001-07-31 23:05:34 +04:00
|
|
|
virtual nsresult Serialize(nsIObjectOutputStream* aStream,
|
2013-08-20 03:24:27 +04:00
|
|
|
nsXULPrototypeDocument* aProtoDoc,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) override;
|
2001-07-31 23:05:34 +04:00
|
|
|
virtual nsresult Deserialize(nsIObjectInputStream* aStream,
|
2013-08-20 03:24:27 +04:00
|
|
|
nsXULPrototypeDocument* aProtoDoc,
|
2002-07-24 02:16:45 +04:00
|
|
|
nsIURI* aDocumentURI,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) override;
|
1999-10-29 05:21:15 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult SetAttrAt(uint32_t aPos, const nsAString& aValue, nsIURI* aDocumentURI);
|
2004-02-10 12:08:06 +03:00
|
|
|
|
2007-10-29 16:45:07 +03:00
|
|
|
void Unlink();
|
|
|
|
|
2012-08-25 00:22:23 +04:00
|
|
|
// Trace all scripts held by this element and its children.
|
|
|
|
void TraceAllScripts(JSTracer* aTrc);
|
|
|
|
|
2008-10-08 15:41:52 +04:00
|
|
|
nsPrototypeArray mChildren;
|
1999-10-20 22:55:32 +04:00
|
|
|
|
2014-06-20 06:01:40 +04:00
|
|
|
nsRefPtr<mozilla::dom::NodeInfo> mNodeInfo;
|
1999-10-20 22:55:32 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mNumAttributes:29;
|
|
|
|
uint32_t mHasIdAttribute:1;
|
|
|
|
uint32_t mHasClassAttribute:1;
|
|
|
|
uint32_t mHasStyleAttribute:1;
|
1999-10-20 22:55:32 +04:00
|
|
|
nsXULPrototypeAttribute* mAttributes; // [OWNER]
|
1999-10-29 05:21:15 +04:00
|
|
|
};
|
|
|
|
|
2013-03-26 19:31:53 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class XULDocument;
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
1999-11-18 05:25:33 +03:00
|
|
|
|
1999-10-29 05:21:15 +04:00
|
|
|
class nsXULPrototypeScript : public nsXULPrototypeNode
|
|
|
|
{
|
|
|
|
public:
|
2012-08-22 19:56:38 +04:00
|
|
|
nsXULPrototypeScript(uint32_t aLineNo, uint32_t version);
|
1999-11-18 05:25:33 +03:00
|
|
|
virtual ~nsXULPrototypeScript();
|
1999-10-29 05:21:15 +04:00
|
|
|
|
2004-01-09 03:01:05 +03:00
|
|
|
#ifdef NS_BUILD_REFCNT_LOGGING
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual const char* ClassName() override { return "nsXULPrototypeScript"; }
|
|
|
|
virtual uint32_t ClassSize() override { return sizeof(*this); }
|
2004-01-09 03:01:05 +03:00
|
|
|
#endif
|
|
|
|
|
2001-07-31 23:05:34 +04:00
|
|
|
virtual nsresult Serialize(nsIObjectOutputStream* aStream,
|
2013-08-20 03:24:27 +04:00
|
|
|
nsXULPrototypeDocument* aProtoDoc,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) override;
|
Reduce seeks outside the FastLoad file's underlying stream buffer (195010,
r=ben, sr=bryner).
- Pass null scope objects into nsIScriptContext::Compile{EventHandler,Script}
when precompiling for brutal sharing. The JS engine does not need a non-null
object parameter for static scope. That parameter can be non-null only if it
helps the compiler "pre-bind" functions to the same scope object that they'll
be parented by when executing, but with brutal sharing, functions are
precompiled once and executed against many different scope objects.
- A problem in XUL FastLoad was that it would serialize master .xul document
out-of-line scripts (those included via script src= from non-overlay, "master"
.xul docs) far from the place in the FastLoad file where XUL prototype script
info was serialized for the <script src=> tag itself. I fixed that so that,
unless the out-of-line script was previously serialized (by a different src=
reference from another .xul file), the OOL script data immediately follows the
proto-script info in the FastLoad file.
This required adding a SerializeOutOfLine method to nsXULPrototypeScript, which
restores symmetry by matching the existing DeserializeOutOfLine(Script) (note:
I dropped the redundant "Script" from the end of the latter method's name. We
need SerializeOutOfLine to handle overlay OOL scripts. They are serialized by
nsXULDocument::OnStreamComplete, because that code knows the difference between
an overlay and a master doc. This removes all trace of FastLoad writing from
nsXULPrototypeScript::Compile -- FastLoad stuff didn't belong there, not only
because we now want to write master OOL scripts later, when walking the master
XUL prototype doc's element tree, but also for modularity reasons. The caller
knows about FastLoad, nsXULPrototypeScript::Compile does just what its name
implies.
There are 132 seeks with the patch, only 49 of which dump the underlying file
stream's buffer, vs. 133 seeks without the patch, 87 of which dump the buffer.
- Nit-picked some comments to fit in 80 columns, and made other cosmetic fixes.
- Implicated the nsXULDocument::mIsWritingFastLoad flag from the useXULCache
"is the XUL cache enabled?" flag, so other places that test mIsWritingFastLoad
don't have to query whether the cache is enabled.
- Added METERING synchronous meter-dumping to /tmp/bufstats, only ifdef
DEBUG_brendan, in netwerk/base/src/nsBufferedStreams.cpp.
- Added the deferred seek optimization from the first patch in bug 195010 to
nsFastLoadFile.cpp.
- Fixed nsFastLoadFileReader so it overrides readSegments as well as read.
This catches up with the interface extension made to nsIInputStream to add
readSegments. The nsFastLoadFileReader extends nsBinaryInputStream, which is
a concrete class, and overrides Read in order to snoop on *all* bytes read.
It does this in order to demultiplex documents interleaved when the FastLoad
file was written.
But since the readSegments move into nsIInputStream.idl, certain primitives
in nsBinaryStream.cpp, e.g., nsBinaryInputStream::ReadCString, have used
ReadSegments, not Read, to consume parts of the underlying stream (to read
the C string's chars, in that example), and the FastLoad file implementation
has not accounted for those bytes.
- Added a new method to nsIFastLoadFileControl and its impls: hasMuxedDocument.
This is needed when serializing master XUL doc OOL scripts, because we must
not serialize twice, and any OOL script that other XUL docs can include via
script src= could already be in the FastLoad mux.
/be
2003-04-12 05:34:11 +04:00
|
|
|
nsresult SerializeOutOfLine(nsIObjectOutputStream* aStream,
|
2013-08-20 03:24:27 +04:00
|
|
|
nsXULPrototypeDocument* aProtoDoc);
|
2001-07-31 23:05:34 +04:00
|
|
|
virtual nsresult Deserialize(nsIObjectInputStream* aStream,
|
2013-08-20 03:24:27 +04:00
|
|
|
nsXULPrototypeDocument* aProtoDoc,
|
2002-07-24 02:16:45 +04:00
|
|
|
nsIURI* aDocumentURI,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) override;
|
Reduce seeks outside the FastLoad file's underlying stream buffer (195010,
r=ben, sr=bryner).
- Pass null scope objects into nsIScriptContext::Compile{EventHandler,Script}
when precompiling for brutal sharing. The JS engine does not need a non-null
object parameter for static scope. That parameter can be non-null only if it
helps the compiler "pre-bind" functions to the same scope object that they'll
be parented by when executing, but with brutal sharing, functions are
precompiled once and executed against many different scope objects.
- A problem in XUL FastLoad was that it would serialize master .xul document
out-of-line scripts (those included via script src= from non-overlay, "master"
.xul docs) far from the place in the FastLoad file where XUL prototype script
info was serialized for the <script src=> tag itself. I fixed that so that,
unless the out-of-line script was previously serialized (by a different src=
reference from another .xul file), the OOL script data immediately follows the
proto-script info in the FastLoad file.
This required adding a SerializeOutOfLine method to nsXULPrototypeScript, which
restores symmetry by matching the existing DeserializeOutOfLine(Script) (note:
I dropped the redundant "Script" from the end of the latter method's name. We
need SerializeOutOfLine to handle overlay OOL scripts. They are serialized by
nsXULDocument::OnStreamComplete, because that code knows the difference between
an overlay and a master doc. This removes all trace of FastLoad writing from
nsXULPrototypeScript::Compile -- FastLoad stuff didn't belong there, not only
because we now want to write master OOL scripts later, when walking the master
XUL prototype doc's element tree, but also for modularity reasons. The caller
knows about FastLoad, nsXULPrototypeScript::Compile does just what its name
implies.
There are 132 seeks with the patch, only 49 of which dump the underlying file
stream's buffer, vs. 133 seeks without the patch, 87 of which dump the buffer.
- Nit-picked some comments to fit in 80 columns, and made other cosmetic fixes.
- Implicated the nsXULDocument::mIsWritingFastLoad flag from the useXULCache
"is the XUL cache enabled?" flag, so other places that test mIsWritingFastLoad
don't have to query whether the cache is enabled.
- Added METERING synchronous meter-dumping to /tmp/bufstats, only ifdef
DEBUG_brendan, in netwerk/base/src/nsBufferedStreams.cpp.
- Added the deferred seek optimization from the first patch in bug 195010 to
nsFastLoadFile.cpp.
- Fixed nsFastLoadFileReader so it overrides readSegments as well as read.
This catches up with the interface extension made to nsIInputStream to add
readSegments. The nsFastLoadFileReader extends nsBinaryInputStream, which is
a concrete class, and overrides Read in order to snoop on *all* bytes read.
It does this in order to demultiplex documents interleaved when the FastLoad
file was written.
But since the readSegments move into nsIInputStream.idl, certain primitives
in nsBinaryStream.cpp, e.g., nsBinaryInputStream::ReadCString, have used
ReadSegments, not Read, to consume parts of the underlying stream (to read
the C string's chars, in that example), and the FastLoad file implementation
has not accounted for those bytes.
- Added a new method to nsIFastLoadFileControl and its impls: hasMuxedDocument.
This is needed when serializing master XUL doc OOL scripts, because we must
not serialize twice, and any OOL script that other XUL docs can include via
script src= could already be in the FastLoad mux.
/be
2003-04-12 05:34:11 +04:00
|
|
|
nsresult DeserializeOutOfLine(nsIObjectInputStream* aInput,
|
2013-08-20 03:24:27 +04:00
|
|
|
nsXULPrototypeDocument* aProtoDoc);
|
2001-07-31 23:05:34 +04:00
|
|
|
|
2014-04-25 18:11:57 +04:00
|
|
|
nsresult Compile(JS::SourceBufferHolder& aSrcBuf,
|
|
|
|
nsIURI* aURI, uint32_t aLineNo,
|
|
|
|
nsIDocument* aDocument,
|
|
|
|
nsIOffThreadScriptReceiver *aOffThreadReceiver = nullptr);
|
|
|
|
|
2014-01-04 19:02:17 +04:00
|
|
|
nsresult Compile(const char16_t* aText, int32_t aTextLength,
|
2012-08-22 19:56:38 +04:00
|
|
|
nsIURI* aURI, uint32_t aLineNo,
|
1999-12-17 03:06:28 +03:00
|
|
|
nsIDocument* aDocument,
|
2013-08-16 01:14:43 +04:00
|
|
|
nsIOffThreadScriptReceiver *aOffThreadReceiver = nullptr);
|
1999-10-29 05:21:15 +04:00
|
|
|
|
2011-08-11 17:29:50 +04:00
|
|
|
void UnlinkJSObjects();
|
2007-10-29 16:45:07 +03:00
|
|
|
|
2011-10-30 00:13:31 +04:00
|
|
|
void Set(JSScript* aObject);
|
2007-10-29 16:45:07 +03:00
|
|
|
|
2013-05-20 16:40:06 +04:00
|
|
|
// It's safe to return a handle because we trace mScriptObject, no one ever
|
|
|
|
// uses the handle (or the script object) past the point at which the
|
|
|
|
// nsXULPrototypeScript dies, and we can't get memmoved so the
|
|
|
|
// &mScriptObject pointer can't go stale.
|
|
|
|
JS::Handle<JSScript*> GetScriptObject()
|
2007-10-29 16:45:07 +03:00
|
|
|
{
|
2013-07-23 13:58:28 +04:00
|
|
|
// Calling fromMarkedLocation() is safe because we trace mScriptObject in
|
|
|
|
// TraceScriptObject() and because its value is never changed after it has
|
|
|
|
// been set.
|
2013-07-23 13:58:27 +04:00
|
|
|
return JS::Handle<JSScript*>::fromMarkedLocation(mScriptObject.address());
|
2012-08-25 00:22:23 +04:00
|
|
|
}
|
2012-04-25 02:31:28 +04:00
|
|
|
|
2013-03-29 00:37:22 +04:00
|
|
|
void TraceScriptObject(JSTracer* aTrc)
|
|
|
|
{
|
|
|
|
if (mScriptObject) {
|
2014-08-13 13:05:22 +04:00
|
|
|
JS_CallScriptTracer(aTrc, &mScriptObject, "active window XUL prototype script");
|
2013-03-29 00:37:22 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-27 15:50:49 +04:00
|
|
|
void Trace(const TraceCallbacks& aCallbacks, void* aClosure)
|
|
|
|
{
|
|
|
|
if (mScriptObject) {
|
|
|
|
aCallbacks.Trace(&mScriptObject, "mScriptObject", aClosure);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-10-29 05:21:15 +04:00
|
|
|
nsCOMPtr<nsIURI> mSrcURI;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mLineNo;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mSrcLoading;
|
|
|
|
bool mOutOfLine;
|
2013-03-26 19:31:53 +04:00
|
|
|
mozilla::dom::XULDocument* mSrcLoadWaiters; // [OWNER] but not COMPtr
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mLangVersion;
|
2012-08-25 00:22:23 +04:00
|
|
|
private:
|
2013-06-18 14:00:37 +04:00
|
|
|
JS::Heap<JSScript*> mScriptObject;
|
1999-10-29 05:21:15 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class nsXULPrototypeText : public nsXULPrototypeNode
|
|
|
|
{
|
|
|
|
public:
|
2002-09-25 13:56:09 +04:00
|
|
|
nsXULPrototypeText()
|
|
|
|
: nsXULPrototypeNode(eType_Text)
|
1999-10-29 05:21:15 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsXULPrototypeText()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-01-09 03:01:05 +03:00
|
|
|
#ifdef NS_BUILD_REFCNT_LOGGING
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual const char* ClassName() override { return "nsXULPrototypeText"; }
|
|
|
|
virtual uint32_t ClassSize() override { return sizeof(*this); }
|
2004-01-09 03:01:05 +03:00
|
|
|
#endif
|
|
|
|
|
2002-05-03 07:04:34 +04:00
|
|
|
virtual nsresult Serialize(nsIObjectOutputStream* aStream,
|
2013-08-20 03:24:27 +04:00
|
|
|
nsXULPrototypeDocument* aProtoDoc,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) override;
|
2002-05-03 07:04:34 +04:00
|
|
|
virtual nsresult Deserialize(nsIObjectInputStream* aStream,
|
2013-08-20 03:24:27 +04:00
|
|
|
nsXULPrototypeDocument* aProtoDoc,
|
2002-07-24 02:16:45 +04:00
|
|
|
nsIURI* aDocumentURI,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) override;
|
2002-05-03 07:04:34 +04:00
|
|
|
|
1999-10-29 05:21:15 +04:00
|
|
|
nsString mValue;
|
1999-10-20 22:55:32 +04:00
|
|
|
};
|
|
|
|
|
2006-11-12 01:27:00 +03:00
|
|
|
class nsXULPrototypePI : public nsXULPrototypeNode
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsXULPrototypePI()
|
|
|
|
: nsXULPrototypeNode(eType_PI)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsXULPrototypePI()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef NS_BUILD_REFCNT_LOGGING
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual const char* ClassName() override { return "nsXULPrototypePI"; }
|
|
|
|
virtual uint32_t ClassSize() override { return sizeof(*this); }
|
2006-11-12 01:27:00 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
virtual nsresult Serialize(nsIObjectOutputStream* aStream,
|
2013-08-20 03:24:27 +04:00
|
|
|
nsXULPrototypeDocument* aProtoDoc,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) override;
|
2006-11-12 01:27:00 +03:00
|
|
|
virtual nsresult Deserialize(nsIObjectInputStream* aStream,
|
2013-08-20 03:24:27 +04:00
|
|
|
nsXULPrototypeDocument* aProtoDoc,
|
2006-11-12 01:27:00 +03:00
|
|
|
nsIURI* aDocumentURI,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) override;
|
2006-11-12 01:27:00 +03:00
|
|
|
|
|
|
|
nsString mTarget;
|
|
|
|
nsString mData;
|
|
|
|
};
|
|
|
|
|
1999-10-19 03:05:35 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-10-20 22:55:32 +04:00
|
|
|
/**
|
|
|
|
|
|
|
|
The XUL element.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2012-10-02 04:52:06 +04:00
|
|
|
#define XUL_ELEMENT_FLAG_BIT(n_) NODE_FLAG_BIT(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET + (n_))
|
|
|
|
|
|
|
|
// XUL element specific bits
|
|
|
|
enum {
|
2012-10-16 16:37:26 +04:00
|
|
|
XUL_ELEMENT_TEMPLATE_GENERATED = XUL_ELEMENT_FLAG_BIT(0),
|
|
|
|
XUL_ELEMENT_HAS_CONTENTMENU_LISTENER = XUL_ELEMENT_FLAG_BIT(1),
|
|
|
|
XUL_ELEMENT_HAS_POPUP_LISTENER = XUL_ELEMENT_FLAG_BIT(2)
|
2012-10-02 04:52:06 +04:00
|
|
|
};
|
2010-06-18 20:23:04 +04:00
|
|
|
|
2013-06-08 12:54:59 +04:00
|
|
|
ASSERT_NODE_FLAGS_SPACE(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET + 3);
|
2005-01-19 23:05:02 +03:00
|
|
|
|
2012-10-02 04:52:06 +04:00
|
|
|
#undef XUL_ELEMENT_FLAG_BIT
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsXULElement final : public nsStyledElement,
|
2015-03-27 21:52:19 +03:00
|
|
|
public nsIDOMXULElement
|
1999-10-19 03:05:35 +04:00
|
|
|
{
|
1999-10-20 22:55:32 +04:00
|
|
|
public:
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit nsXULElement(already_AddRefed<mozilla::dom::NodeInfo> aNodeInfo);
|
2010-07-23 13:49:57 +04:00
|
|
|
|
1999-10-20 22:55:32 +04:00
|
|
|
static nsresult
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 20:46:42 +04:00
|
|
|
Create(nsXULPrototypeElement* aPrototype, nsIDocument* aDocument,
|
2013-02-05 03:22:51 +04:00
|
|
|
bool aIsScriptable, bool aIsRoot, mozilla::dom::Element** aResult);
|
1999-10-20 22:55:32 +04:00
|
|
|
|
2012-09-26 18:17:51 +04:00
|
|
|
NS_IMPL_FROMCONTENT(nsXULElement, kNameSpaceID_XUL)
|
|
|
|
|
1999-10-19 03:05:35 +04:00
|
|
|
// nsISupports
|
2005-01-14 22:30:55 +03:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-05-30 11:36:53 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULElement, nsStyledElement)
|
Reduce seeks outside the FastLoad file's underlying stream buffer (195010,
r=ben, sr=bryner).
- Pass null scope objects into nsIScriptContext::Compile{EventHandler,Script}
when precompiling for brutal sharing. The JS engine does not need a non-null
object parameter for static scope. That parameter can be non-null only if it
helps the compiler "pre-bind" functions to the same scope object that they'll
be parented by when executing, but with brutal sharing, functions are
precompiled once and executed against many different scope objects.
- A problem in XUL FastLoad was that it would serialize master .xul document
out-of-line scripts (those included via script src= from non-overlay, "master"
.xul docs) far from the place in the FastLoad file where XUL prototype script
info was serialized for the <script src=> tag itself. I fixed that so that,
unless the out-of-line script was previously serialized (by a different src=
reference from another .xul file), the OOL script data immediately follows the
proto-script info in the FastLoad file.
This required adding a SerializeOutOfLine method to nsXULPrototypeScript, which
restores symmetry by matching the existing DeserializeOutOfLine(Script) (note:
I dropped the redundant "Script" from the end of the latter method's name. We
need SerializeOutOfLine to handle overlay OOL scripts. They are serialized by
nsXULDocument::OnStreamComplete, because that code knows the difference between
an overlay and a master doc. This removes all trace of FastLoad writing from
nsXULPrototypeScript::Compile -- FastLoad stuff didn't belong there, not only
because we now want to write master OOL scripts later, when walking the master
XUL prototype doc's element tree, but also for modularity reasons. The caller
knows about FastLoad, nsXULPrototypeScript::Compile does just what its name
implies.
There are 132 seeks with the patch, only 49 of which dump the underlying file
stream's buffer, vs. 133 seeks without the patch, 87 of which dump the buffer.
- Nit-picked some comments to fit in 80 columns, and made other cosmetic fixes.
- Implicated the nsXULDocument::mIsWritingFastLoad flag from the useXULCache
"is the XUL cache enabled?" flag, so other places that test mIsWritingFastLoad
don't have to query whether the cache is enabled.
- Added METERING synchronous meter-dumping to /tmp/bufstats, only ifdef
DEBUG_brendan, in netwerk/base/src/nsBufferedStreams.cpp.
- Added the deferred seek optimization from the first patch in bug 195010 to
nsFastLoadFile.cpp.
- Fixed nsFastLoadFileReader so it overrides readSegments as well as read.
This catches up with the interface extension made to nsIInputStream to add
readSegments. The nsFastLoadFileReader extends nsBinaryInputStream, which is
a concrete class, and overrides Read in order to snoop on *all* bytes read.
It does this in order to demultiplex documents interleaved when the FastLoad
file was written.
But since the readSegments move into nsIInputStream.idl, certain primitives
in nsBinaryStream.cpp, e.g., nsBinaryInputStream::ReadCString, have used
ReadSegments, not Read, to consume parts of the underlying stream (to read
the C string's chars, in that example), and the FastLoad file implementation
has not accounted for those bytes.
- Added a new method to nsIFastLoadFileControl and its impls: hasMuxedDocument.
This is needed when serializing master XUL doc OOL scripts, because we must
not serialize twice, and any OOL script that other XUL docs can include via
script src= could already be in the FastLoad mux.
/be
2003-04-12 05:34:11 +04:00
|
|
|
|
2006-01-19 06:34:18 +03:00
|
|
|
// nsINode
|
2014-03-18 08:48:19 +04:00
|
|
|
virtual nsresult PreHandleEvent(
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::EventChainPreVisitor& aVisitor) override;
|
2006-01-19 06:34:18 +03:00
|
|
|
|
2005-01-14 22:30:55 +03:00
|
|
|
// nsIContent
|
2008-03-21 14:18:10 +03:00
|
|
|
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|
|
|
nsIContent* aBindingParent,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aCompileEventHandlers) override;
|
|
|
|
virtual void UnbindFromTree(bool aDeep, bool aNullParent) override;
|
|
|
|
virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) override;
|
|
|
|
virtual void DestroyContent() override;
|
2006-06-13 07:07:47 +04:00
|
|
|
|
2001-10-16 09:31:36 +04:00
|
|
|
#ifdef DEBUG
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void List(FILE* out, int32_t aIndent) const override;
|
|
|
|
virtual void DumpContent(FILE* out, int32_t aIndent,bool aDumpAll) const override
|
2004-01-10 02:54:21 +03:00
|
|
|
{
|
|
|
|
}
|
2001-10-16 09:31:36 +04:00
|
|
|
#endif
|
1999-10-19 03:05:35 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual void PerformAccesskey(bool aKeyCausesActivation,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aIsTrustedEvent) override;
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult ClickWithInputSource(uint16_t aInputSource);
|
2004-01-10 02:54:21 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIContent *GetBindingParent() const override;
|
|
|
|
virtual bool IsNodeOfType(uint32_t aFlags) const override;
|
|
|
|
virtual bool IsFocusableInternal(int32_t* aTabIndex, bool aWithMouse) override;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 20:46:42 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) override;
|
2004-10-24 21:10:32 +04:00
|
|
|
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
2015-03-21 19:28:04 +03:00
|
|
|
int32_t aModType) const override;
|
|
|
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const override;
|
1999-10-19 03:05:35 +04:00
|
|
|
|
2005-01-19 23:05:02 +03:00
|
|
|
// XUL element methods
|
2008-10-20 19:36:05 +04:00
|
|
|
/**
|
|
|
|
* The template-generated flag is used to indicate that a
|
|
|
|
* template-generated element has already had its children generated.
|
|
|
|
*/
|
|
|
|
void SetTemplateGenerated() { SetFlags(XUL_ELEMENT_TEMPLATE_GENERATED); }
|
|
|
|
void ClearTemplateGenerated() { UnsetFlags(XUL_ELEMENT_TEMPLATE_GENERATED); }
|
2011-09-29 10:19:26 +04:00
|
|
|
bool GetTemplateGenerated() { return HasFlag(XUL_ELEMENT_TEMPLATE_GENERATED); }
|
Reduce seeks outside the FastLoad file's underlying stream buffer (195010,
r=ben, sr=bryner).
- Pass null scope objects into nsIScriptContext::Compile{EventHandler,Script}
when precompiling for brutal sharing. The JS engine does not need a non-null
object parameter for static scope. That parameter can be non-null only if it
helps the compiler "pre-bind" functions to the same scope object that they'll
be parented by when executing, but with brutal sharing, functions are
precompiled once and executed against many different scope objects.
- A problem in XUL FastLoad was that it would serialize master .xul document
out-of-line scripts (those included via script src= from non-overlay, "master"
.xul docs) far from the place in the FastLoad file where XUL prototype script
info was serialized for the <script src=> tag itself. I fixed that so that,
unless the out-of-line script was previously serialized (by a different src=
reference from another .xul file), the OOL script data immediately follows the
proto-script info in the FastLoad file.
This required adding a SerializeOutOfLine method to nsXULPrototypeScript, which
restores symmetry by matching the existing DeserializeOutOfLine(Script) (note:
I dropped the redundant "Script" from the end of the latter method's name. We
need SerializeOutOfLine to handle overlay OOL scripts. They are serialized by
nsXULDocument::OnStreamComplete, because that code knows the difference between
an overlay and a master doc. This removes all trace of FastLoad writing from
nsXULPrototypeScript::Compile -- FastLoad stuff didn't belong there, not only
because we now want to write master OOL scripts later, when walking the master
XUL prototype doc's element tree, but also for modularity reasons. The caller
knows about FastLoad, nsXULPrototypeScript::Compile does just what its name
implies.
There are 132 seeks with the patch, only 49 of which dump the underlying file
stream's buffer, vs. 133 seeks without the patch, 87 of which dump the buffer.
- Nit-picked some comments to fit in 80 columns, and made other cosmetic fixes.
- Implicated the nsXULDocument::mIsWritingFastLoad flag from the useXULCache
"is the XUL cache enabled?" flag, so other places that test mIsWritingFastLoad
don't have to query whether the cache is enabled.
- Added METERING synchronous meter-dumping to /tmp/bufstats, only ifdef
DEBUG_brendan, in netwerk/base/src/nsBufferedStreams.cpp.
- Added the deferred seek optimization from the first patch in bug 195010 to
nsFastLoadFile.cpp.
- Fixed nsFastLoadFileReader so it overrides readSegments as well as read.
This catches up with the interface extension made to nsIInputStream to add
readSegments. The nsFastLoadFileReader extends nsBinaryInputStream, which is
a concrete class, and overrides Read in order to snoop on *all* bytes read.
It does this in order to demultiplex documents interleaved when the FastLoad
file was written.
But since the readSegments move into nsIInputStream.idl, certain primitives
in nsBinaryStream.cpp, e.g., nsBinaryInputStream::ReadCString, have used
ReadSegments, not Read, to consume parts of the underlying stream (to read
the C string's chars, in that example), and the FastLoad file implementation
has not accounted for those bytes.
- Added a new method to nsIFastLoadFileControl and its impls: hasMuxedDocument.
This is needed when serializing master XUL doc OOL scripts, because we must
not serialize twice, and any OOL script that other XUL docs can include via
script src= could already be in the FastLoad mux.
/be
2003-04-12 05:34:11 +04:00
|
|
|
|
2005-01-14 22:30:55 +03:00
|
|
|
// nsIDOMNode
|
2012-10-09 16:31:24 +04:00
|
|
|
NS_FORWARD_NSIDOMNODE_TO_NSINODE
|
2013-01-29 21:51:55 +04:00
|
|
|
// And since that shadowed GetParentElement with the XPCOM
|
|
|
|
// signature, pull in the one we care about.
|
|
|
|
using nsStyledElement::GetParentElement;
|
Reduce seeks outside the FastLoad file's underlying stream buffer (195010,
r=ben, sr=bryner).
- Pass null scope objects into nsIScriptContext::Compile{EventHandler,Script}
when precompiling for brutal sharing. The JS engine does not need a non-null
object parameter for static scope. That parameter can be non-null only if it
helps the compiler "pre-bind" functions to the same scope object that they'll
be parented by when executing, but with brutal sharing, functions are
precompiled once and executed against many different scope objects.
- A problem in XUL FastLoad was that it would serialize master .xul document
out-of-line scripts (those included via script src= from non-overlay, "master"
.xul docs) far from the place in the FastLoad file where XUL prototype script
info was serialized for the <script src=> tag itself. I fixed that so that,
unless the out-of-line script was previously serialized (by a different src=
reference from another .xul file), the OOL script data immediately follows the
proto-script info in the FastLoad file.
This required adding a SerializeOutOfLine method to nsXULPrototypeScript, which
restores symmetry by matching the existing DeserializeOutOfLine(Script) (note:
I dropped the redundant "Script" from the end of the latter method's name. We
need SerializeOutOfLine to handle overlay OOL scripts. They are serialized by
nsXULDocument::OnStreamComplete, because that code knows the difference between
an overlay and a master doc. This removes all trace of FastLoad writing from
nsXULPrototypeScript::Compile -- FastLoad stuff didn't belong there, not only
because we now want to write master OOL scripts later, when walking the master
XUL prototype doc's element tree, but also for modularity reasons. The caller
knows about FastLoad, nsXULPrototypeScript::Compile does just what its name
implies.
There are 132 seeks with the patch, only 49 of which dump the underlying file
stream's buffer, vs. 133 seeks without the patch, 87 of which dump the buffer.
- Nit-picked some comments to fit in 80 columns, and made other cosmetic fixes.
- Implicated the nsXULDocument::mIsWritingFastLoad flag from the useXULCache
"is the XUL cache enabled?" flag, so other places that test mIsWritingFastLoad
don't have to query whether the cache is enabled.
- Added METERING synchronous meter-dumping to /tmp/bufstats, only ifdef
DEBUG_brendan, in netwerk/base/src/nsBufferedStreams.cpp.
- Added the deferred seek optimization from the first patch in bug 195010 to
nsFastLoadFile.cpp.
- Fixed nsFastLoadFileReader so it overrides readSegments as well as read.
This catches up with the interface extension made to nsIInputStream to add
readSegments. The nsFastLoadFileReader extends nsBinaryInputStream, which is
a concrete class, and overrides Read in order to snoop on *all* bytes read.
It does this in order to demultiplex documents interleaved when the FastLoad
file was written.
But since the readSegments move into nsIInputStream.idl, certain primitives
in nsBinaryStream.cpp, e.g., nsBinaryInputStream::ReadCString, have used
ReadSegments, not Read, to consume parts of the underlying stream (to read
the C string's chars, in that example), and the FastLoad file implementation
has not accounted for those bytes.
- Added a new method to nsIFastLoadFileControl and its impls: hasMuxedDocument.
This is needed when serializing master XUL doc OOL scripts, because we must
not serialize twice, and any OOL script that other XUL docs can include via
script src= could already be in the FastLoad mux.
/be
2003-04-12 05:34:11 +04:00
|
|
|
|
1999-10-20 22:55:32 +04:00
|
|
|
// nsIDOMElement
|
2012-10-16 15:51:00 +04:00
|
|
|
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
|
1999-10-19 03:05:35 +04:00
|
|
|
|
1999-10-20 22:55:32 +04:00
|
|
|
// nsIDOMXULElement
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 20:46:42 +04:00
|
|
|
NS_DECL_NSIDOMXULELEMENT
|
1999-10-20 22:55:32 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
|
|
|
virtual mozilla::EventStates IntrinsicState() const override;
|
1999-11-23 12:36:39 +03:00
|
|
|
|
2008-03-21 14:18:10 +03:00
|
|
|
nsresult GetFrameLoader(nsIFrameLoader** aFrameLoader);
|
2015-01-05 22:16:09 +03:00
|
|
|
nsresult SetIsPrerendered();
|
2008-08-11 12:38:43 +04:00
|
|
|
nsresult SwapFrameLoaders(nsIFrameLoaderOwner* aOtherOwner);
|
2008-03-21 14:18:10 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void RecompileScriptEventListeners() override;
|
2006-10-07 14:27:45 +04:00
|
|
|
|
2007-05-16 05:13:47 +04:00
|
|
|
// This function should ONLY be used by BindToTree implementations.
|
2007-05-22 02:22:51 +04:00
|
|
|
// The function exists solely because XUL elements store the binding
|
2012-11-15 02:10:08 +04:00
|
|
|
// parent as a member instead of in the slots, as Element does.
|
2007-05-16 05:13:47 +04:00
|
|
|
void SetXULBindingParent(nsIContent* aBindingParent)
|
|
|
|
{
|
|
|
|
mBindingParent = aBindingParent;
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIDOMNode* AsDOMNode() override { return this; }
|
2013-01-03 00:24:07 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool IsEventAttributeName(nsIAtom* aName) override;
|
2013-01-03 00:24:07 +04:00
|
|
|
|
2013-01-29 21:51:55 +04:00
|
|
|
void SetXULAttr(nsIAtom* aName, const nsAString& aValue,
|
|
|
|
mozilla::ErrorResult& aError)
|
|
|
|
{
|
|
|
|
aError = SetAttr(kNameSpaceID_None, aName, aValue, true);
|
|
|
|
}
|
|
|
|
void SetXULBoolAttr(nsIAtom* aName, bool aValue)
|
|
|
|
{
|
|
|
|
if (aValue) {
|
|
|
|
SetAttr(kNameSpaceID_None, aName, NS_LITERAL_STRING("true"), true);
|
|
|
|
} else {
|
|
|
|
UnsetAttr(kNameSpaceID_None, aName, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// WebIDL API
|
|
|
|
// The XPCOM getter is fine for our string attributes.
|
|
|
|
// The XPCOM setter is fine for our bool attributes.
|
|
|
|
void SetClassName(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::_class, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetAlign(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::align, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetDir(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::dir, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetFlex(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::flex, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetFlexGroup(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::flexgroup, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetOrdinal(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::ordinal, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetOrient(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::orient, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetPack(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::pack, aValue, rv);
|
|
|
|
}
|
|
|
|
bool Hidden() const
|
|
|
|
{
|
|
|
|
return BoolAttrIsTrue(nsGkAtoms::hidden);
|
|
|
|
}
|
|
|
|
bool Collapsed() const
|
|
|
|
{
|
|
|
|
return BoolAttrIsTrue(nsGkAtoms::collapsed);
|
|
|
|
}
|
|
|
|
void SetObserves(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::observes, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetMenu(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::menu, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetContextMenu(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::contextmenu, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetTooltip(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::tooltip, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetWidth(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::width, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetHeight(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::height, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetMinWidth(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::minwidth, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetMinHeight(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::minheight, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetMaxWidth(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::maxwidth, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetMaxHeight(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::maxheight, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetPersist(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::persist, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetLeft(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::left, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetTop(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::top, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetDatasources(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::datasources, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetRef(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::ref, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetTooltipText(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::tooltiptext, aValue, rv);
|
|
|
|
}
|
|
|
|
void SetStatusText(const nsAString& aValue, mozilla::ErrorResult& rv)
|
|
|
|
{
|
|
|
|
SetXULAttr(nsGkAtoms::statustext, aValue, rv);
|
|
|
|
}
|
|
|
|
bool AllowEvents() const
|
|
|
|
{
|
|
|
|
return BoolAttrIsTrue(nsGkAtoms::allowevents);
|
|
|
|
}
|
|
|
|
already_AddRefed<nsIRDFCompositeDataSource> GetDatabase();
|
|
|
|
already_AddRefed<nsIXULTemplateBuilder> GetBuilder();
|
|
|
|
already_AddRefed<nsIRDFResource> GetResource(mozilla::ErrorResult& rv);
|
|
|
|
nsIControllers* GetControllers(mozilla::ErrorResult& rv);
|
2014-10-15 00:15:21 +04:00
|
|
|
already_AddRefed<mozilla::dom::BoxObject> GetBoxObject(mozilla::ErrorResult& rv);
|
2013-01-29 21:51:55 +04:00
|
|
|
void Focus(mozilla::ErrorResult& rv);
|
|
|
|
void Blur(mozilla::ErrorResult& rv);
|
|
|
|
void Click(mozilla::ErrorResult& rv);
|
|
|
|
// The XPCOM DoCommand never fails, so it's OK for us.
|
|
|
|
already_AddRefed<nsINodeList>
|
|
|
|
GetElementsByAttribute(const nsAString& aAttribute,
|
|
|
|
const nsAString& aValue);
|
|
|
|
already_AddRefed<nsINodeList>
|
|
|
|
GetElementsByAttributeNS(const nsAString& aNamespaceURI,
|
|
|
|
const nsAString& aAttribute,
|
|
|
|
const nsAString& aValue,
|
|
|
|
mozilla::ErrorResult& rv);
|
|
|
|
// Style() inherited from nsStyledElement
|
|
|
|
already_AddRefed<nsFrameLoader> GetFrameLoader();
|
|
|
|
void SwapFrameLoaders(nsXULElement& aOtherOwner, mozilla::ErrorResult& rv);
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
nsINode* GetScopeChainParent() const override
|
2014-10-31 00:38:48 +03:00
|
|
|
{
|
2014-10-31 00:43:42 +03:00
|
|
|
// For XUL, the parent is the parent element, if any
|
2014-10-31 00:38:48 +03:00
|
|
|
Element* parent = GetParentElement();
|
|
|
|
return parent ? parent : nsStyledElement::GetScopeChainParent();
|
|
|
|
}
|
|
|
|
|
1999-10-20 22:55:32 +04:00
|
|
|
protected:
|
2014-07-09 01:23:16 +04:00
|
|
|
~nsXULElement();
|
2006-10-31 16:25:40 +03:00
|
|
|
|
2008-08-05 04:58:16 +04:00
|
|
|
// This can be removed if EnsureContentsGenerated dies.
|
|
|
|
friend class nsNSElementTearoff;
|
|
|
|
|
1999-10-19 03:05:35 +04:00
|
|
|
// Implementation methods
|
|
|
|
nsresult EnsureContentsGenerated(void) const;
|
|
|
|
|
2002-03-24 01:46:13 +03:00
|
|
|
nsresult ExecuteOnBroadcastHandler(nsIDOMElement* anElement, const nsAString& attrName);
|
1999-10-19 03:05:35 +04:00
|
|
|
|
|
|
|
static nsresult
|
2013-10-02 07:46:04 +04:00
|
|
|
ExecuteJSCode(nsIDOMElement* anElement, mozilla::WidgetEvent* aEvent);
|
1999-10-19 03:05:35 +04:00
|
|
|
|
|
|
|
// Helper routine that crawls a parent chain looking for a tree element.
|
2002-01-12 04:20:29 +03:00
|
|
|
NS_IMETHOD GetParentTree(nsIDOMXULMultiSelectControlElement** aTreeElement);
|
1999-10-19 03:05:35 +04:00
|
|
|
|
1999-10-29 05:21:15 +04:00
|
|
|
nsresult AddPopupListener(nsIAtom* aName);
|
|
|
|
|
2012-11-15 02:10:08 +04:00
|
|
|
class nsXULSlots : public mozilla::dom::Element::nsDOMSlots
|
2006-09-02 17:21:05 +04:00
|
|
|
{
|
|
|
|
public:
|
2011-08-28 18:07:24 +04:00
|
|
|
nsXULSlots();
|
|
|
|
virtual ~nsXULSlots();
|
2008-03-21 14:18:10 +03:00
|
|
|
|
2011-08-28 18:07:24 +04:00
|
|
|
void Traverse(nsCycleCollectionTraversalCallback &cb);
|
|
|
|
|
|
|
|
nsRefPtr<nsFrameLoader> mFrameLoader;
|
2006-09-02 17:21:05 +04:00
|
|
|
};
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsINode::nsSlots* CreateSlots() override;
|
2006-09-02 17:21:05 +04:00
|
|
|
|
2008-03-21 14:18:10 +03:00
|
|
|
nsresult LoadSrc();
|
|
|
|
|
2001-10-23 00:48:52 +04:00
|
|
|
/**
|
|
|
|
* The nearest enclosing content node with a binding
|
|
|
|
* that created us. [Weak]
|
|
|
|
*/
|
2000-08-12 10:28:02 +04:00
|
|
|
nsIContent* mBindingParent;
|
|
|
|
|
2001-10-23 00:48:52 +04:00
|
|
|
/**
|
|
|
|
* Abandon our prototype linkage, and copy all attributes locally
|
|
|
|
*/
|
2012-07-14 19:28:54 +04:00
|
|
|
nsresult MakeHeavyweight(nsXULPrototypeElement* aPrototype);
|
2005-10-28 06:59:38 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsresult BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
2015-08-01 08:14:06 +03:00
|
|
|
nsAttrValueOrString* aValue,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aNotify) override;
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsAttrValue* aValue, bool aNotify) override;
|
2005-10-28 06:59:38 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void UpdateEditableState(bool aNotify) override;
|
2011-06-01 05:46:57 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual bool ParseAttribute(int32_t aNamespaceID,
|
2005-11-29 19:37:15 +03:00
|
|
|
nsIAtom* aAttribute,
|
2005-10-28 06:59:38 +04:00
|
|
|
const nsAString& aValue,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsAttrValue& aResult) override;
|
2005-10-28 06:59:38 +04:00
|
|
|
|
2014-03-17 10:56:53 +04:00
|
|
|
virtual mozilla::EventListenerManager*
|
|
|
|
GetEventListenerManagerForAttr(nsIAtom* aAttrName,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool* aDefer) override;
|
2004-02-10 12:08:06 +03:00
|
|
|
|
2001-10-23 00:48:52 +04:00
|
|
|
/**
|
|
|
|
* Add a listener for the specified attribute, if appropriate.
|
|
|
|
*/
|
2004-02-10 12:08:06 +03:00
|
|
|
void AddListenerFor(const nsAttrName& aName,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aCompileEventHandlers);
|
2004-02-10 12:08:06 +03:00
|
|
|
void MaybeAddPopupListener(nsIAtom* aLocalName);
|
1999-10-19 03:05:35 +04:00
|
|
|
|
2009-10-21 11:05:34 +04:00
|
|
|
nsIWidget* GetWindowWidget();
|
Reduce seeks outside the FastLoad file's underlying stream buffer (195010,
r=ben, sr=bryner).
- Pass null scope objects into nsIScriptContext::Compile{EventHandler,Script}
when precompiling for brutal sharing. The JS engine does not need a non-null
object parameter for static scope. That parameter can be non-null only if it
helps the compiler "pre-bind" functions to the same scope object that they'll
be parented by when executing, but with brutal sharing, functions are
precompiled once and executed against many different scope objects.
- A problem in XUL FastLoad was that it would serialize master .xul document
out-of-line scripts (those included via script src= from non-overlay, "master"
.xul docs) far from the place in the FastLoad file where XUL prototype script
info was serialized for the <script src=> tag itself. I fixed that so that,
unless the out-of-line script was previously serialized (by a different src=
reference from another .xul file), the OOL script data immediately follows the
proto-script info in the FastLoad file.
This required adding a SerializeOutOfLine method to nsXULPrototypeScript, which
restores symmetry by matching the existing DeserializeOutOfLine(Script) (note:
I dropped the redundant "Script" from the end of the latter method's name. We
need SerializeOutOfLine to handle overlay OOL scripts. They are serialized by
nsXULDocument::OnStreamComplete, because that code knows the difference between
an overlay and a master doc. This removes all trace of FastLoad writing from
nsXULPrototypeScript::Compile -- FastLoad stuff didn't belong there, not only
because we now want to write master OOL scripts later, when walking the master
XUL prototype doc's element tree, but also for modularity reasons. The caller
knows about FastLoad, nsXULPrototypeScript::Compile does just what its name
implies.
There are 132 seeks with the patch, only 49 of which dump the underlying file
stream's buffer, vs. 133 seeks without the patch, 87 of which dump the buffer.
- Nit-picked some comments to fit in 80 columns, and made other cosmetic fixes.
- Implicated the nsXULDocument::mIsWritingFastLoad flag from the useXULCache
"is the XUL cache enabled?" flag, so other places that test mIsWritingFastLoad
don't have to query whether the cache is enabled.
- Added METERING synchronous meter-dumping to /tmp/bufstats, only ifdef
DEBUG_brendan, in netwerk/base/src/nsBufferedStreams.cpp.
- Added the deferred seek optimization from the first patch in bug 195010 to
nsFastLoadFile.cpp.
- Fixed nsFastLoadFileReader so it overrides readSegments as well as read.
This catches up with the interface extension made to nsIInputStream to add
readSegments. The nsFastLoadFileReader extends nsBinaryInputStream, which is
a concrete class, and overrides Read in order to snoop on *all* bytes read.
It does this in order to demultiplex documents interleaved when the FastLoad
file was written.
But since the readSegments move into nsIInputStream.idl, certain primitives
in nsBinaryStream.cpp, e.g., nsBinaryInputStream::ReadCString, have used
ReadSegments, not Read, to consume parts of the underlying stream (to read
the C string's chars, in that example), and the FastLoad file implementation
has not accounted for those bytes.
- Added a new method to nsIFastLoadFileControl and its impls: hasMuxedDocument.
This is needed when serializing master XUL doc OOL scripts, because we must
not serialize twice, and any OOL script that other XUL docs can include via
script src= could already be in the FastLoad mux.
/be
2003-04-12 05:34:11 +04:00
|
|
|
|
2010-06-25 06:01:07 +04:00
|
|
|
// attribute setters for widget
|
2011-09-29 10:19:26 +04:00
|
|
|
nsresult HideWindowChrome(bool aShouldHide);
|
2012-02-14 06:00:56 +04:00
|
|
|
void SetChromeMargins(const nsAttrValue* aValue);
|
2010-06-25 06:01:07 +04:00
|
|
|
void ResetChromeMargins();
|
2011-09-29 10:19:26 +04:00
|
|
|
void SetTitlebarColor(nscolor aColor, bool aActive);
|
2007-10-30 07:03:42 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
void SetDrawsInTitlebar(bool aState);
|
2013-12-17 20:11:13 +04:00
|
|
|
void SetDrawsTitle(bool aState);
|
2014-11-04 06:14:10 +03:00
|
|
|
void UpdateBrightTitlebarForeground(nsIDocument* aDocument);
|
2009-10-21 11:05:34 +04:00
|
|
|
|
2008-01-29 18:12:34 +03:00
|
|
|
void RemoveBroadcaster(const nsAString & broadcasterId);
|
|
|
|
|
1999-10-20 22:55:32 +04:00
|
|
|
protected:
|
2005-01-14 22:30:55 +03:00
|
|
|
// Internal accessor. This shadows the 'Slots', and returns
|
|
|
|
// appropriate value.
|
|
|
|
nsIControllers *Controllers() {
|
|
|
|
nsDOMSlots* slots = GetExistingDOMSlots();
|
2012-07-30 18:20:58 +04:00
|
|
|
return slots ? slots->mControllers : nullptr;
|
2005-01-14 22:30:55 +03:00
|
|
|
}
|
2001-08-24 00:07:10 +04:00
|
|
|
|
2002-02-21 16:39:39 +03:00
|
|
|
void UnregisterAccessKey(const nsAString& aOldValue);
|
2013-01-29 21:51:55 +04:00
|
|
|
bool BoolAttrIsTrue(nsIAtom* aName) const;
|
2004-06-25 16:26:02 +04:00
|
|
|
|
|
|
|
friend nsresult
|
2014-06-20 06:01:40 +04:00
|
|
|
NS_NewXULElement(mozilla::dom::Element** aResult, mozilla::dom::NodeInfo *aNodeInfo);
|
2010-08-20 03:12:46 +04:00
|
|
|
friend void
|
2014-06-20 06:01:40 +04:00
|
|
|
NS_TrustedNewXULElement(nsIContent** aResult, mozilla::dom::NodeInfo *aNodeInfo);
|
2005-09-11 21:15:08 +04:00
|
|
|
|
|
|
|
static already_AddRefed<nsXULElement>
|
2014-06-20 06:01:40 +04:00
|
|
|
Create(nsXULPrototypeElement* aPrototype, mozilla::dom::NodeInfo *aNodeInfo,
|
2013-02-05 03:22:51 +04:00
|
|
|
bool aIsScriptable, bool aIsRoot);
|
2007-02-18 17:38:04 +03:00
|
|
|
|
2011-06-01 05:46:57 +04:00
|
|
|
bool IsReadWriteTextElement() const
|
|
|
|
{
|
2015-03-03 14:09:00 +03:00
|
|
|
return IsAnyOfXULElements(nsGkAtoms::textbox, nsGkAtoms::textarea) &&
|
|
|
|
!HasAttr(kNameSpaceID_None, nsGkAtoms::readonly);
|
2011-06-01 05:46:57 +04:00
|
|
|
}
|
2013-01-29 21:51:55 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-02-05 03:22:51 +04:00
|
|
|
|
|
|
|
void MaybeUpdatePrivateLifetime();
|
1999-10-19 03:05:35 +04:00
|
|
|
};
|
|
|
|
|
1999-03-10 08:37:31 +03:00
|
|
|
#endif // nsXULElement_h__
|