本文整理汇总了C++中IsAnimValList函数的典型用法代码示例。如果您正苦于以下问题:C++ IsAnimValList函数的具体用法?C++ IsAnimValList怎么用?C++ IsAnimValList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsAnimValList函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MaybeRemoveItemFromAnimValListAt
void
DOMSVGPathSegList::
MaybeRemoveItemFromAnimValListAt(uint32_t aIndex,
uint32_t aArgCountForItem)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
if (AttrIsAnimating()) {
// animVal not a clone of baseVal
return;
}
// This needs to be a strong reference; otherwise, the RemovingFromList call
// below might drop the last reference to animVal before we're done with it.
nsRefPtr<DOMSVGPathSegList> animVal =
GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
if (!animVal) {
// No animVal list wrapper
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
if (animVal->ItemAt(aIndex)) {
animVal->ItemAt(aIndex)->RemovingFromList();
}
animVal->mItems.RemoveElementAt(aIndex);
animVal->UpdateListIndicesFromIndex(aIndex, -(1 + aArgCountForItem));
}
示例2: ItemAt
void
DOMSVGPathSegList::EnsureItemAt(uint32_t aIndex)
{
if (!ItemAt(aIndex)) {
ItemAt(aIndex) = DOMSVGPathSeg::CreateFor(this, aIndex, IsAnimValList());
}
}
示例3: MaybeInsertNullInAnimValListAt
void
DOMSVGPathSegList::
MaybeInsertNullInAnimValListAt(uint32_t aIndex,
uint32_t aInternalIndex,
uint32_t aArgCountForItem)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
if (AttrIsAnimating()) {
// animVal not a clone of baseVal
return;
}
// The anim val list is in sync with the base val list
DOMSVGPathSegList *animVal =
GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
if (!animVal) {
// No animVal list wrapper
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
animVal->mItems.InsertElementAt(aIndex, ItemProxy(nullptr, aInternalIndex));
animVal->UpdateListIndicesFromIndex(aIndex + 1, 1 + aArgCountForItem);
}
示例4: NS_ABORT_IF_FALSE
void
DOMSVGPointList::MaybeInsertNullInAnimValListAt(PRUint32 aIndex)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
if (AttrIsAnimating()) {
// animVal not a clone of baseVal
return;
}
// The anim val list is in sync with the base val list
DOMSVGPointList *animVal =
GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
if (!animVal) {
// No animVal list wrapper
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
animVal->mItems.InsertElementAt(aIndex, static_cast<DOMSVGPoint*>(nsnull));
UpdateListIndicesFromIndex(animVal->mItems, aIndex + 1);
}
示例5: InsertItemBefore
already_AddRefed<DOMSVGPathSeg>
DOMSVGPathSegList::Initialize(DOMSVGPathSeg& aNewItem, ErrorResult& aError)
{
if (IsAnimValList()) {
aError.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
return nullptr;
}
// If aNewItem is already in a list we should insert a clone of aNewItem,
// and for consistency, this should happen even if *this* is the list that
// aNewItem is currently in. Note that in the case of aNewItem being in this
// list, the Clear() call before the InsertItemBefore() call would remove it
// from this list, and so the InsertItemBefore() call would not insert a
// clone of aNewItem, it would actually insert aNewItem. To prevent that
// from happening we have to do the clone here, if necessary.
nsRefPtr<DOMSVGPathSeg> domItem = &aNewItem;
if (aNewItem.HasOwner()) {
domItem = aNewItem.Clone();
}
Clear(aError);
MOZ_ASSERT(!aError.Failed(), "How could this fail?");
return InsertItemBefore(*domItem, 0, aError);
}
示例6: InsertItemBefore
NS_IMETHODIMP
DOMSVGPointList::Initialize(nsIDOMSVGPoint *aNewItem,
nsIDOMSVGPoint **_retval)
{
*_retval = nsnull;
if (IsAnimValList()) {
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
}
// If aNewItem is already in a list we should insert a clone of aNewItem,
// and for consistency, this should happen even if *this* is the list that
// aNewItem is currently in. Note that in the case of aNewItem being in this
// list, the Clear() call before the InsertItemBefore() call would remove it
// from this list, and so the InsertItemBefore() call would not insert a
// clone of aNewItem, it would actually insert aNewItem. To prevent that
// from happening we have to do the clone here, if necessary.
nsCOMPtr<DOMSVGPoint> domItem = do_QueryInterface(aNewItem);
if (!domItem) {
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
}
if (domItem->HasOwner() || domItem->IsReadonly()) {
aNewItem = domItem->Clone();
}
Clear();
return InsertItemBefore(aNewItem, 0, _retval);
}
示例7: DOMSVGPoint
void
DOMSVGPointList::EnsureItemAt(PRUint32 aIndex)
{
if (!mItems[aIndex]) {
mItems[aIndex] = new DOMSVGPoint(this, aIndex, IsAnimValList());
}
}
示例8: Element
NS_IMETHODIMP
DOMSVGPointList::Clear()
{
if (IsAnimValList()) {
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
}
if (Length() > 0) {
nsAttrValue emptyOrOldValue = Element()->WillChangePointList();
// DOM list items that are to be removed must be removed before we change
// the internal list, otherwise they wouldn't be able to copy their
// internal counterparts' values!
InternalListWillChangeTo(SVGPointList()); // clears mItems
if (!AttrIsAnimating()) {
// The anim val list is in sync with the base val list
DOMSVGPointList *animList =
GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
if (animList) {
animList->InternalListWillChangeTo(SVGPointList()); // clears its mItems
}
}
InternalList().Clear();
Element()->DidChangePointList(emptyOrOldValue);
if (AttrIsAnimating()) {
Element()->AnimationNeedsResample();
}
}
return NS_OK;
}
示例9: DOMSVGLength
void
DOMSVGLengthList::EnsureItemAt(PRUint32 aIndex)
{
if (!mItems[aIndex]) {
mItems[aIndex] = new DOMSVGLength(this, AttrEnum(), aIndex, IsAnimValList());
}
}
示例10: InsertItemBefore
already_AddRefed<nsISVGPoint>
DOMSVGPointList::Initialize(nsISVGPoint& aNewItem, ErrorResult& aError)
{
if (IsAnimValList()) {
aError.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
return nullptr;
}
// If aNewItem is already in a list we should insert a clone of aNewItem,
// and for consistency, this should happen even if *this* is the list that
// aNewItem is currently in. Note that in the case of aNewItem being in this
// list, the Clear() call before the InsertItemBefore() call would remove it
// from this list, and so the InsertItemBefore() call would not insert a
// clone of aNewItem, it would actually insert aNewItem. To prevent that
// from happening we have to do the clone here, if necessary.
nsCOMPtr<nsISVGPoint> domItem = &aNewItem;
if (domItem->HasOwner() || domItem->IsReadonly()) {
domItem = domItem->Clone(); // must do this before changing anything!
}
ErrorResult rv;
Clear(rv);
MOZ_ASSERT(!rv.Failed());
return InsertItemBefore(*domItem, 0, aError);
}
示例11: InsertItemBefore
already_AddRefed<SVGTransform>
DOMSVGTransformList::Initialize(SVGTransform& newItem, ErrorResult& error)
{
if (IsAnimValList()) {
error.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
return nullptr;
}
// If newItem is already in a list we should insert a clone of newItem, and
// for consistency, this should happen even if *this* is the list that
// newItem is currently in. Note that in the case of newItem being in this
// list, the Clear() call before the InsertItemBefore() call would remove it
// from this list, and so the InsertItemBefore() call would not insert a
// clone of newItem, it would actually insert newItem. To prevent that from
// happening we have to do the clone here, if necessary.
nsRefPtr<SVGTransform> domItem = &newItem;
if (domItem->HasOwner()) {
domItem = newItem.Clone();
}
Clear(error);
MOZ_ASSERT(!error.Failed(), "How could this fail?");
return InsertItemBefore(*domItem, 0, error);
}
示例12: MaybeRemoveItemFromAnimValListAt
void
DOMSVGPathSegList::
MaybeRemoveItemFromAnimValListAt(PRUint32 aIndex,
PRUint32 aArgCountForItem)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
if (AttrIsAnimating()) {
// animVal not a clone of baseVal
return;
}
DOMSVGPathSegList *animVal =
GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
if (!animVal) {
// No animVal list wrapper
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
if (animVal->ItemAt(aIndex)) {
animVal->ItemAt(aIndex)->RemovingFromList();
}
animVal->mItems.RemoveElementAt(aIndex);
animVal->UpdateListIndicesFromIndex(aIndex, -(1 + aArgCountForItem));
}
示例13: notifier
void
DOMSVGPathSegList::Clear(ErrorResult& aError)
{
if (IsAnimValList()) {
aError.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
return;
}
if (LengthNoFlush() > 0) {
AutoChangePathSegListNotifier notifier(this);
// DOM list items that are to be removed must be removed before we change
// the internal list, otherwise they wouldn't be able to copy their
// internal counterparts' values!
InternalListWillChangeTo(SVGPathData()); // clears mItems
if (!AttrIsAnimating()) {
// The anim val list is in sync with the base val list
DOMSVGPathSegList *animList =
GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
if (animList) {
animList->InternalListWillChangeTo(SVGPathData()); // clears its mItems
}
}
InternalList().Clear();
}
}
示例14: MOZ_ASSERT
void
DOMSVGPointList::MaybeRemoveItemFromAnimValListAt(uint32_t aIndex)
{
MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
if (!AnimListMirrorsBaseList()) {
return;
}
// This needs to be a strong reference; otherwise, the RemovingFromList call
// below might drop the last reference to animVal before we're done with it.
RefPtr<DOMSVGPointList> animVal =
GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
MOZ_ASSERT(animVal, "AnimListMirrorsBaseList() promised a non-null animVal");
MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
if (animVal->mItems[aIndex]) {
animVal->mItems[aIndex]->RemovingFromList();
}
animVal->mItems.RemoveElementAt(aIndex);
UpdateListIndicesFromIndex(animVal->mItems, aIndex);
}
示例15: notifier
already_AddRefed<SVGTransform>
DOMSVGTransformList::RemoveItem(uint32_t index, ErrorResult& error)
{
if (IsAnimValList()) {
error.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
return nullptr;
}
if (index >= LengthNoFlush()) {
error.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
return nullptr;
}
AutoChangeTransformListNotifier notifier(this);
// Now that we know we're removing, keep animVal list in sync as necessary.
// Do this *before* touching InternalList() so the removed item can get its
// internal value.
MaybeRemoveItemFromAnimValListAt(index);
// We have to return the removed item, so get it, creating it if necessary:
nsRefPtr<SVGTransform> result = GetItemAt(index);
// Notify the DOM item of removal *before* modifying the lists so that the
// DOM item can copy its *old* value:
result->RemovingFromList();
InternalList().RemoveItem(index);
mItems.RemoveElementAt(index);
UpdateListIndicesFromIndex(mItems, index);
return result.forget();
}