/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const nsAttrValue* GetAttr(const nsAtom* aLocalName,
int32_t aNamespaceID) const; // As above but using a string attr name and always using // kNameSpaceID_None. This is always case-sensitive. const nsAttrValue* GetAttr(const nsAString& aName) const; // Get an nsAttrValue by qualified name. Can optionally do // ASCII-case-insensitive name matching. const nsAttrValue* GetAttr(const nsAString& aName,
nsCaseTreatment aCaseSensitive) const; const nsAttrValue* AttrAt(uint32_t aPos) const; // SetAndSwapAttr swaps the current attribute value with aValue. // If the attribute was unset, an empty value will be swapped into aValue // and aHadValue will be set to false. Otherwise, aHadValue will be set to // true.
nsresult SetAndSwapAttr(nsAtom* aLocalName, nsAttrValue& aValue, bool* aHadValue);
nsresult SetAndSwapAttr(mozilla::dom::NodeInfo* aName, nsAttrValue& aValue, bool* aHadValue);
// This stores the argument and clears the pending mapped attribute evaluation // bit, so after calling this IsPendingMappedAttributeEvaluation() is // guaranteed to return false. void SetMappedDeclarationBlock(
already_AddRefed<mozilla::StyleLockedDeclarationBlock>);
// Remove the attr at position aPos. The value of the attr is placed in // aValue; any value that was already in aValue is destroyed.
nsresult RemoveAttrAt(uint32_t aPos, nsAttrValue& aValue);
// Returns attribute name at given position, *not* out-of-bounds safe const nsAttrName* AttrNameAt(uint32_t aPos) const;
// Returns the attribute info at a given position, *not* out-of-bounds safe
BorrowedAttrInfo AttrInfoAt(uint32_t aPos) const;
// Returns attribute name at given position or null if aPos is out-of-bounds const nsAttrName* GetSafeAttrNameAt(uint32_t aPos) const;
// Mark the element as pending mapped attribute evaluation. This should be // called when a mapped attribute is changed (regardless of connectedness). bool MarkAsPendingPresAttributeEvaluation() { // It'd be great to be able to assert that mImpl is non-null or we're the // <body> or <svg> elements. if (MOZ_UNLIKELY(!mImpl) && !GrowBy(1)) { returnfalse;
}
InfallibleMarkAsPendingPresAttributeEvaluation(); returntrue;
}
// Clear the servo declaration block on the mapped attributes, if any // Will assert off main thread void ClearMappedServoStyle();
// Increases capacity (if necessary) to have enough space to accomodate the // unmapped attributes of |aOther|.
nsresult EnsureCapacityToClone(const AttrArray& aOther);
private: // Tries to create an attribute, growing the buffer if needed, with the given // name and value. // // The value is moved from the argument. // // `Name` can be anything you construct a `nsAttrName` with (either an atom or // a NodeInfo pointer). template <typename Name>
nsresult AddNewAttribute(Name*, nsAttrValue&);
uint32_t mAttrCount;
uint32_t mCapacity; // In number of InternalAttrs
// mMappedAttributeBits is a tagged pointer of a // StyleLockedDeclarationBlock, which holds the style information that our // attributes map to. // // If the lower bit is set, then our mapped attributes are dirty. This just // means that we might have mapped attributes (or used to and no longer // have), and are pending an update to recompute our declaration.
uintptr_t mMappedAttributeBits = 0;
// Allocated in the same buffer as `Impl`.
InternalAttr mBuffer[0];
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.