зеркало из https://github.com/mozilla/pjs.git
Merge tips of mozilla-inbound and mozilla-central
This commit is contained in:
Коммит
e1ae5d813d
|
@ -56,7 +56,7 @@ interface nsIAccessibleRelation;
|
|||
* Mozilla creates the implementations of nsIAccessible on demand.
|
||||
* See http://www.mozilla.org/projects/ui/accessibility for more information.
|
||||
*/
|
||||
[scriptable, uuid(c81d8f8c-8585-4094-bc7c-71dd01494906)]
|
||||
[scriptable, uuid(c7ac764a-b4c5-4479-9fb7-06e3c9f3db34)]
|
||||
interface nsIAccessible : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -247,18 +247,6 @@ interface nsIAccessible : nsISupports
|
|||
*/
|
||||
nsIAccessibleRelation getRelationByType(in unsigned long aRelationType);
|
||||
|
||||
/**
|
||||
* Returns the number of accessible relations for this object.
|
||||
*/
|
||||
readonly attribute unsigned long relationsCount;
|
||||
|
||||
/**
|
||||
* Returns one accessible relation for this object.
|
||||
*
|
||||
* @param index - relation index (0-based)
|
||||
*/
|
||||
nsIAccessibleRelation getRelation(in unsigned long index);
|
||||
|
||||
/**
|
||||
* Returns multiple accessible relations for this object.
|
||||
*/
|
||||
|
|
|
@ -2189,40 +2189,6 @@ nsAccessible::RelationByType(PRUint32 aType)
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::GetRelationsCount(PRUint32* aCount)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCount);
|
||||
*aCount = 0;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIArray> relations;
|
||||
nsresult rv = GetRelations(getter_AddRefs(relations));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return relations->GetLength(aCount);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::GetRelation(PRUint32 aIndex, nsIAccessibleRelation** aRelation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRelation);
|
||||
*aRelation = nsnull;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIArray> relations;
|
||||
nsresult rv= GetRelations(getter_AddRefs(relations));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsIAccessibleRelation> relation = do_QueryElementAt(relations,
|
||||
aIndex, &rv);
|
||||
NS_ADDREF(*aRelation = relation);
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::GetRelations(nsIArray **aRelations)
|
||||
{
|
||||
|
|
|
@ -1027,28 +1027,4 @@ public:
|
|||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIContent, NS_ICONTENT_IID)
|
||||
|
||||
// Some cycle-collecting helper macros for nsIContent subclasses
|
||||
|
||||
#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_LISTENERMANAGER \
|
||||
if (tmp->HasFlag(NODE_HAS_LISTENERMANAGER)) { \
|
||||
nsContentUtils::TraverseListenerManager(tmp, cb); \
|
||||
}
|
||||
|
||||
#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_USERDATA \
|
||||
if (tmp->HasProperties()) { \
|
||||
nsNodeUtils::TraverseUserData(tmp, cb); \
|
||||
}
|
||||
|
||||
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_LISTENERMANAGER \
|
||||
if (tmp->HasFlag(NODE_HAS_LISTENERMANAGER)) { \
|
||||
nsContentUtils::RemoveListenerManager(tmp); \
|
||||
tmp->UnsetFlags(NODE_HAS_LISTENERMANAGER); \
|
||||
}
|
||||
|
||||
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_USERDATA \
|
||||
if (tmp->HasProperties()) { \
|
||||
nsNodeUtils::UnlinkUserData(tmp); \
|
||||
}
|
||||
|
||||
|
||||
#endif /* nsIContent_h___ */
|
||||
|
|
|
@ -801,6 +801,9 @@ public:
|
|||
// putting a DestroySlots function on nsINode
|
||||
virtual ~nsSlots();
|
||||
|
||||
void Traverse(nsCycleCollectionTraversalCallback &cb);
|
||||
void Unlink();
|
||||
|
||||
/**
|
||||
* A list of mutation observers
|
||||
*/
|
||||
|
@ -1342,6 +1345,10 @@ protected:
|
|||
#undef TOUCH_EVENT
|
||||
#undef EVENT
|
||||
|
||||
static void Trace(nsINode *tmp, TraceCallback cb, void *closure);
|
||||
static bool Traverse(nsINode *tmp, nsCycleCollectionTraversalCallback &cb);
|
||||
static void Unlink(nsINode *tmp);
|
||||
|
||||
nsCOMPtr<nsINodeInfo> mNodeInfo;
|
||||
|
||||
nsINode* mParent;
|
||||
|
|
|
@ -153,14 +153,14 @@ interface nsISelectionPrivate : nsISelection
|
|||
void GetRangesForInterval(
|
||||
in nsIDOMNode beginNode, in PRInt32 beginOffset,
|
||||
in nsIDOMNode endNode, in PRInt32 endOffset,
|
||||
in PRBool allowAdjacent,
|
||||
in boolean allowAdjacent,
|
||||
out PRUint32 resultCount,
|
||||
[retval, array, size_is(resultCount)] out nsIDOMRange results);
|
||||
|
||||
[noscript] void GetRangesForIntervalCOMArray(
|
||||
in nsIDOMNode beginNode, in PRInt32 beginOffset,
|
||||
in nsIDOMNode endNode, in PRInt32 endOffset,
|
||||
in PRBool allowAdjacent,
|
||||
in boolean allowAdjacent,
|
||||
in RangeArray results);
|
||||
|
||||
/**
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#include "mozAutoDocUpdate.h"
|
||||
#include "nsMutationEvent.h"
|
||||
#include "nsPLDOMEvent.h"
|
||||
#include "nsContentUtils.h" // NS_IMPL_CYCLE_COLLECTION_UNLINK_LISTENERMANAGER
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
|
@ -105,25 +104,25 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMAttribute)
|
|||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMAttribute)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mNodeInfo)
|
||||
|
||||
if (!nsINode::Traverse(tmp, cb)) {
|
||||
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mChild)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_LISTENERMANAGER
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_USERDATA
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMAttribute)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
|
||||
nsINode::Trace(tmp, aCallback, aClosure);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMAttribute)
|
||||
nsINode::Unlink(tmp);
|
||||
if (tmp->mChild) {
|
||||
static_cast<nsTextNode*>(tmp->mChild)->UnbindFromAttribute();
|
||||
NS_RELEASE(tmp->mChild);
|
||||
tmp->mFirstChild = nsnull;
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_LISTENERMANAGER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_USERDATA
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
DOMCI_NODE_DATA(Attr, nsDOMAttribute)
|
||||
|
|
|
@ -1825,7 +1825,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
|
|||
// if we're uncollectable.
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
|
||||
|
||||
if (nsCCUncollectableMarker::InGeneration(cb, tmp->GetMarkedCCGeneration())) {
|
||||
if (!nsINode::Traverse(tmp, cb)) {
|
||||
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
|
||||
}
|
||||
|
||||
|
@ -1833,16 +1833,12 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
|
|||
|
||||
tmp->mExternalResourceMap.Traverse(&cb);
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mNodeInfo)
|
||||
|
||||
// Traverse the mChildren nsAttrAndChildArray.
|
||||
for (PRInt32 indx = PRInt32(tmp->mChildren.ChildCount()); indx > 0; --indx) {
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mChildren[i]");
|
||||
cb.NoteXPCOMChild(tmp->mChildren.ChildAt(indx - 1));
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_USERDATA
|
||||
|
||||
// Traverse all nsIDocument pointer members.
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mCachedRootElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mSecurityInfo)
|
||||
|
@ -1901,7 +1897,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|||
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDocument)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
|
||||
nsINode::Trace(tmp, aCallback, aClosure);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
|
||||
|
||||
|
@ -1913,6 +1909,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
|
|||
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
|
||||
nsINode::Unlink(tmp);
|
||||
|
||||
// Unlink the mChildren nsAttrAndChildArray.
|
||||
for (PRInt32 indx = PRInt32(tmp->mChildren.ChildCount()) - 1;
|
||||
indx >= 0; --indx) {
|
||||
|
@ -1930,9 +1928,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
|
|||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mOriginalDocument)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mCachedEncoder)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_USERDATA
|
||||
|
||||
tmp->mParentDocument = nsnull;
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(mPreloadingImages)
|
||||
|
|
|
@ -93,7 +93,7 @@ nsGenericDOMDataNode::~nsGenericDOMDataNode()
|
|||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsGenericDOMDataNode)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsGenericDOMDataNode)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
|
||||
nsINode::Trace(tmp, aCallback, aClosure);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGenericDOMDataNode)
|
||||
|
@ -101,28 +101,18 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGenericDOMDataNode)
|
|||
// if we're uncollectable.
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
|
||||
|
||||
nsIDocument* currentDoc = tmp->GetCurrentDoc();
|
||||
if (currentDoc && nsCCUncollectableMarker::InGeneration(
|
||||
cb, currentDoc->GetMarkedCCGeneration())) {
|
||||
if (!nsINode::Traverse(tmp, cb)) {
|
||||
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mNodeInfo)
|
||||
|
||||
nsIDocument* ownerDoc = tmp->GetOwnerDoc();
|
||||
if (ownerDoc) {
|
||||
ownerDoc->BindingManager()->Traverse(tmp, cb);
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_LISTENERMANAGER
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_USERDATA
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(GetParent())
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericDOMDataNode)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_LISTENERMANAGER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_USERDATA
|
||||
nsINode::Unlink(tmp);
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsGenericDOMDataNode)
|
||||
|
|
|
@ -174,6 +174,22 @@ nsINode::nsSlots::~nsSlots()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsINode::nsSlots::Traverse(nsCycleCollectionTraversalCallback &cb)
|
||||
{
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mChildNodes");
|
||||
cb.NoteXPCOMChild(mChildNodes);
|
||||
}
|
||||
|
||||
void
|
||||
nsINode::nsSlots::Unlink()
|
||||
{
|
||||
if (mChildNodes) {
|
||||
mChildNodes->DropReference();
|
||||
NS_RELEASE(mChildNodes);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsINode::~nsINode()
|
||||
|
@ -1142,6 +1158,63 @@ nsINode::GetContextForEventHandlers(nsresult* aRv)
|
|||
return nsContentUtils::GetContextForEventHandlers(this, aRv);
|
||||
}
|
||||
|
||||
/* static */
|
||||
void
|
||||
nsINode::Trace(nsINode *tmp, TraceCallback cb, void *closure)
|
||||
{
|
||||
nsContentUtils::TraceWrapper(tmp, cb, closure);
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool
|
||||
nsINode::Traverse(nsINode *tmp, nsCycleCollectionTraversalCallback &cb)
|
||||
{
|
||||
nsIDocument *currentDoc = tmp->GetCurrentDoc();
|
||||
if (currentDoc &&
|
||||
nsCCUncollectableMarker::InGeneration(cb, currentDoc->GetMarkedCCGeneration())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mNodeInfo)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(GetParent())
|
||||
|
||||
nsSlots *slots = tmp->GetExistingSlots();
|
||||
if (slots) {
|
||||
slots->Traverse(cb);
|
||||
}
|
||||
|
||||
if (tmp->HasProperties()) {
|
||||
nsNodeUtils::TraverseUserData(tmp, cb);
|
||||
}
|
||||
|
||||
if (tmp->HasFlag(NODE_HAS_LISTENERMANAGER)) {
|
||||
nsContentUtils::TraverseListenerManager(tmp, cb);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* static */
|
||||
void
|
||||
nsINode::Unlink(nsINode *tmp)
|
||||
{
|
||||
nsContentUtils::ReleaseWrapper(tmp, tmp);
|
||||
|
||||
nsSlots *slots = tmp->GetExistingSlots();
|
||||
if (slots) {
|
||||
slots->Unlink();
|
||||
}
|
||||
|
||||
if (tmp->HasFlag(NODE_HAS_LISTENERMANAGER)) {
|
||||
nsContentUtils::RemoveListenerManager(tmp);
|
||||
tmp->UnsetFlags(NODE_HAS_LISTENERMANAGER);
|
||||
}
|
||||
|
||||
if (tmp->HasProperties()) {
|
||||
nsNodeUtils::UnlinkUserData(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsEventStates
|
||||
|
@ -2192,6 +2265,45 @@ nsGenericElement::nsDOMSlots::~nsDOMSlots()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsGenericElement::nsDOMSlots::Traverse(nsCycleCollectionTraversalCallback &cb, bool aIsXUL)
|
||||
{
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mStyle");
|
||||
cb.NoteXPCOMChild(mStyle.get());
|
||||
|
||||
#ifdef MOZ_SMIL
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mSMILOverrideStyle");
|
||||
cb.NoteXPCOMChild(mSMILOverrideStyle.get());
|
||||
#endif // MOZ_SMIL
|
||||
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mAttributeMap");
|
||||
cb.NoteXPCOMChild(mAttributeMap.get());
|
||||
|
||||
if (aIsXUL) {
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mControllers");
|
||||
cb.NoteXPCOMChild(mControllers);
|
||||
}
|
||||
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mChildrenList");
|
||||
cb.NoteXPCOMChild(NS_ISUPPORTS_CAST(nsIDOMNodeList*, mChildrenList));
|
||||
}
|
||||
|
||||
void
|
||||
nsGenericElement::nsDOMSlots::Unlink(bool aIsXUL)
|
||||
{
|
||||
mStyle = nsnull;
|
||||
#ifdef MOZ_SMIL
|
||||
mSMILOverrideStyle = nsnull;
|
||||
#endif // MOZ_SMIL
|
||||
if (mAttributeMap) {
|
||||
mAttributeMap->DropReference();
|
||||
mAttributeMap = nsnull;
|
||||
}
|
||||
if (aIsXUL)
|
||||
NS_IF_RELEASE(mControllers);
|
||||
mChildrenList = nsnull;
|
||||
}
|
||||
|
||||
nsGenericElement::nsGenericElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
: Element(aNodeInfo)
|
||||
{
|
||||
|
@ -4110,9 +4222,7 @@ nsINode::IsSameNode(nsIDOMNode* aOther, PRBool* aReturn)
|
|||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsGenericElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_LISTENERMANAGER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_USERDATA
|
||||
nsINode::Unlink(tmp);
|
||||
|
||||
if (tmp->HasProperties() && tmp->IsXUL()) {
|
||||
tmp->DeleteProperty(nsGkAtoms::contextmenulistener);
|
||||
|
@ -4140,17 +4250,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericElement)
|
|||
{
|
||||
nsDOMSlots *slots = tmp->GetExistingDOMSlots();
|
||||
if (slots) {
|
||||
slots->mStyle = nsnull;
|
||||
#ifdef MOZ_SMIL
|
||||
slots->mSMILOverrideStyle = nsnull;
|
||||
#endif // MOZ_SMIL
|
||||
if (slots->mAttributeMap) {
|
||||
slots->mAttributeMap->DropReference();
|
||||
slots->mAttributeMap = nsnull;
|
||||
}
|
||||
if (tmp->IsXUL())
|
||||
NS_IF_RELEASE(slots->mControllers);
|
||||
slots->mChildrenList = nsnull;
|
||||
slots->Unlink(tmp->IsXUL());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4163,7 +4263,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericElement)
|
|||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsGenericElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
|
||||
nsINode::Trace(tmp, aCallback, aClosure);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
|
||||
static const char* kNSURIs[] = {
|
||||
|
@ -4204,9 +4304,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGenericElement)
|
|||
// if we're uncollectable.
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
|
||||
|
||||
nsIDocument* currentDoc = tmp->GetCurrentDoc();
|
||||
if (currentDoc && nsCCUncollectableMarker::InGeneration(
|
||||
cb, currentDoc->GetMarkedCCGeneration())) {
|
||||
if (!nsINode::Traverse(tmp, cb)) {
|
||||
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
|
||||
}
|
||||
|
||||
|
@ -4215,9 +4313,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGenericElement)
|
|||
ownerDoc->BindingManager()->Traverse(tmp, cb);
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_LISTENERMANAGER
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_USERDATA
|
||||
|
||||
if (tmp->HasProperties() && tmp->IsXUL()) {
|
||||
nsISupports* property =
|
||||
static_cast<nsISupports*>
|
||||
|
@ -4248,31 +4343,13 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGenericElement)
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mNodeInfo)
|
||||
|
||||
// Traverse any DOM slots of interest.
|
||||
{
|
||||
nsDOMSlots *slots = tmp->GetExistingDOMSlots();
|
||||
if (slots) {
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "slots mStyle");
|
||||
cb.NoteXPCOMChild(slots->mStyle.get());
|
||||
|
||||
#ifdef MOZ_SMIL
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "slots mSMILOverrideStyle");
|
||||
cb.NoteXPCOMChild(slots->mSMILOverrideStyle.get());
|
||||
#endif // MOZ_SMIL
|
||||
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "slots mAttributeMap");
|
||||
cb.NoteXPCOMChild(slots->mAttributeMap.get());
|
||||
|
||||
if (tmp->IsXUL())
|
||||
cb.NoteXPCOMChild(slots->mControllers);
|
||||
cb.NoteXPCOMChild(
|
||||
static_cast<nsIDOMNodeList*>(slots->mChildrenList.get()));
|
||||
slots->Traverse(cb, tmp->IsXUL());
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(GetParent())
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
|
||||
|
|
|
@ -826,6 +826,9 @@ public:
|
|||
nsDOMSlots();
|
||||
virtual ~nsDOMSlots();
|
||||
|
||||
void Traverse(nsCycleCollectionTraversalCallback &cb, bool aIsXUL);
|
||||
void Unlink(bool aIsXUL);
|
||||
|
||||
/**
|
||||
* The .style attribute (an interface that forwards to the actual
|
||||
* style rules)
|
||||
|
|
|
@ -1525,10 +1525,13 @@ nsObjectLoadingContent::RemovedFromDocument()
|
|||
}
|
||||
}
|
||||
|
||||
/* static */
|
||||
void
|
||||
nsObjectLoadingContent::Traverse(nsCycleCollectionTraversalCallback &cb)
|
||||
nsObjectLoadingContent::Traverse(nsObjectLoadingContent *tmp,
|
||||
nsCycleCollectionTraversalCallback &cb)
|
||||
{
|
||||
cb.NoteXPCOMChild(static_cast<nsIFrameLoader*>(mFrameLoader));
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mFrameLoader");
|
||||
cb.NoteXPCOMChild(static_cast<nsIFrameLoader*>(tmp->mFrameLoader));
|
||||
}
|
||||
|
||||
// <private>
|
||||
|
|
|
@ -222,7 +222,8 @@ class nsObjectLoadingContent : public nsImageLoadingContent
|
|||
*/
|
||||
void RemovedFromDocument();
|
||||
|
||||
void Traverse(nsCycleCollectionTraversalCallback &cb);
|
||||
static void Traverse(nsObjectLoadingContent *tmp,
|
||||
nsCycleCollectionTraversalCallback &cb);
|
||||
|
||||
void CreateStaticClone(nsObjectLoadingContent* aDest) const;
|
||||
private:
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<html>
|
||||
<head>
|
||||
<script>
|
||||
|
||||
function boom()
|
||||
{
|
||||
var f = function() {
|
||||
document.documentElement.offsetHeight;
|
||||
};
|
||||
window.addEventListener("DOMSubtreeModified", f, true);
|
||||
|
||||
document.getElementsByTagName("table")[0].setAttribute("cellpadding", "2");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="boom();">
|
||||
<table><tr><td></td></tr></table>
|
||||
</body>
|
||||
</html>
|
|
@ -29,3 +29,4 @@ load 614279.html
|
|||
load 614988-1.html
|
||||
load 620078-1.html
|
||||
load 620078-2.html
|
||||
load 682460.html
|
||||
|
|
|
@ -196,7 +196,7 @@ nsHTMLObjectElement::DoneAddingChildren(PRBool aHaveNotified)
|
|||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLObjectElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLObjectElement,
|
||||
nsGenericHTMLFormElement)
|
||||
tmp->Traverse(cb);
|
||||
nsObjectLoadingContent::Traverse(tmp, cb);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsHTMLObjectElement, nsGenericElement)
|
||||
|
|
|
@ -216,7 +216,7 @@ nsHTMLSharedObjectElement::DoneAddingChildren(PRBool aHaveNotified)
|
|||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLSharedObjectElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLSharedObjectElement,
|
||||
nsGenericHTMLElement)
|
||||
tmp->Traverse(cb);
|
||||
nsObjectLoadingContent::Traverse(tmp, cb);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsHTMLSharedObjectElement, nsGenericElement)
|
||||
|
|
|
@ -206,7 +206,7 @@ nsHTMLTableCellElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsIContent* node = GetTable();
|
||||
if (node && node->IsHTML() && node->NodeInfo()->Equals(nsGkAtoms::table)) {
|
||||
if (node && node->IsHTML(nsGkAtoms::table)) {
|
||||
nsHTMLTableElement* table = static_cast<nsHTMLTableElement*>(node);
|
||||
nsMappedAttributes* tableInheritedAttributes =
|
||||
table->GetAttributesMappedForCell();
|
||||
|
|
|
@ -1276,32 +1276,25 @@ nsHTMLTableElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
nsIAtom* aPrefix, const nsAString& aValue,
|
||||
PRBool aNotify)
|
||||
nsHTMLTableElement::BeforeSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString* aValue,
|
||||
PRBool aNotify)
|
||||
{
|
||||
PRBool isCellPadding = (aAttribute == nsGkAtoms::cellpadding);
|
||||
if (isCellPadding) {
|
||||
if (aName == nsGkAtoms::cellpadding && aNameSpaceID == kNameSpaceID_None) {
|
||||
ReleaseInheritedAttributes();
|
||||
}
|
||||
|
||||
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aAttribute,
|
||||
aPrefix, aValue, aNotify);
|
||||
|
||||
if (isCellPadding) {
|
||||
BuildInheritedAttributes();
|
||||
}
|
||||
return rv;
|
||||
return nsGenericHTMLElement::BeforeSetAttr(aNameSpaceID, aName, aValue,
|
||||
aNotify);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
PRBool aNotify)
|
||||
nsHTMLTableElement::AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString* aValue,
|
||||
PRBool aNotify)
|
||||
{
|
||||
PRBool isCellPadding = (aAttribute == nsGkAtoms::cellpadding);
|
||||
if (isCellPadding) {
|
||||
ReleaseInheritedAttributes();
|
||||
if (aName == nsGkAtoms::cellpadding && aNameSpaceID == kNameSpaceID_None) {
|
||||
BuildInheritedAttributes();
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
|
||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
||||
aNotify);
|
||||
}
|
||||
|
|
|
@ -1,116 +1,120 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "nsIDOMHTMLTableElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsMappedAttributes.h"
|
||||
|
||||
#define TABLE_ATTRS_DIRTY ((nsMappedAttributes*)0x1)
|
||||
|
||||
|
||||
class TableRowsCollection;
|
||||
|
||||
class nsHTMLTableElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLTableElement
|
||||
{
|
||||
public:
|
||||
nsHTMLTableElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
virtual ~nsHTMLTableElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLTableElement
|
||||
NS_DECL_NSIDOMHTMLTABLEELEMENT
|
||||
|
||||
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
|
||||
virtual nsXPCClassInfo* GetClassInfo();
|
||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
nsIContent* aBindingParent,
|
||||
PRBool aCompileEventHandlers);
|
||||
virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
|
||||
PRBool aNullParent = PR_TRUE);
|
||||
virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom *aName,
|
||||
nsIAtom *aPrefix, const nsAString &aValue,
|
||||
PRBool aNotify);
|
||||
virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
PRBool aNotify);
|
||||
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLTableElement,
|
||||
nsGenericHTMLElement)
|
||||
nsMappedAttributes* GetAttributesMappedForCell();
|
||||
already_AddRefed<nsIDOMHTMLTableSectionElement> GetTHead() {
|
||||
return GetSection(nsGkAtoms::thead);
|
||||
}
|
||||
already_AddRefed<nsIDOMHTMLTableSectionElement> GetTFoot() {
|
||||
return GetSection(nsGkAtoms::tfoot);
|
||||
}
|
||||
nsContentList* TBodies();
|
||||
protected:
|
||||
already_AddRefed<nsIDOMHTMLTableSectionElement> GetSection(nsIAtom *aTag);
|
||||
|
||||
nsRefPtr<nsContentList> mTBodies;
|
||||
nsRefPtr<TableRowsCollection> mRows;
|
||||
// Sentinel value of TABLE_ATTRS_DIRTY indicates that this is dirty and needs
|
||||
// to be recalculated.
|
||||
nsMappedAttributes *mTableInheritedAttributes;
|
||||
void BuildInheritedAttributes();
|
||||
void ReleaseInheritedAttributes() {
|
||||
if (mTableInheritedAttributes &&
|
||||
mTableInheritedAttributes != TABLE_ATTRS_DIRTY)
|
||||
NS_RELEASE(mTableInheritedAttributes);
|
||||
mTableInheritedAttributes = TABLE_ATTRS_DIRTY;
|
||||
}
|
||||
};
|
||||
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "nsIDOMHTMLTableElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsMappedAttributes.h"
|
||||
|
||||
#define TABLE_ATTRS_DIRTY ((nsMappedAttributes*)0x1)
|
||||
|
||||
|
||||
class TableRowsCollection;
|
||||
|
||||
class nsHTMLTableElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLTableElement
|
||||
{
|
||||
public:
|
||||
nsHTMLTableElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
virtual ~nsHTMLTableElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLTableElement
|
||||
NS_DECL_NSIDOMHTMLTABLEELEMENT
|
||||
|
||||
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
|
||||
virtual nsXPCClassInfo* GetClassInfo();
|
||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
nsIContent* aBindingParent,
|
||||
PRBool aCompileEventHandlers);
|
||||
virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
|
||||
PRBool aNullParent = PR_TRUE);
|
||||
/**
|
||||
* Called when an attribute is about to be changed
|
||||
*/
|
||||
virtual nsresult BeforeSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString* aValue, PRBool aNotify);
|
||||
/**
|
||||
* Called when an attribute has just been changed
|
||||
*/
|
||||
virtual nsresult AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString* aValue, PRBool aNotify);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLTableElement,
|
||||
nsGenericHTMLElement)
|
||||
nsMappedAttributes* GetAttributesMappedForCell();
|
||||
already_AddRefed<nsIDOMHTMLTableSectionElement> GetTHead() {
|
||||
return GetSection(nsGkAtoms::thead);
|
||||
}
|
||||
already_AddRefed<nsIDOMHTMLTableSectionElement> GetTFoot() {
|
||||
return GetSection(nsGkAtoms::tfoot);
|
||||
}
|
||||
nsContentList* TBodies();
|
||||
protected:
|
||||
already_AddRefed<nsIDOMHTMLTableSectionElement> GetSection(nsIAtom *aTag);
|
||||
|
||||
nsRefPtr<nsContentList> mTBodies;
|
||||
nsRefPtr<TableRowsCollection> mRows;
|
||||
// Sentinel value of TABLE_ATTRS_DIRTY indicates that this is dirty and needs
|
||||
// to be recalculated.
|
||||
nsMappedAttributes *mTableInheritedAttributes;
|
||||
void BuildInheritedAttributes();
|
||||
void ReleaseInheritedAttributes() {
|
||||
if (mTableInheritedAttributes &&
|
||||
mTableInheritedAttributes != TABLE_ATTRS_DIRTY)
|
||||
NS_RELEASE(mTableInheritedAttributes);
|
||||
mTableInheritedAttributes = TABLE_ATTRS_DIRTY;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -253,6 +253,13 @@ nsXULElement::nsXULSlots::~nsXULSlots()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsXULElement::nsXULSlots::Traverse(nsCycleCollectionTraversalCallback &cb)
|
||||
{
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mFrameLoader");
|
||||
cb.NoteXPCOMChild(NS_ISUPPORTS_CAST(nsIFrameLoader*, mFrameLoader));
|
||||
}
|
||||
|
||||
nsINode::nsSlots*
|
||||
nsXULElement::CreateSlots()
|
||||
{
|
||||
|
@ -372,10 +379,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULElement,
|
|||
{
|
||||
nsXULSlots* slots = static_cast<nsXULSlots*>(tmp->GetExistingSlots());
|
||||
if (slots) {
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mFrameLoader");
|
||||
nsISupports *frameLoader =
|
||||
static_cast<nsIFrameLoader*>(slots->mFrameLoader);
|
||||
cb.NoteXPCOMChild(frameLoader);
|
||||
slots->Traverse(cb);
|
||||
}
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
|
|
@ -593,10 +593,12 @@ protected:
|
|||
class nsXULSlots : public nsGenericElement::nsDOMSlots
|
||||
{
|
||||
public:
|
||||
nsXULSlots();
|
||||
virtual ~nsXULSlots();
|
||||
nsXULSlots();
|
||||
virtual ~nsXULSlots();
|
||||
|
||||
nsRefPtr<nsFrameLoader> mFrameLoader;
|
||||
void Traverse(nsCycleCollectionTraversalCallback &cb);
|
||||
|
||||
nsRefPtr<nsFrameLoader> mFrameLoader;
|
||||
};
|
||||
|
||||
virtual nsINode::nsSlots* CreateSlots();
|
||||
|
|
|
@ -229,6 +229,10 @@ LSYM(Lepilogue):
|
|||
.size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV)
|
||||
|
||||
|
||||
/* Below are VFP hard-float ABI call and closure implementations.
|
||||
Add VFP FPU directive here. */
|
||||
.fpu vfp
|
||||
|
||||
@ r0: fn
|
||||
@ r1: &ecif
|
||||
@ r2: cif->bytes
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
function test() {
|
||||
document.querySelector("div").focus();
|
||||
// type a character, then press backspace to delete it
|
||||
sendKey("X", window);
|
||||
sendKey("BACK_SPACE", window);
|
||||
sendKey("X", "div1");
|
||||
sendKey("BACK_SPACE", "div1");
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="test()">
|
||||
<div contenteditable></div>
|
||||
<div id="div1" contenteditable></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
function test() {
|
||||
document.querySelector("div").focus();
|
||||
// type a character, then press backspace to delete it
|
||||
sendKey("X", window);
|
||||
sendKey("BACK_SPACE", window);
|
||||
sendKey("X", "div1");
|
||||
sendKey("BACK_SPACE", "div1");
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="test()">
|
||||
<div contenteditable></div>
|
||||
<div id="div1" contenteditable></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
function test() {
|
||||
document.querySelector("div").focus();
|
||||
// type a character, then press backspace to delete it
|
||||
sendKey("X", window);
|
||||
sendKey("BACK_SPACE", window);
|
||||
sendKey("X", "div1");
|
||||
sendKey("BACK_SPACE", "div1");
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="test()">
|
||||
<div contenteditable></div>
|
||||
<div id="div1" contenteditable></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -94,46 +94,53 @@ function endTest() {
|
|||
}
|
||||
}
|
||||
|
||||
var isWindows = /WINNT/.test(SpecialPowers.OS);
|
||||
|
||||
var tests = [
|
||||
[ 'bug106855-1.html' , 'bug106855-1-ref.html' ] ,
|
||||
[ 'bug106855-2.html' , 'bug106855-1-ref.html' ] ,
|
||||
[ 'bug240933-1.html' , 'bug240933-1-ref.html' ] ,
|
||||
[ 'bug240933-2.html' , 'bug240933-1-ref.html' ] ,
|
||||
[ 'bug389321-1.html' , 'bug389321-1-ref.html' ] ,
|
||||
[ 'bug389321-2.html' , 'bug389321-2-ref.html' ] ,
|
||||
[ 'bug389321-3.html' , 'bug389321-3-ref.html' ] ,
|
||||
[ 'bug482484.html' , 'bug482484-ref.html' ] ,
|
||||
[ 'bug512295-1.html' , 'bug512295-1-ref.html' ] ,
|
||||
[ 'bug512295-2.html' , 'bug512295-2-ref.html' ] ,
|
||||
[ 'bug585922.html' , 'bug585922-ref.html' ] ,
|
||||
[ 'bug597519-1.html' , 'bug597519-1-ref.html' ] ,
|
||||
[ 'bug602141-1.html' , 'bug602141-1-ref.html' ] ,
|
||||
[ 'bug602141-2.html' , 'bug602141-2-ref.html' ] ,
|
||||
[ 'bug602141-3.html' , 'bug602141-3-ref.html' ] ,
|
||||
[ 'bug602141-4.html' , 'bug602141-4-ref.html' ] ,
|
||||
[ 'bug612271-1.html' , 'bug612271-ref.html' ] ,
|
||||
[ 'bug612271-2.html' , 'bug612271-ref.html' ] ,
|
||||
[ 'bug612271-3.html' , 'bug612271-ref.html' ] ,
|
||||
[ 'bug613433-1.html' , 'bug613433-ref.html' ] ,
|
||||
[ 'bug613433-2.html' , 'bug613433-ref.html' ] ,
|
||||
[ 'bug613433-3.html' , 'bug613433-ref.html' ] ,
|
||||
// [ 'bug613807-1.html' , 'bug613807-1-ref.html' ] , // see bug 680574
|
||||
[ 'bug632215-1.html' , 'bug632215-ref.html' ] ,
|
||||
[ 'bug632215-2.html' , 'bug632215-ref.html' ] ,
|
||||
[ 'bug633044-1.html' , 'bug633044-1-ref.html' ] ,
|
||||
[ 'bug634406-1.html' , 'bug634406-1-ref.html' ] ,
|
||||
[ 'bug644428-1.html' , 'bug644428-1-ref.html' ] ,
|
||||
function() {
|
||||
SpecialPowers.setBoolPref("bidi.browser.ui", true);
|
||||
},
|
||||
[ 'bug646382-1.html' , 'bug646382-1-ref.html' ] ,
|
||||
// [ 'bug646382-2.html' , 'bug646382-2-ref.html' ] , // see bug 680577
|
||||
[ 'bug664087-1.html' , 'bug664087-1-ref.html' ] ,
|
||||
// [ 'bug664087-2.html' , 'bug664087-2-ref.html' ] , // see bug 680578
|
||||
function() {
|
||||
SpecialPowers.clearUserPref("bidi.browser.ui");
|
||||
},
|
||||
];
|
||||
|
||||
if (!isWindows) {
|
||||
tests.push([ 'bug106855-2.html' , 'bug106855-1-ref.html' ]); // bug 681138
|
||||
tests.push([ 'bug240933-1.html' , 'bug240933-1-ref.html' ]); // bug 681144
|
||||
tests.push([ 'bug240933-2.html' , 'bug240933-1-ref.html' ]); // bug 681162
|
||||
tests.push([ 'bug512295-1.html' , 'bug512295-1-ref.html' ]); // bug 681152
|
||||
tests.push([ 'bug512295-2.html' , 'bug512295-2-ref.html' ]); // bug 681331
|
||||
tests.push([ 'bug597519-1.html' , 'bug597519-1-ref.html' ]); // bug 680579
|
||||
tests.push([ 'bug602141-1.html' , 'bug602141-1-ref.html' ]); // bug 681334
|
||||
tests.push([ 'bug602141-4.html' , 'bug602141-4-ref.html' ]); // bug 681167
|
||||
tests.push([ 'bug612271-1.html' , 'bug612271-ref.html' ]); // bug 681032
|
||||
tests.push([ 'bug612271-2.html' , 'bug612271-ref.html' ]); // bug 680581
|
||||
tests.push([ 'bug612271-3.html' , 'bug612271-ref.html' ]); // bug 681035
|
||||
tests.push([ 'bug613433-1.html' , 'bug613433-ref.html' ]); // bug 681332
|
||||
tests.push([ 'bug613807-1.html' , 'bug613807-1-ref.html' ]); // bug 680574
|
||||
tests.push([ 'bug634406-1.html' , 'bug634406-1-ref.html' ]); // bug 681146
|
||||
}
|
||||
|
||||
tests.push(function() {SpecialPowers.setBoolPref("bidi.browser.ui", true);});
|
||||
|
||||
if (!isWindows) {
|
||||
tests.push([ 'bug646382-1.html' , 'bug646382-1-ref.html' ]); // bug 681076
|
||||
tests.push([ 'bug646382-2.html' , 'bug646382-2-ref.html' ]); // bug 680577
|
||||
tests.push([ 'bug664087-1.html' , 'bug664087-1-ref.html' ]); // bug 681038
|
||||
tests.push([ 'bug664087-2.html' , 'bug664087-2-ref.html' ]); // bug 680578
|
||||
}
|
||||
|
||||
tests.push(function() {SpecialPowers.clearUserPref("bidi.browser.ui");});
|
||||
|
||||
var testIndex = 0;
|
||||
|
||||
function nextTest() {
|
||||
|
|
|
@ -143,6 +143,10 @@ nsAutoFilterInstance::nsAutoFilterInstance(nsIFrame *aTarget,
|
|||
}
|
||||
|
||||
gfxMatrix userToDeviceSpace = nsSVGUtils::GetCanvasTM(aTarget);
|
||||
if (userToDeviceSpace.IsSingular()) {
|
||||
// nothing to draw
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate filterRes (the width and height of the pixel buffer of the
|
||||
// temporary offscreen surface that we'll paint into):
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="width: 0pt; padding: 100px;">
|
||||
<filter id="s"/>
|
||||
<g filter="url(#s)"><text>z</text></g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 190 B |
|
@ -115,3 +115,4 @@ load 655025-3.svg
|
|||
load 657077-1.svg
|
||||
load 669025-1.svg
|
||||
load 669025-2.svg
|
||||
load 682411-1.svg
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
nsTreeColumn::nsTreeColumn(nsTreeColumns* aColumns, nsIContent* aContent)
|
||||
: mContent(aContent),
|
||||
mColumns(aColumns),
|
||||
mNext(nsnull),
|
||||
mPrevious(nsnull)
|
||||
{
|
||||
NS_ASSERTION(aContent &&
|
||||
|
@ -70,11 +69,21 @@ nsTreeColumn::~nsTreeColumn()
|
|||
{
|
||||
if (mNext) {
|
||||
mNext->SetPrevious(nsnull);
|
||||
NS_RELEASE(mNext);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_1(nsTreeColumn, mContent)
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsTreeColumn)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsTreeColumn)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mContent)
|
||||
if (tmp->mNext) {
|
||||
tmp->mNext->SetPrevious(nsnull);
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mNext)
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsTreeColumn)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mContent)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mNext)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsTreeColumn)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsTreeColumn)
|
||||
|
|
|
@ -110,7 +110,7 @@ protected:
|
|||
nsTreeColumn* GetPrevious() { return mPrevious; }
|
||||
void SetNext(nsTreeColumn* aNext) {
|
||||
NS_ASSERTION(!mNext, "already have a next sibling");
|
||||
NS_IF_ADDREF(mNext = aNext);
|
||||
mNext = aNext;
|
||||
}
|
||||
void SetPrevious(nsTreeColumn* aPrevious) { mPrevious = aPrevious; }
|
||||
|
||||
|
@ -138,7 +138,7 @@ private:
|
|||
PRInt8 mCropStyle;
|
||||
PRInt8 mTextAlignment;
|
||||
|
||||
nsTreeColumn* mNext;
|
||||
nsRefPtr<nsTreeColumn> mNext;
|
||||
nsTreeColumn* mPrevious;
|
||||
};
|
||||
|
||||
|
|
|
@ -778,6 +778,10 @@ pref("network.http.qos", 0);
|
|||
// connection.
|
||||
pref("network.http.connection-retry-timeout", 250);
|
||||
|
||||
// Disable IPv6 for backup connections to workaround problems about broken
|
||||
// IPv6 connectivity.
|
||||
pref("network.http.fast-fallback-to-IPv4", false);
|
||||
|
||||
// default values for FTP
|
||||
// in a DSCP environment this should be 40 (0x28, or AF11), per RFC-4594,
|
||||
// Section 4.8 "High-Throughput Data Service Class", and 80 (0x50, or AF22)
|
||||
|
|
|
@ -1368,7 +1368,7 @@ nsHalfOpenSocket::SetupStreams(nsISocketTransport **transport,
|
|||
// IPv6 on the backup connection gives them a much better user experience
|
||||
// with dual-stack hosts, though they still pay the 250ms delay for each new
|
||||
// connection. This strategy is also known as "happy eyeballs".
|
||||
if (isBackup)
|
||||
if (isBackup && gHttpHandler->FastFallbackToIPv4())
|
||||
tmpFlags |= nsISocketTransport::DISABLE_IPV6;
|
||||
|
||||
socketTransport->SetConnectionFlags(tmpFlags);
|
||||
|
|
|
@ -170,6 +170,7 @@ nsHttpHandler::nsHttpHandler()
|
|||
, mCapabilities(NS_HTTP_ALLOW_KEEPALIVE)
|
||||
, mProxyCapabilities(NS_HTTP_ALLOW_KEEPALIVE)
|
||||
, mReferrerLevel(0xff) // by default we always send a referrer
|
||||
, mFastFallbackToIPv4(PR_FALSE)
|
||||
, mIdleTimeout(10)
|
||||
, mMaxRequestAttempts(10)
|
||||
, mMaxRequestDelay(10)
|
||||
|
@ -898,6 +899,12 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
|
|||
mIdleSynTimeout = (PRUint16) NS_CLAMP(val, 0, 3000);
|
||||
}
|
||||
|
||||
if (PREF_CHANGED(HTTP_PREF("fast-fallback-to-IPv4"))) {
|
||||
rv = prefs->GetBoolPref(HTTP_PREF("fast-fallback-to-IPv4"), &cVar);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
mFastFallbackToIPv4 = cVar;
|
||||
}
|
||||
|
||||
if (PREF_CHANGED(HTTP_PREF("version"))) {
|
||||
nsXPIDLCString httpVersion;
|
||||
prefs->GetCharPref(HTTP_PREF("version"), getter_Copies(httpVersion));
|
||||
|
|
|
@ -107,7 +107,8 @@ public:
|
|||
PRUint32 PhishyUserPassLength() { return mPhishyUserPassLength; }
|
||||
PRUint8 GetQoSBits() { return mQoSBits; }
|
||||
PRUint16 GetIdleSynTimeout() { return mIdleSynTimeout; }
|
||||
|
||||
PRBool FastFallbackToIPv4() { return mFastFallbackToIPv4; }
|
||||
|
||||
PRBool IsPersistentHttpsCachingEnabled() { return mEnablePersistentHttpsCaching; }
|
||||
|
||||
PRBool PromptTempRedirect() { return mPromptTempRedirect; }
|
||||
|
@ -259,6 +260,8 @@ private:
|
|||
PRUint8 mProxyCapabilities;
|
||||
PRUint8 mReferrerLevel;
|
||||
|
||||
PRPackedBool mFastFallbackToIPv4;
|
||||
|
||||
PRUint16 mIdleTimeout;
|
||||
PRUint16 mMaxRequestAttempts;
|
||||
PRUint16 mMaxRequestDelay;
|
||||
|
|
|
@ -294,6 +294,20 @@ SpecialPowers.prototype = {
|
|||
return this._xpcomabi;
|
||||
},
|
||||
|
||||
_os: null,
|
||||
|
||||
get OS() {
|
||||
if (this._os != null)
|
||||
return this._os;
|
||||
|
||||
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
|
||||
.getService(Components.interfaces.nsIXULAppInfo)
|
||||
.QueryInterface(Components.interfaces.nsIXULRuntime);
|
||||
|
||||
this._os = xulRuntime.OS;
|
||||
return this._os;
|
||||
},
|
||||
|
||||
registerProcessCrashObservers: function() {
|
||||
addMessageListener("SPProcessCrashService", this._messageListener);
|
||||
sendSyncMessage("SPProcessCrashService", { op: "register-observer" });
|
||||
|
|
|
@ -2695,6 +2695,15 @@ nsWindow::createQWidget(MozQWidget *parent, nsWidgetInitData *aInitData)
|
|||
}
|
||||
// Enable gestures:
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0))
|
||||
#if defined MOZ_ENABLE_MEEGOTOUCH
|
||||
// Disable default Gesture filters (speedup filtering)
|
||||
newView->viewport()->ungrabGesture(Qt::PanGesture);
|
||||
newView->viewport()->ungrabGesture(Qt::TapGesture);
|
||||
newView->viewport()->ungrabGesture(Qt::TapAndHoldGesture);
|
||||
newView->viewport()->ungrabGesture(Qt::SwipeGesture);
|
||||
#endif
|
||||
|
||||
// Enable required filters
|
||||
newView->viewport()->grabGesture(Qt::PinchGesture);
|
||||
newView->viewport()->grabGesture(gSwipeGestureId);
|
||||
#endif
|
||||
|
@ -2725,6 +2734,13 @@ nsWindow::createQWidget(MozQWidget *parent, nsWidgetInitData *aInitData)
|
|||
SetDefaultIcon();
|
||||
}
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0))
|
||||
#if defined MOZ_ENABLE_MEEGOTOUCH
|
||||
// Disable default Gesture filters (speedup filtering)
|
||||
widget->ungrabGesture(Qt::PanGesture);
|
||||
widget->ungrabGesture(Qt::TapGesture);
|
||||
widget->ungrabGesture(Qt::TapAndHoldGesture);
|
||||
widget->ungrabGesture(Qt::SwipeGesture);
|
||||
#endif
|
||||
widget->grabGesture(Qt::PinchGesture);
|
||||
widget->grabGesture(gSwipeGestureId);
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче