зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 5 changesets (bug 1292618) for !mImageTracked assertion failures
CLOSED TREE Backed out changeset 1d767147e160 (bug 1292618) Backed out changeset e6034e58efe4 (bug 1292618) Backed out changeset 928dd363efa0 (bug 1292618) Backed out changeset 8e274c66ae7f (bug 1292618) Backed out changeset 6c347701d343 (bug 1292618)
This commit is contained in:
Родитель
3fda0deee8
Коммит
b4f23026ee
|
@ -6,9 +6,6 @@
|
|||
|
||||
#include "mozilla/ServoRestyleManager.h"
|
||||
#include "mozilla/ServoStyleSet.h"
|
||||
#include "mozilla/dom/ChildIterator.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsStyleChangeList.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
|
@ -82,10 +79,10 @@ ServoRestyleManager::RecreateStyleContexts(nsIContent* aContent,
|
|||
Servo_GetComputedValues(aContent).Consume();
|
||||
MOZ_ASSERT(computedValues);
|
||||
|
||||
nsChangeHint changeHint = nsChangeHint(0);
|
||||
// NB: Change hint processing only applies to elements, at least until we
|
||||
// support display: contents.
|
||||
if (aContent->IsElement()) {
|
||||
nsChangeHint changeHint = nsChangeHint(0);
|
||||
Element* element = aContent->AsElement();
|
||||
|
||||
// Add an explicit change hint if appropriate.
|
||||
|
@ -143,36 +140,6 @@ ServoRestyleManager::RecreateStyleContexts(nsIContent* aContent,
|
|||
f->SetStyleContext(newContext);
|
||||
}
|
||||
|
||||
// Update pseudo-elements state if appropriate.
|
||||
if (aContent->IsElement()) {
|
||||
Element* aElement = aContent->AsElement();
|
||||
const static CSSPseudoElementType pseudosToRestyle[] = {
|
||||
CSSPseudoElementType::before, CSSPseudoElementType::after,
|
||||
};
|
||||
|
||||
for (CSSPseudoElementType pseudoType : pseudosToRestyle) {
|
||||
nsIAtom* pseudoTag =
|
||||
nsCSSPseudoElements::GetPseudoAtom(pseudoType);
|
||||
if (nsIFrame* pseudoFrame =
|
||||
FrameForPseudoElement(aElement, pseudoTag)) {
|
||||
// TODO: we could maybe make this more performant via calling into
|
||||
// Servo just once to know which pseudo-elements we've got to restyle?
|
||||
RefPtr<nsStyleContext> pseudoContext =
|
||||
aStyleSet->ProbePseudoElementStyle(aElement, pseudoType,
|
||||
newContext);
|
||||
|
||||
// If pseudoContext is null here, it means the frame is going away, so
|
||||
// our change hint computation should have already indicated we need
|
||||
// to reframe.
|
||||
MOZ_ASSERT_IF(!pseudoContext,
|
||||
changeHint & nsChangeHint_ReconstructFrame);
|
||||
if (pseudoContext) {
|
||||
pseudoFrame->SetStyleContext(pseudoContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: There are other continuations we still haven't restyled, mostly
|
||||
// pseudo-elements. We have to deal with those, and with anonymous boxes.
|
||||
aContent->UnsetFlags(NODE_IS_DIRTY_FOR_SERVO);
|
||||
|
@ -220,37 +187,7 @@ MarkChildrenAsDirtyForServo(nsIContent* aContent)
|
|||
}
|
||||
}
|
||||
|
||||
/* static */ nsIFrame*
|
||||
ServoRestyleManager::FrameForPseudoElement(nsIContent* aContent,
|
||||
nsIAtom* aPseudoTagOrNull)
|
||||
{
|
||||
MOZ_ASSERT_IF(aPseudoTagOrNull, aContent->IsElement());
|
||||
nsIFrame* primaryFrame = aContent->GetPrimaryFrame();
|
||||
|
||||
if (!aPseudoTagOrNull) {
|
||||
return primaryFrame;
|
||||
}
|
||||
|
||||
if (!primaryFrame) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// NOTE: we probably need to special-case display: contents here. Gecko's
|
||||
// RestyleManager passes the primary frame of the parent instead.
|
||||
if (aPseudoTagOrNull == nsCSSPseudoElements::before) {
|
||||
return nsLayoutUtils::GetBeforeFrameForContent(primaryFrame, aContent);
|
||||
}
|
||||
|
||||
if (aPseudoTagOrNull == nsCSSPseudoElements::after) {
|
||||
return nsLayoutUtils::GetAfterFrameForContent(primaryFrame, aContent);
|
||||
}
|
||||
|
||||
MOZ_CRASH("Unkown pseudo-element given to "
|
||||
"ServoRestyleManager::FrameForPseudoElement");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
void
|
||||
ServoRestyleManager::NoteRestyleHint(Element* aElement, nsRestyleHint aHint)
|
||||
{
|
||||
const nsRestyleHint HANDLED_RESTYLE_HINTS = eRestyle_Self |
|
||||
|
|
|
@ -77,15 +77,6 @@ public:
|
|||
|
||||
bool HasPendingRestyles() { return !mModifiedElements.IsEmpty(); }
|
||||
|
||||
/**
|
||||
* Gets the appropriate frame given a content and a pseudo-element tag.
|
||||
*
|
||||
* Right now only supports a null tag, before or after. If the pseudo-element
|
||||
* is not null, the content needs to be an element.
|
||||
*/
|
||||
static nsIFrame* FrameForPseudoElement(nsIContent* aContent,
|
||||
nsIAtom* aPseudoTagOrNull);
|
||||
|
||||
protected:
|
||||
~ServoRestyleManager() {}
|
||||
|
||||
|
|
|
@ -226,31 +226,32 @@ nsCounterManager::AddCounterResetsAndIncrements(nsIFrame *aFrame)
|
|||
int32_t i, i_end;
|
||||
bool dirty = false;
|
||||
for (i = 0, i_end = styleContent->CounterResetCount(); i != i_end; ++i)
|
||||
dirty |= AddResetOrIncrement(aFrame, i, styleContent->CounterResetAt(i),
|
||||
nsCounterChangeNode::RESET);
|
||||
dirty |= AddResetOrIncrement(aFrame, i,
|
||||
styleContent->GetCounterResetAt(i),
|
||||
nsCounterChangeNode::RESET);
|
||||
for (i = 0, i_end = styleContent->CounterIncrementCount(); i != i_end; ++i)
|
||||
dirty |=
|
||||
AddResetOrIncrement(aFrame, i, styleContent->CounterIncrementAt(i),
|
||||
nsCounterChangeNode::INCREMENT);
|
||||
dirty |= AddResetOrIncrement(aFrame, i,
|
||||
styleContent->GetCounterIncrementAt(i),
|
||||
nsCounterChangeNode::INCREMENT);
|
||||
return dirty;
|
||||
}
|
||||
|
||||
bool
|
||||
nsCounterManager::AddResetOrIncrement(nsIFrame* aFrame, int32_t aIndex,
|
||||
const nsStyleCounterData& aCounterData,
|
||||
nsCounterManager::AddResetOrIncrement(nsIFrame *aFrame, int32_t aIndex,
|
||||
const nsStyleCounterData *aCounterData,
|
||||
nsCounterNode::Type aType)
|
||||
{
|
||||
nsCounterChangeNode* node =
|
||||
new nsCounterChangeNode(aFrame, aType, aCounterData.mValue, aIndex);
|
||||
nsCounterChangeNode *node =
|
||||
new nsCounterChangeNode(aFrame, aType, aCounterData->mValue, aIndex);
|
||||
|
||||
nsCounterList* counterList = CounterListFor(aCounterData.mCounter);
|
||||
nsCounterList *counterList = CounterListFor(aCounterData->mCounter);
|
||||
|
||||
counterList->Insert(node);
|
||||
if (!counterList->IsLast(node)) {
|
||||
// Tell the caller it's responsible for recalculating the entire
|
||||
// list.
|
||||
counterList->SetDirty();
|
||||
return true;
|
||||
counterList->Insert(node);
|
||||
if (!counterList->IsLast(node)) {
|
||||
// Tell the caller it's responsible for recalculating the entire
|
||||
// list.
|
||||
counterList->SetDirty();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Don't call Calc() if the list is already dirty -- it'll be recalculated
|
||||
|
|
|
@ -271,11 +271,11 @@ public:
|
|||
|
||||
private:
|
||||
// for |AddCounterResetsAndIncrements| only
|
||||
bool AddResetOrIncrement(nsIFrame* aFrame, int32_t aIndex,
|
||||
const nsStyleCounterData& aCounterData,
|
||||
nsCounterNode::Type aType);
|
||||
bool AddResetOrIncrement(nsIFrame *aFrame, int32_t aIndex,
|
||||
const nsStyleCounterData *aCounterData,
|
||||
nsCounterNode::Type aType);
|
||||
|
||||
nsClassHashtable<nsStringHashKey, nsCounterList> mNames;
|
||||
nsClassHashtable<nsStringHashKey, nsCounterList> mNames;
|
||||
};
|
||||
|
||||
#endif /* nsCounterManager_h_ */
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "nsDOMTokenList.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
|
@ -25,11 +24,8 @@
|
|||
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/ServoElementSnapshot.h"
|
||||
#include "mozilla/ServoRestyleManager.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
#define IMPL_STRONG_REF_TYPE(name, T) \
|
||||
already_AddRefed<T> name::Consume() { \
|
||||
RefPtr<T> result = dont_AddRef(mPtr); \
|
||||
|
@ -200,17 +196,15 @@ Gecko_UnsetNodeFlags(RawGeckoNode* aNode, uint32_t aFlags)
|
|||
}
|
||||
|
||||
nsStyleContext*
|
||||
Gecko_GetStyleContext(RawGeckoNode* aNode, nsIAtom* aPseudoTagOrNull)
|
||||
Gecko_GetStyleContext(RawGeckoNode* aNode)
|
||||
{
|
||||
MOZ_ASSERT(aNode->IsContent());
|
||||
nsIFrame* relevantFrame =
|
||||
ServoRestyleManager::FrameForPseudoElement(aNode->AsContent(),
|
||||
aPseudoTagOrNull);
|
||||
if (!relevantFrame) {
|
||||
nsIFrame* primaryFrame = aNode->AsContent()->GetPrimaryFrame();
|
||||
if (!primaryFrame) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return relevantFrame->StyleContext();
|
||||
return primaryFrame->StyleContext();
|
||||
}
|
||||
|
||||
nsChangeHint
|
||||
|
@ -715,42 +709,10 @@ Gecko_CreateGradient(uint8_t aShape,
|
|||
void
|
||||
Gecko_EnsureTArrayCapacity(void* aArray, size_t aCapacity, size_t aElemSize)
|
||||
{
|
||||
auto base =
|
||||
reinterpret_cast<nsTArray_base<nsTArrayInfallibleAllocator,
|
||||
nsTArray_CopyWithMemutils> *>(aArray);
|
||||
|
||||
auto base = reinterpret_cast<nsTArray_base<nsTArrayInfallibleAllocator, nsTArray_CopyWithMemutils> *>(aArray);
|
||||
base->EnsureCapacity<nsTArrayInfallibleAllocator>(aCapacity, aElemSize);
|
||||
}
|
||||
|
||||
void
|
||||
Gecko_ClearPODTArray(void* aArray, size_t aElementSize, size_t aElementAlign)
|
||||
{
|
||||
auto base =
|
||||
reinterpret_cast<nsTArray_base<nsTArrayInfallibleAllocator,
|
||||
nsTArray_CopyWithMemutils> *>(aArray);
|
||||
|
||||
base->template ShiftData<nsTArrayInfallibleAllocator>(0, base->Length(), 0,
|
||||
aElementSize, aElementAlign);
|
||||
}
|
||||
|
||||
void
|
||||
Gecko_ClearStyleContents(nsStyleContent* aContent)
|
||||
{
|
||||
aContent->AllocateContents(0);
|
||||
}
|
||||
|
||||
void
|
||||
Gecko_CopyStyleContentsFrom(nsStyleContent* aContent, const nsStyleContent* aOther)
|
||||
{
|
||||
uint32_t count = aOther->ContentCount();
|
||||
|
||||
aContent->AllocateContents(count);
|
||||
|
||||
for (uint32_t i = 0; i < count; ++i) {
|
||||
aContent->ContentAt(i) = aOther->ContentAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Gecko_EnsureImageLayersLength(nsStyleImageLayers* aLayers, size_t aLen)
|
||||
{
|
||||
|
@ -821,7 +783,7 @@ Servo_DropNodeData(ServoNodeData* data)
|
|||
|
||||
RawServoStyleSheetStrong
|
||||
Servo_StylesheetFromUTF8Bytes(const uint8_t* bytes, uint32_t length,
|
||||
css::SheetParsingMode mode,
|
||||
mozilla::css::SheetParsingMode mode,
|
||||
const uint8_t* base_bytes, uint32_t base_length,
|
||||
ThreadSafeURIHolder* base,
|
||||
ThreadSafeURIHolder* referrer,
|
||||
|
|
|
@ -215,8 +215,7 @@ void Gecko_UnsetNodeFlags(RawGeckoNode* node, uint32_t flags);
|
|||
//
|
||||
// Also, we might want a ComputedValues to ComputedValues API for animations?
|
||||
// Not if we do them in Gecko...
|
||||
nsStyleContext* Gecko_GetStyleContext(RawGeckoNode* node,
|
||||
nsIAtom* aPseudoTagOrNull);
|
||||
nsStyleContext* Gecko_GetStyleContext(RawGeckoNode* node);
|
||||
nsChangeHint Gecko_CalcStyleDifference(nsStyleContext* oldstyle,
|
||||
ServoComputedValuesBorrowed newstyle);
|
||||
void Gecko_StoreStyleDifference(RawGeckoNode* node, nsChangeHint change);
|
||||
|
@ -226,17 +225,6 @@ void Gecko_StoreStyleDifference(RawGeckoNode* node, nsChangeHint change);
|
|||
// friend function declaration in nsTArray.h
|
||||
void Gecko_EnsureTArrayCapacity(void* array, size_t capacity, size_t elem_size);
|
||||
|
||||
// Same here, `array` must be an nsTArray<T>, for some T.
|
||||
//
|
||||
// Important note: Only valid for POD types, since destructors won't be run
|
||||
// otherwise. This is ensured with rust traits for the relevant structs.
|
||||
void Gecko_ClearPODTArray(void* array, size_t elem_size, size_t elem_align);
|
||||
|
||||
// Clear the mContents field in nsStyleContent. This is needed to run the
|
||||
// destructors, otherwise we'd leak the images (though we still don't support
|
||||
// those), strings, and whatnot.
|
||||
void Gecko_ClearStyleContents(nsStyleContent* content);
|
||||
void Gecko_CopyStyleContentsFrom(nsStyleContent* content, const nsStyleContent* other);
|
||||
|
||||
void Gecko_EnsureImageLayersLength(nsStyleImageLayers* layers, size_t len);
|
||||
|
||||
|
|
|
@ -96,8 +96,7 @@ ServoStyleSet::GetContext(nsIContent* aContent,
|
|||
nsIAtom* aPseudoTag,
|
||||
CSSPseudoElementType aPseudoType)
|
||||
{
|
||||
RefPtr<ServoComputedValues> computedValues =
|
||||
Servo_GetComputedValues(aContent).Consume();
|
||||
RefPtr<ServoComputedValues> computedValues = Servo_GetComputedValues(aContent).Consume();
|
||||
MOZ_ASSERT(computedValues);
|
||||
return GetContext(computedValues.forget(), aParentContext, aPseudoTag, aPseudoType);
|
||||
}
|
||||
|
@ -115,7 +114,8 @@ ServoStyleSet::GetContext(already_AddRefed<ServoComputedValues> aComputedValues,
|
|||
bool skipFixup = false;
|
||||
|
||||
return NS_NewStyleContext(aParentContext, mPresContext, aPseudoTag,
|
||||
aPseudoType, Move(aComputedValues), skipFixup);
|
||||
aPseudoType,
|
||||
Move(aComputedValues), skipFixup);
|
||||
}
|
||||
|
||||
already_AddRefed<nsStyleContext>
|
||||
|
@ -134,40 +134,8 @@ ServoStyleSet::ResolveStyleForText(nsIContent* aTextNode,
|
|||
nsStyleContext* aParentContext)
|
||||
{
|
||||
MOZ_ASSERT(aTextNode && aTextNode->IsNodeOfType(nsINode::eTEXT));
|
||||
MOZ_ASSERT(aTextNode->GetParent());
|
||||
|
||||
nsIContent* parent = aTextNode->GetParent();
|
||||
nsIAtom* parentName = parent->NodeInfo()->NameAtom();
|
||||
|
||||
// If this text node is a child of a generated content node, it'll never have
|
||||
// been traversed by Servo, and thus isn't styled.
|
||||
//
|
||||
// We inherit the style from the parent here, but also taking into account
|
||||
// that only the frame of the parent has the correct style, given we take it
|
||||
// from the map, and the content hasn't also being traversed from Servo.
|
||||
//
|
||||
// Otherwise, we rely on the fact that this text node should have been
|
||||
// traversed by servo to just grab the computed values as appropriate.
|
||||
//
|
||||
// TODO: We might want to just do this and skip styling nodes entirely from
|
||||
// Servo. This would accidentally fix the issue of having to stash
|
||||
// change-hints from children in the parent element just because of inherited
|
||||
// style struct changes.
|
||||
RefPtr<ServoComputedValues> computedValues;
|
||||
if (parent->IsRootOfAnonymousSubtree() &&
|
||||
(parentName == nsGkAtoms::mozgeneratedcontentbefore ||
|
||||
parentName == nsGkAtoms::mozgeneratedcontentafter)) {
|
||||
MOZ_ASSERT(aParentContext);
|
||||
ServoComputedValues* parentComputedValues =
|
||||
aParentContext->StyleSource().AsServoComputedValues();
|
||||
computedValues =
|
||||
Servo_InheritComputedValues(parentComputedValues).Consume();
|
||||
} else {
|
||||
computedValues = Servo_GetComputedValues(aTextNode).Consume();
|
||||
}
|
||||
|
||||
return GetContext(computedValues.forget(), aParentContext,
|
||||
nsCSSAnonBoxes::mozText, CSSPseudoElementType::AnonBox);
|
||||
return GetContext(aTextNode, aParentContext, nsCSSAnonBoxes::mozText,
|
||||
CSSPseudoElementType::AnonBox);
|
||||
}
|
||||
|
||||
already_AddRefed<nsStyleContext>
|
||||
|
@ -177,8 +145,7 @@ ServoStyleSet::ResolveStyleForOtherNonElement(nsStyleContext* aParentContext)
|
|||
// with the root of an anonymous subtree.
|
||||
ServoComputedValues* parent =
|
||||
aParentContext ? aParentContext->StyleSource().AsServoComputedValues() : nullptr;
|
||||
RefPtr<ServoComputedValues> computedValues =
|
||||
Servo_InheritComputedValues(parent).Consume();
|
||||
RefPtr<ServoComputedValues> computedValues = Servo_InheritComputedValues(parent).Consume();
|
||||
MOZ_ASSERT(computedValues);
|
||||
|
||||
return GetContext(computedValues.forget(), aParentContext,
|
||||
|
|
|
@ -1197,11 +1197,11 @@ nsComputedDOMStyle::DoGetCounterIncrement()
|
|||
RefPtr<nsROCSSPrimitiveValue> name = new nsROCSSPrimitiveValue;
|
||||
RefPtr<nsROCSSPrimitiveValue> value = new nsROCSSPrimitiveValue;
|
||||
|
||||
const nsStyleCounterData& data = content->CounterIncrementAt(i);
|
||||
const nsStyleCounterData *data = content->GetCounterIncrementAt(i);
|
||||
nsAutoString escaped;
|
||||
nsStyleUtil::AppendEscapedCSSIdent(data.mCounter, escaped);
|
||||
nsStyleUtil::AppendEscapedCSSIdent(data->mCounter, escaped);
|
||||
name->SetString(escaped);
|
||||
value->SetNumber(data.mValue); // XXX This should really be integer
|
||||
value->SetNumber(data->mValue); // XXX This should really be integer
|
||||
|
||||
valueList->AppendCSSValue(name.forget());
|
||||
valueList->AppendCSSValue(value.forget());
|
||||
|
@ -1441,11 +1441,11 @@ nsComputedDOMStyle::DoGetCounterReset()
|
|||
RefPtr<nsROCSSPrimitiveValue> name = new nsROCSSPrimitiveValue;
|
||||
RefPtr<nsROCSSPrimitiveValue> value = new nsROCSSPrimitiveValue;
|
||||
|
||||
const nsStyleCounterData& data = content->CounterResetAt(i);
|
||||
const nsStyleCounterData *data = content->GetCounterResetAt(i);
|
||||
nsAutoString escaped;
|
||||
nsStyleUtil::AppendEscapedCSSIdent(data.mCounter, escaped);
|
||||
nsStyleUtil::AppendEscapedCSSIdent(data->mCounter, escaped);
|
||||
name->SetString(escaped);
|
||||
value->SetNumber(data.mValue); // XXX This should really be integer
|
||||
value->SetNumber(data->mValue); // XXX This should really be integer
|
||||
|
||||
valueList->AppendCSSValue(name.forget());
|
||||
valueList->AppendCSSValue(value.forget());
|
||||
|
|
|
@ -8863,9 +8863,10 @@ nsRuleNode::ComputeContentData(void* aStartStruct,
|
|||
case eCSSUnit_Inherit:
|
||||
conditions.SetUncacheable();
|
||||
count = parentContent->ContentCount();
|
||||
content->AllocateContents(count);
|
||||
while (0 < count--) {
|
||||
content->ContentAt(count) = parentContent->ContentAt(count);
|
||||
if (NS_SUCCEEDED(content->AllocateContents(count))) {
|
||||
while (0 < count--) {
|
||||
content->ContentAt(count) = parentContent->ContentAt(count);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -8882,62 +8883,66 @@ nsRuleNode::ComputeContentData(void* aStartStruct,
|
|||
case eCSSUnit_List:
|
||||
case eCSSUnit_ListDep: {
|
||||
const nsCSSValueList* contentValueList = contentValue->GetListValue();
|
||||
count = 0;
|
||||
while (contentValueList) {
|
||||
count++;
|
||||
contentValueList = contentValueList->mNext;
|
||||
}
|
||||
content->AllocateContents(count);
|
||||
const nsAutoString nullStr;
|
||||
count = 0;
|
||||
contentValueList = contentValue->GetListValue();
|
||||
while (contentValueList) {
|
||||
const nsCSSValue& value = contentValueList->mValue;
|
||||
nsCSSUnit unit = value.GetUnit();
|
||||
nsStyleContentType type;
|
||||
nsStyleContentData &data = content->ContentAt(count++);
|
||||
switch (unit) {
|
||||
case eCSSUnit_String: type = eStyleContentType_String; break;
|
||||
case eCSSUnit_Image: type = eStyleContentType_Image; break;
|
||||
case eCSSUnit_Attr: type = eStyleContentType_Attr; break;
|
||||
case eCSSUnit_Counter: type = eStyleContentType_Counter; break;
|
||||
case eCSSUnit_Counters: type = eStyleContentType_Counters; break;
|
||||
case eCSSUnit_Enumerated:
|
||||
switch (value.GetIntValue()) {
|
||||
case NS_STYLE_CONTENT_OPEN_QUOTE:
|
||||
type = eStyleContentType_OpenQuote; break;
|
||||
case NS_STYLE_CONTENT_CLOSE_QUOTE:
|
||||
type = eStyleContentType_CloseQuote; break;
|
||||
case NS_STYLE_CONTENT_NO_OPEN_QUOTE:
|
||||
type = eStyleContentType_NoOpenQuote; break;
|
||||
case NS_STYLE_CONTENT_NO_CLOSE_QUOTE:
|
||||
type = eStyleContentType_NoCloseQuote; break;
|
||||
default:
|
||||
NS_ERROR("bad content value");
|
||||
type = eStyleContentType_Uninitialized;
|
||||
count = 0;
|
||||
while (contentValueList) {
|
||||
count++;
|
||||
contentValueList = contentValueList->mNext;
|
||||
}
|
||||
if (NS_SUCCEEDED(content->AllocateContents(count))) {
|
||||
const nsAutoString nullStr;
|
||||
count = 0;
|
||||
contentValueList = contentValue->GetListValue();
|
||||
while (contentValueList) {
|
||||
const nsCSSValue& value = contentValueList->mValue;
|
||||
nsCSSUnit unit = value.GetUnit();
|
||||
nsStyleContentType type;
|
||||
nsStyleContentData &data = content->ContentAt(count++);
|
||||
switch (unit) {
|
||||
case eCSSUnit_String: type = eStyleContentType_String; break;
|
||||
case eCSSUnit_Image: type = eStyleContentType_Image; break;
|
||||
case eCSSUnit_Attr: type = eStyleContentType_Attr; break;
|
||||
case eCSSUnit_Counter: type = eStyleContentType_Counter; break;
|
||||
case eCSSUnit_Counters: type = eStyleContentType_Counters; break;
|
||||
case eCSSUnit_Enumerated:
|
||||
switch (value.GetIntValue()) {
|
||||
case NS_STYLE_CONTENT_OPEN_QUOTE:
|
||||
type = eStyleContentType_OpenQuote; break;
|
||||
case NS_STYLE_CONTENT_CLOSE_QUOTE:
|
||||
type = eStyleContentType_CloseQuote; break;
|
||||
case NS_STYLE_CONTENT_NO_OPEN_QUOTE:
|
||||
type = eStyleContentType_NoOpenQuote; break;
|
||||
case NS_STYLE_CONTENT_NO_CLOSE_QUOTE:
|
||||
type = eStyleContentType_NoCloseQuote; break;
|
||||
default:
|
||||
NS_ERROR("bad content value");
|
||||
type = eStyleContentType_Uninitialized;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
NS_ERROR("bad content type");
|
||||
type = eStyleContentType_Uninitialized;
|
||||
}
|
||||
data.mType = type;
|
||||
if (type == eStyleContentType_Image) {
|
||||
SetImageRequest([&](imgRequestProxy* req) {
|
||||
data.SetImage(req);
|
||||
}, mPresContext, value);
|
||||
}
|
||||
else if (type <= eStyleContentType_Attr) {
|
||||
value.GetStringValue(buffer);
|
||||
data.mContent.mString = NS_strdup(buffer.get());
|
||||
}
|
||||
else if (type <= eStyleContentType_Counters) {
|
||||
data.mContent.mCounters = value.GetArrayValue();
|
||||
data.mContent.mCounters->AddRef();
|
||||
}
|
||||
else {
|
||||
data.mContent.mString = nullptr;
|
||||
}
|
||||
contentValueList = contentValueList->mNext;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
NS_ERROR("bad content type");
|
||||
type = eStyleContentType_Uninitialized;
|
||||
}
|
||||
data.mType = type;
|
||||
if (type == eStyleContentType_Image) {
|
||||
SetImageRequest([&](imgRequestProxy* req) {
|
||||
data.SetImage(req);
|
||||
}, mPresContext, value);
|
||||
} else if (type <= eStyleContentType_Attr) {
|
||||
value.GetStringValue(buffer);
|
||||
data.mContent.mString = NS_strdup(buffer.get());
|
||||
} else if (type <= eStyleContentType_Counters) {
|
||||
data.mContent.mCounters = value.GetArrayValue();
|
||||
data.mContent.mCounters->AddRef();
|
||||
} else {
|
||||
data.mContent.mString = nullptr;
|
||||
}
|
||||
contentValueList = contentValueList->mNext;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
|
@ -8960,10 +8965,12 @@ nsRuleNode::ComputeContentData(void* aStartStruct,
|
|||
case eCSSUnit_Inherit:
|
||||
conditions.SetUncacheable();
|
||||
count = parentContent->CounterIncrementCount();
|
||||
content->AllocateCounterIncrements(count);
|
||||
while (count--) {
|
||||
const nsStyleCounterData& data = parentContent->CounterIncrementAt(count);
|
||||
content->SetCounterIncrementAt(count, data.mCounter, data.mValue);
|
||||
if (NS_SUCCEEDED(content->AllocateCounterIncrements(count))) {
|
||||
while (0 < count--) {
|
||||
const nsStyleCounterData *data =
|
||||
parentContent->GetCounterIncrementAt(count);
|
||||
content->SetCounterIncrementAt(count, data->mCounter, data->mValue);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -8974,7 +8981,9 @@ nsRuleNode::ComputeContentData(void* aStartStruct,
|
|||
MOZ_ASSERT(ourIncrement->mXValue.GetUnit() == eCSSUnit_Ident,
|
||||
"unexpected value unit");
|
||||
count = ListLength(ourIncrement);
|
||||
content->AllocateCounterIncrements(count);
|
||||
if (NS_FAILED(content->AllocateCounterIncrements(count))) {
|
||||
break;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
for (const nsCSSValuePairList* p = ourIncrement; p; p = p->mNext, count++) {
|
||||
|
@ -9009,10 +9018,12 @@ nsRuleNode::ComputeContentData(void* aStartStruct,
|
|||
case eCSSUnit_Inherit:
|
||||
conditions.SetUncacheable();
|
||||
count = parentContent->CounterResetCount();
|
||||
content->AllocateCounterResets(count);
|
||||
while (0 < count--) {
|
||||
const nsStyleCounterData& data = parentContent->CounterResetAt(count);
|
||||
content->SetCounterResetAt(count, data.mCounter, data.mValue);
|
||||
if (NS_SUCCEEDED(content->AllocateCounterResets(count))) {
|
||||
while (0 < count--) {
|
||||
const nsStyleCounterData *data =
|
||||
parentContent->GetCounterResetAt(count);
|
||||
content->SetCounterResetAt(count, data->mCounter, data->mValue);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -9023,7 +9034,10 @@ nsRuleNode::ComputeContentData(void* aStartStruct,
|
|||
MOZ_ASSERT(ourReset->mXValue.GetUnit() == eCSSUnit_Ident,
|
||||
"unexpected value unit");
|
||||
count = ListLength(ourReset);
|
||||
content->AllocateCounterResets(count);
|
||||
if (NS_FAILED(content->AllocateCounterResets(count))) {
|
||||
break;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
for (const nsCSSValuePairList* p = ourReset; p; p = p->mNext, count++) {
|
||||
int32_t reset;
|
||||
|
|
|
@ -3389,7 +3389,6 @@ nsStyleVisibility::CalcDifference(const nsStyleVisibility& aNewData) const
|
|||
|
||||
nsStyleContentData::~nsStyleContentData()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsStyleContentData);
|
||||
MOZ_ASSERT(!mImageTracked,
|
||||
"nsStyleContentData being destroyed while still tracking image!");
|
||||
if (mType == eStyleContentType_Image) {
|
||||
|
@ -3402,8 +3401,15 @@ nsStyleContentData::~nsStyleContentData()
|
|||
}
|
||||
}
|
||||
|
||||
nsStyleContentData::nsStyleContentData(const nsStyleContentData& aOther)
|
||||
nsStyleContentData&
|
||||
nsStyleContentData::operator=(const nsStyleContentData& aOther)
|
||||
{
|
||||
if (this == &aOther) {
|
||||
return *this;
|
||||
}
|
||||
this->~nsStyleContentData();
|
||||
new (this) nsStyleContentData();
|
||||
|
||||
mType = aOther.mType;
|
||||
if (mType == eStyleContentType_Image) {
|
||||
mContent.mImage = aOther.mContent.mImage;
|
||||
|
@ -3417,17 +3423,6 @@ nsStyleContentData::nsStyleContentData(const nsStyleContentData& aOther)
|
|||
} else {
|
||||
mContent.mString = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
nsStyleContentData&
|
||||
nsStyleContentData::operator=(const nsStyleContentData& aOther)
|
||||
{
|
||||
if (this == &aOther) {
|
||||
return *this;
|
||||
}
|
||||
this->~nsStyleContentData();
|
||||
new (this) nsStyleContentData(aOther);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -3508,6 +3503,12 @@ nsStyleContentData::UntrackImage(nsPresContext* aContext)
|
|||
|
||||
nsStyleContent::nsStyleContent(StyleStructContext aContext)
|
||||
: mMarkerOffset(eStyleUnit_Auto)
|
||||
, mContents(nullptr)
|
||||
, mIncrements(nullptr)
|
||||
, mResets(nullptr)
|
||||
, mContentCount(0)
|
||||
, mIncrementCount(0)
|
||||
, mResetCount(0)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsStyleContent);
|
||||
}
|
||||
|
@ -3515,29 +3516,61 @@ nsStyleContent::nsStyleContent(StyleStructContext aContext)
|
|||
nsStyleContent::~nsStyleContent()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsStyleContent);
|
||||
DELETE_ARRAY_IF(mContents);
|
||||
DELETE_ARRAY_IF(mIncrements);
|
||||
DELETE_ARRAY_IF(mResets);
|
||||
}
|
||||
|
||||
void
|
||||
nsStyleContent::Destroy(nsPresContext* aContext)
|
||||
{
|
||||
// Unregister any images we might have with the document.
|
||||
for (auto& content : mContents) {
|
||||
if (content.mType == eStyleContentType_Image && content.mContent.mImage) {
|
||||
content.UntrackImage(aContext);
|
||||
for (uint32_t i = 0; i < mContentCount; ++i) {
|
||||
if ((mContents[i].mType == eStyleContentType_Image) &&
|
||||
mContents[i].mContent.mImage) {
|
||||
mContents[i].UntrackImage(aContext);
|
||||
}
|
||||
}
|
||||
|
||||
this->~nsStyleContent();
|
||||
aContext->PresShell()->FreeByObjectID(eArenaObjectID_nsStyleContent, this);
|
||||
aContext->PresShell()->
|
||||
FreeByObjectID(eArenaObjectID_nsStyleContent, this);
|
||||
}
|
||||
|
||||
nsStyleContent::nsStyleContent(const nsStyleContent& aSource)
|
||||
: mMarkerOffset(aSource.mMarkerOffset)
|
||||
, mContents(aSource.mContents)
|
||||
, mIncrements(aSource.mIncrements)
|
||||
, mResets(aSource.mResets)
|
||||
, mContents(nullptr)
|
||||
, mIncrements(nullptr)
|
||||
, mResets(nullptr)
|
||||
, mContentCount(0)
|
||||
, mIncrementCount(0)
|
||||
, mResetCount(0)
|
||||
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsStyleContent);
|
||||
|
||||
uint32_t index;
|
||||
if (NS_SUCCEEDED(AllocateContents(aSource.ContentCount()))) {
|
||||
for (index = 0; index < mContentCount; index++) {
|
||||
ContentAt(index) = aSource.ContentAt(index);
|
||||
}
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(AllocateCounterIncrements(aSource.CounterIncrementCount()))) {
|
||||
for (index = 0; index < mIncrementCount; index++) {
|
||||
const nsStyleCounterData *data = aSource.GetCounterIncrementAt(index);
|
||||
mIncrements[index].mCounter = data->mCounter;
|
||||
mIncrements[index].mValue = data->mValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(AllocateCounterResets(aSource.CounterResetCount()))) {
|
||||
for (index = 0; index < mResetCount; index++) {
|
||||
const nsStyleCounterData *data = aSource.GetCounterResetAt(index);
|
||||
mResets[index].mCounter = data->mCounter;
|
||||
mResets[index].mValue = data->mValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nsChangeHint
|
||||
|
@ -3555,22 +3588,62 @@ nsStyleContent::CalcDifference(const nsStyleContent& aNewData) const
|
|||
// 'content' property, then we will need to revisit the optimization
|
||||
// in ReResolveStyleContext.
|
||||
|
||||
// Unfortunately we need to reframe even if the content lengths are the same;
|
||||
// a simple reflow will not pick up different text or different image URLs,
|
||||
// since we set all that up in the CSSFrameConstructor
|
||||
if (mContents != aNewData.mContents ||
|
||||
mIncrements != aNewData.mIncrements ||
|
||||
mResets != aNewData.mResets) {
|
||||
if (mContentCount != aNewData.mContentCount ||
|
||||
mIncrementCount != aNewData.mIncrementCount ||
|
||||
mResetCount != aNewData.mResetCount) {
|
||||
return nsChangeHint_ReconstructFrame;
|
||||
}
|
||||
|
||||
uint32_t ix = mContentCount;
|
||||
while (0 < ix--) {
|
||||
if (mContents[ix] != aNewData.mContents[ix]) {
|
||||
// Unfortunately we need to reframe here; a simple reflow
|
||||
// will not pick up different text or different image URLs,
|
||||
// since we set all that up in the CSSFrameConstructor
|
||||
return nsChangeHint_ReconstructFrame;
|
||||
}
|
||||
}
|
||||
ix = mIncrementCount;
|
||||
while (0 < ix--) {
|
||||
if ((mIncrements[ix].mValue != aNewData.mIncrements[ix].mValue) ||
|
||||
(mIncrements[ix].mCounter != aNewData.mIncrements[ix].mCounter)) {
|
||||
return nsChangeHint_ReconstructFrame;
|
||||
}
|
||||
}
|
||||
ix = mResetCount;
|
||||
while (0 < ix--) {
|
||||
if ((mResets[ix].mValue != aNewData.mResets[ix].mValue) ||
|
||||
(mResets[ix].mCounter != aNewData.mResets[ix].mCounter)) {
|
||||
return nsChangeHint_ReconstructFrame;
|
||||
}
|
||||
}
|
||||
if (mMarkerOffset != aNewData.mMarkerOffset) {
|
||||
return NS_STYLE_HINT_REFLOW;
|
||||
}
|
||||
|
||||
return nsChangeHint(0);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsStyleContent::AllocateContents(uint32_t aCount)
|
||||
{
|
||||
// We need to run the destructors of the elements of mContents, so we
|
||||
// delete and reallocate even if aCount == mContentCount. (If
|
||||
// nsStyleContentData had its members private and managed their
|
||||
// ownership on setting, we wouldn't need this, but that seems
|
||||
// unnecessary at this point.)
|
||||
DELETE_ARRAY_IF(mContents);
|
||||
if (aCount) {
|
||||
mContents = new nsStyleContentData[aCount];
|
||||
if (! mContents) {
|
||||
mContentCount = 0;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
mContentCount = aCount;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// --------------------
|
||||
// nsStyleTextReset
|
||||
//
|
||||
|
|
|
@ -3161,11 +3161,7 @@ struct nsStyleContentData
|
|||
#ifdef DEBUG
|
||||
, mImageTracked(false)
|
||||
#endif
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsStyleContentData);
|
||||
mContent.mString = nullptr;
|
||||
}
|
||||
nsStyleContentData(const nsStyleContentData&);
|
||||
{ mContent.mString = nullptr; }
|
||||
|
||||
~nsStyleContentData();
|
||||
nsStyleContentData& operator=(const nsStyleContentData& aOther);
|
||||
|
@ -3185,22 +3181,19 @@ struct nsStyleContentData
|
|||
MOZ_ASSERT(mType == eStyleContentType_Image, "Wrong type!");
|
||||
NS_IF_ADDREF(mContent.mImage = aRequest);
|
||||
}
|
||||
private:
|
||||
nsStyleContentData(const nsStyleContentData&); // not to be implemented
|
||||
};
|
||||
|
||||
struct nsStyleCounterData
|
||||
{
|
||||
nsString mCounter;
|
||||
int32_t mValue;
|
||||
|
||||
bool operator==(const nsStyleCounterData& aOther) const {
|
||||
return mValue == aOther.mValue && mCounter == aOther.mCounter;
|
||||
}
|
||||
|
||||
bool operator!=(const nsStyleCounterData& aOther) const {
|
||||
return !(*this == aOther);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#define DELETE_ARRAY_IF(array) if (array) { delete[] array; array = nullptr; }
|
||||
|
||||
struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleContent
|
||||
{
|
||||
explicit nsStyleContent(StyleStructContext aContext);
|
||||
|
@ -3227,60 +3220,90 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleContent
|
|||
nsChangeHint_ClearAncestorIntrinsics;
|
||||
}
|
||||
|
||||
uint32_t ContentCount() const { return mContents.Length(); } // [reset]
|
||||
uint32_t ContentCount() const { return mContentCount; } // [reset]
|
||||
|
||||
const nsStyleContentData& ContentAt(uint32_t aIndex) const {
|
||||
NS_ASSERTION(aIndex < mContentCount, "out of range");
|
||||
return mContents[aIndex];
|
||||
}
|
||||
|
||||
nsStyleContentData& ContentAt(uint32_t aIndex) { return mContents[aIndex]; }
|
||||
|
||||
void AllocateContents(uint32_t aCount) {
|
||||
// We need to run the destructors of the elements of mContents, so we
|
||||
// delete and reallocate even if aCount == mContentCount. (If
|
||||
// nsStyleContentData had its members private and managed their
|
||||
// ownership on setting, we wouldn't need this, but that seems
|
||||
// unnecessary at this point.)
|
||||
mContents.Clear();
|
||||
mContents.SetLength(aCount);
|
||||
nsStyleContentData& ContentAt(uint32_t aIndex) {
|
||||
NS_ASSERTION(aIndex < mContentCount, "out of range");
|
||||
return mContents[aIndex];
|
||||
}
|
||||
|
||||
uint32_t CounterIncrementCount() const { return mIncrements.Length(); } // [reset]
|
||||
const nsStyleCounterData& CounterIncrementAt(uint32_t aIndex) const {
|
||||
return mIncrements[aIndex];
|
||||
nsresult AllocateContents(uint32_t aCount);
|
||||
|
||||
uint32_t CounterIncrementCount() const { return mIncrementCount; } // [reset]
|
||||
const nsStyleCounterData* GetCounterIncrementAt(uint32_t aIndex) const {
|
||||
NS_ASSERTION(aIndex < mIncrementCount, "out of range");
|
||||
return &mIncrements[aIndex];
|
||||
}
|
||||
|
||||
void AllocateCounterIncrements(uint32_t aCount) {
|
||||
mIncrements.Clear();
|
||||
mIncrements.SetLength(aCount);
|
||||
nsresult AllocateCounterIncrements(uint32_t aCount) {
|
||||
if (aCount != mIncrementCount) {
|
||||
DELETE_ARRAY_IF(mIncrements);
|
||||
if (aCount) {
|
||||
mIncrements = new nsStyleCounterData[aCount];
|
||||
if (! mIncrements) {
|
||||
mIncrementCount = 0;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
mIncrementCount = aCount;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void SetCounterIncrementAt(uint32_t aIndex, const nsString& aCounter, int32_t aIncrement) {
|
||||
mIncrements[aIndex].mCounter = aCounter;
|
||||
mIncrements[aIndex].mValue = aIncrement;
|
||||
nsresult SetCounterIncrementAt(uint32_t aIndex, const nsString& aCounter, int32_t aIncrement) {
|
||||
if (aIndex < mIncrementCount) {
|
||||
mIncrements[aIndex].mCounter = aCounter;
|
||||
mIncrements[aIndex].mValue = aIncrement;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
uint32_t CounterResetCount() const { return mResets.Length(); } // [reset]
|
||||
const nsStyleCounterData& CounterResetAt(uint32_t aIndex) const {
|
||||
return mResets[aIndex];
|
||||
uint32_t CounterResetCount() const { return mResetCount; } // [reset]
|
||||
const nsStyleCounterData* GetCounterResetAt(uint32_t aIndex) const {
|
||||
NS_ASSERTION(aIndex < mResetCount, "out of range");
|
||||
return &mResets[aIndex];
|
||||
}
|
||||
|
||||
void AllocateCounterResets(uint32_t aCount) {
|
||||
mResets.Clear();
|
||||
mResets.SetLength(aCount);
|
||||
nsresult AllocateCounterResets(uint32_t aCount) {
|
||||
if (aCount != mResetCount) {
|
||||
DELETE_ARRAY_IF(mResets);
|
||||
if (aCount) {
|
||||
mResets = new nsStyleCounterData[aCount];
|
||||
if (! mResets) {
|
||||
mResetCount = 0;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
mResetCount = aCount;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void SetCounterResetAt(uint32_t aIndex, const nsString& aCounter, int32_t aValue) {
|
||||
mResets[aIndex].mCounter = aCounter;
|
||||
mResets[aIndex].mValue = aValue;
|
||||
nsresult SetCounterResetAt(uint32_t aIndex, const nsString& aCounter, int32_t aValue) {
|
||||
if (aIndex < mResetCount) {
|
||||
mResets[aIndex].mCounter = aCounter;
|
||||
mResets[aIndex].mValue = aValue;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
nsStyleCoord mMarkerOffset; // [reset] coord, auto
|
||||
|
||||
protected:
|
||||
nsTArray<nsStyleContentData> mContents;
|
||||
nsTArray<nsStyleCounterData> mIncrements;
|
||||
nsTArray<nsStyleCounterData> mResets;
|
||||
nsStyleContentData* mContents;
|
||||
nsStyleCounterData* mIncrements;
|
||||
nsStyleCounterData* mResets;
|
||||
|
||||
uint32_t mContentCount;
|
||||
uint32_t mIncrementCount;
|
||||
uint32_t mResetCount;
|
||||
};
|
||||
|
||||
struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset
|
||||
|
|
|
@ -328,13 +328,7 @@ struct nsTArray_SafeElementAtHelper<mozilla::OwningNonNull<E>, Derived>
|
|||
}
|
||||
};
|
||||
|
||||
// Servo bindings.
|
||||
extern "C" void Gecko_EnsureTArrayCapacity(void* aArray,
|
||||
size_t aCapacity,
|
||||
size_t aElementSize);
|
||||
extern "C" void Gecko_ClearPODTArray(void* aArray,
|
||||
size_t aElementSize,
|
||||
size_t aElementAlign);
|
||||
extern "C" void Gecko_EnsureTArrayCapacity(void* aArray, size_t aCapacity, size_t aElemSize);
|
||||
|
||||
MOZ_NORETURN MOZ_COLD void
|
||||
InvalidArrayIndex_CRASH(size_t aIndex, size_t aLength);
|
||||
|
@ -352,10 +346,7 @@ class nsTArray_base
|
|||
// the same free().
|
||||
template<class Allocator, class Copier>
|
||||
friend class nsTArray_base;
|
||||
friend void Gecko_EnsureTArrayCapacity(void* aArray, size_t aCapacity,
|
||||
size_t aElemSize);
|
||||
friend void Gecko_ClearPODTArray(void* aTArray, size_t aElementSize,
|
||||
size_t aElementAlign);
|
||||
friend void Gecko_EnsureTArrayCapacity(void* aArray, size_t aCapacity, size_t aElemSize);
|
||||
|
||||
protected:
|
||||
typedef nsTArrayHeader Header;
|
||||
|
|
Загрузка…
Ссылка в новой задаче