|
Lines 493-535
NeedsScriptTraverse(nsINode* aNode)
|
Link Here
|
---|
|
493 |
|
493 |
|
494 |
//---------------------------------------------------------------------- |
494 |
//---------------------------------------------------------------------- |
495 |
|
495 |
|
496 |
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsAttrChildContentList) |
496 |
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsChildContentList) |
497 |
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsAttrChildContentList) |
497 |
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsChildContentList) |
498 |
|
498 |
|
499 |
// If nsAttrChildContentList is changed so that any additional fields are |
499 |
// If nsChildContentList is changed so that any additional fields are |
500 |
// traversed by the cycle collector, then CAN_SKIP must be updated to |
500 |
// traversed by the cycle collector, then CAN_SKIP must be updated to |
501 |
// check that the additional fields are null. |
501 |
// check that the additional fields are null. |
502 |
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(nsAttrChildContentList) |
502 |
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(nsChildContentList) |
503 |
|
503 |
|
504 |
// nsAttrChildContentList only ever has a single child, its wrapper, so if |
504 |
// nsChildContentList only ever has a single child, its wrapper, so if |
505 |
// the wrapper is known-live, the list can't be part of a garbage cycle. |
505 |
// the wrapper is known-live, the list can't be part of a garbage cycle. |
506 |
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsAttrChildContentList) |
506 |
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsChildContentList) |
507 |
return tmp->HasKnownLiveWrapper(); |
507 |
return tmp->HasKnownLiveWrapper(); |
508 |
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END |
508 |
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END |
509 |
|
509 |
|
510 |
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsAttrChildContentList) |
510 |
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsChildContentList) |
511 |
return tmp->HasKnownLiveWrapperAndDoesNotNeedTracing(tmp); |
511 |
return tmp->HasKnownLiveWrapperAndDoesNotNeedTracing(tmp); |
512 |
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END |
512 |
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END |
513 |
|
513 |
|
514 |
// CanSkipThis returns false to avoid problems with incomplete unlinking. |
514 |
// CanSkipThis returns false to avoid problems with incomplete unlinking. |
515 |
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsAttrChildContentList) |
515 |
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsChildContentList) |
516 |
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END |
516 |
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END |
517 |
|
517 |
|
518 |
NS_INTERFACE_TABLE_HEAD(nsAttrChildContentList) |
518 |
NS_INTERFACE_TABLE_HEAD(nsChildContentList) |
519 |
NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY |
519 |
NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY |
520 |
NS_INTERFACE_TABLE(nsAttrChildContentList, nsINodeList, nsIDOMNodeList) |
520 |
NS_INTERFACE_TABLE(nsChildContentList, nsINodeList, nsIDOMNodeList) |
521 |
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsAttrChildContentList) |
521 |
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsChildContentList) |
522 |
NS_INTERFACE_MAP_END |
522 |
NS_INTERFACE_MAP_END |
523 |
|
523 |
|
524 |
JSObject* |
524 |
JSObject* |
525 |
nsAttrChildContentList::WrapObject(JSContext *cx, |
525 |
nsChildContentList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) |
526 |
JS::Handle<JSObject*> aGivenProto) |
|
|
527 |
{ |
526 |
{ |
528 |
return NodeListBinding::Wrap(cx, this, aGivenProto); |
527 |
return NodeListBinding::Wrap(cx, this, aGivenProto); |
529 |
} |
528 |
} |
530 |
|
529 |
|
531 |
NS_IMETHODIMP |
530 |
NS_IMETHODIMP |
532 |
nsAttrChildContentList::GetLength(uint32_t* aLength) |
531 |
nsChildContentList::GetLength(uint32_t* aLength) |
533 |
{ |
532 |
{ |
534 |
*aLength = mNode ? mNode->GetChildCount() : 0; |
533 |
*aLength = mNode ? mNode->GetChildCount() : 0; |
535 |
|
534 |
|
Lines 537-543
nsAttrChildContentList::GetLength(uint32
|
Link Here
|
---|
|
537 |
} |
536 |
} |
538 |
|
537 |
|
539 |
NS_IMETHODIMP |
538 |
NS_IMETHODIMP |
540 |
nsAttrChildContentList::Item(uint32_t aIndex, nsIDOMNode** aReturn) |
539 |
nsChildContentList::Item(uint32_t aIndex, nsIDOMNode** aReturn) |
541 |
{ |
540 |
{ |
542 |
nsINode* node = Item(aIndex); |
541 |
nsINode* node = Item(aIndex); |
543 |
if (!node) { |
542 |
if (!node) { |
Lines 550-556
nsAttrChildContentList::Item(uint32_t aI
|
Link Here
|
---|
|
550 |
} |
549 |
} |
551 |
|
550 |
|
552 |
nsIContent* |
551 |
nsIContent* |
553 |
nsAttrChildContentList::Item(uint32_t aIndex) |
552 |
nsChildContentList::Item(uint32_t aIndex) |
554 |
{ |
553 |
{ |
555 |
if (mNode) { |
554 |
if (mNode) { |
556 |
return mNode->GetChildAt(aIndex); |
555 |
return mNode->GetChildAt(aIndex); |
Lines 560-566
nsAttrChildContentList::Item(uint32_t aI
|
Link Here
|
---|
|
560 |
} |
559 |
} |
561 |
|
560 |
|
562 |
int32_t |
561 |
int32_t |
563 |
nsAttrChildContentList::IndexOf(nsIContent* aContent) |
562 |
nsChildContentList::IndexOf(nsIContent* aContent) |
564 |
{ |
563 |
{ |
565 |
if (mNode) { |
564 |
if (mNode) { |
566 |
return mNode->IndexOf(aContent); |
565 |
return mNode->IndexOf(aContent); |