Bug 1593119 - clang-format the files affected by the MOZ_XBL unifdef r=bzbarsky

Differential Revision: https://phabricator.services.mozilla.com/D52057

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Grinstead 2019-11-07 00:35:25 +00:00
Родитель f19f38776b
Коммит 8e592888cb
25 изменённых файлов: 23 добавлений и 80 удалений

Просмотреть файл

@ -96,7 +96,6 @@ struct MOZ_STACK_CLASS BindContext final {
MOZ_ASSERT(mInComposedDoc, "Binding NAC in a disconnected subtree?");
}
bool CollectingDisplayedNodeDataDuringLoad() const {
return mCollectingDisplayedNodeDataDuringLoad;
}

Просмотреть файл

@ -512,7 +512,6 @@ void CharacterData::UnbindFromTree(bool aNullParent) {
HandleShadowDOMRelatedRemovalSteps(aNullParent);
if (aNullParent) {
if (IsRootOfNativeAnonymousSubtree()) {
MutationObservers::NotifyNativeAnonymousChildListChange(this, true);
@ -534,7 +533,6 @@ void CharacterData::UnbindFromTree(bool aNullParent) {
SetSubtreeRootPointer(aNullParent ? this : mParent->SubtreeRoot());
}
nsExtendedContentSlots* slots = GetExistingExtendedContentSlots();
if (slots) {
slots->mBindingParent = nullptr;

Просмотреть файл

@ -169,7 +169,6 @@ class CharacterData : public nsIContent {
void DumpContent(FILE* out, int32_t aIndent, bool aDumpAll) const override {}
#endif
bool IsNodeOfType(uint32_t aFlags) const override { return false; }
bool IsLink(nsIURI** aURI) const final {

Просмотреть файл

@ -107,7 +107,6 @@ void FlattenedChildIterator::Init(bool aIgnoreXBL) {
return;
}
}
}
bool FlattenedChildIterator::ComputeWhetherXBLIsInvolved() const {

Просмотреть файл

@ -1945,7 +1945,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(Document)
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
}
tmp->mExternalResourceMap.Traverse(&cb);
// Traverse all Document pointer members.
@ -6894,7 +6893,6 @@ bool Document::RemoveObserver(nsIDocumentObserver* aObserver) {
return mObservers.Contains(aObserver);
}
void Document::BeginUpdate() {
// If the document is going away, then it's probably okay to do things to it
// in the wrong DocGroup. We're unlikely to run JS or do anything else
@ -6907,7 +6905,6 @@ void Document::BeginUpdate() {
mDocGroup->ValidateAccess();
}
++mUpdateNestLevel;
nsContentUtils::AddScriptBlocker();
NS_DOCUMENT_NOTIFY_OBSERVERS(BeginUpdate, (this));
@ -6923,7 +6920,6 @@ void Document::EndUpdate() {
--mUpdateNestLevel;
MaybeInitializeFinalizeFrameLoaders();
if (mXULBroadcastManager) {
mXULBroadcastManager->MaybeBroadcast();
@ -7814,7 +7810,6 @@ Element* Document::GetBindingParent(nsINode& aNode) {
return bindingParent ? bindingParent->AsElement() : nullptr;
}
Element* Document::GetAnonymousElementByAttribute(
nsIContent* aElement, nsAtom* aAttrName,
const nsAString& aAttrValue) const {
@ -7827,9 +7822,7 @@ Element* Document::GetAnonymousElementByAttribute(Element& aElement,
return nullptr;
}
nsINodeList* Document::GetAnonymousNodes(Element& aElement) {
return nullptr;
}
nsINodeList* Document::GetAnonymousNodes(Element& aElement) { return nullptr; }
already_AddRefed<nsRange> Document::CreateRange(ErrorResult& rv) {
RefPtr<nsRange> range = new nsRange(this);
@ -9186,7 +9179,6 @@ nsINode* Document::AdoptNode(nsINode& aAdoptedNode, ErrorResult& rv) {
parent->RemoveChildNode(adoptedNode->AsContent(), true);
} else {
MOZ_ASSERT(!adoptedNode->IsInUncomposedDoc());
}
break;
@ -14073,7 +14065,6 @@ void Document::AddSizeOfNodeTree(nsINode& aNode, nsWindowSizes& aWindowSizes) {
if (ShadowRoot* shadow = element->GetShadowRoot()) {
AddSizeOfNodeTree(*shadow, aWindowSizes);
}
}
}

Просмотреть файл

@ -1810,7 +1810,6 @@ class Document : public nsINode,
void DoUnblockOnload();
void RetrieveRelevantHeaders(nsIChannel* aChannel);
void TryChannelCharset(nsIChannel* aChannel, int32_t& aCharsetSource,
@ -2388,7 +2387,6 @@ class Document : public nsINode,
DoUpdateSVGUseElementShadowTrees();
}
/**
* Only to be used inside Gecko, you can't really do anything with the
* pointer outside Gecko anyway.

Просмотреть файл

@ -371,7 +371,6 @@ void Element::SetTabIndex(int32_t aTabIndex, mozilla::ErrorResult& aError) {
SetAttr(nsGkAtoms::tabindex, value, aError);
}
void Element::SetShadowRoot(ShadowRoot* aShadowRoot) {
nsExtendedDOMSlots* slots = ExtendedDOMSlots();
slots->mShadowRoot = aShadowRoot;
@ -1013,8 +1012,7 @@ already_AddRefed<ShadowRoot> Element::AttachShadow(const ShadowRootInit& aInit,
* 3. If context object is a shadow host, then throw
* an "InvalidStateError" DOMException.
*/
if (GetShadowRoot()
) {
if (GetShadowRoot()) {
aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
@ -1541,7 +1539,6 @@ nsresult Element::BindToTree(BindContext& aContext, nsINode& aParent) {
UpdateEditableState(false);
// Call BindToTree on shadow root children.
nsresult rv;
if (ShadowRoot* shadowRoot = GetShadowRoot()) {
@ -1622,7 +1619,6 @@ nsresult Element::BindToTree(BindContext& aContext, nsINode& aParent) {
return NS_OK;
}
bool WillDetachFromShadowOnUnbind(const Element& aElement, bool aNullParent) {
// If our parent still is in a shadow tree by now, and we're not removing
// ourselves from it, then we're still going to be in a shadow tree after
@ -1770,7 +1766,6 @@ void Element::UnbindFromTree(bool aNullParent) {
}
if (document) {
// Disconnected must be enqueued whenever a connected custom element becomes
// disconnected.
CustomElementData* data = GetCustomElementData();
@ -2299,7 +2294,6 @@ nsresult Element::SetAttrAndNotify(
oldValue = aOldValue;
}
if (HasElementCreatedFromPrototypeAndHasUnmodifiedL10n() &&
aNamespaceID == kNameSpaceID_None &&
(aName == nsGkAtoms::datal10nid || aName == nsGkAtoms::datal10nargs)) {
@ -2609,7 +2603,6 @@ nsresult Element::UnsetAttr(int32_t aNameSpaceID, nsAtom* aName, bool aNotify) {
PostIdMaybeChange(aNameSpaceID, aName, nullptr);
CustomElementDefinition* definition = GetCustomElementDefinition();
// Only custom element which is in `custom` state could get the
// CustomElementDefinition.
@ -2729,7 +2722,6 @@ void Element::List(FILE* out, int32_t aIndent, const nsCString& aPrefix) const {
}
fputs(">\n", out);
}
void Element::DumpContent(FILE* out, int32_t aIndent, bool aDumpAll) const {
@ -3749,7 +3741,6 @@ void Element::GetCustomInterface(nsGetterAddRefs<T> aResult) {
return;
}
}
}
void Element::ClearServoData(Document* aDoc) {

Просмотреть файл

@ -224,7 +224,6 @@ class Element : public FragmentOrElement {
*/
void SetTabIndex(int32_t aTabIndex, mozilla::ErrorResult& aError);
/**
* Sets the ShadowRoot binding for this element. The contents of the
* binding is rendered in place of this node's children.
@ -1958,7 +1957,6 @@ class Element : public FragmentOrElement {
AttrArray mAttrs;
};
NS_DEFINE_STATIC_IID_ACCESSOR(Element, NS_ELEMENT_IID)
inline bool Element::HasAttr(int32_t aNameSpaceID, const nsAtom* aName) const {

Просмотреть файл

@ -679,7 +679,6 @@ void FragmentOrElement::nsExtendedDOMSlots::TraverseExtendedSlots(
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(aCb, "mExtendedSlots->mShadowRoot");
aCb.NoteXPCOMChild(NS_ISUPPORTS_CAST(nsIContent*, mShadowRoot));
if (mCustomElementData) {
mCustomElementData->Traverse(aCb);
}
@ -713,7 +712,6 @@ size_t FragmentOrElement::nsExtendedDOMSlots::SizeOfExcludingThis(
// mShadowRoot should be handled during normal DOM tree memory reporting, just
// like kids, siblings, etc.
if (mCustomElementData) {
n += mCustomElementData->SizeOfIncludingThis(aMallocSizeOf);
}
@ -1074,7 +1072,6 @@ bool FragmentOrElement::IsLink(nsIURI** aURI) const {
return false;
}
nsIContent* nsIContent::GetContainingShadowHost() const {
if (mozilla::dom::ShadowRoot* shadow = GetContainingShadow()) {
return shadow->GetHost();
@ -1145,7 +1142,6 @@ void FragmentOrElement::DestroyContent() {
AsElement()->ClearServoData();
}
#ifdef DEBUG
uint32_t oldChildCount = GetChildCount();
#endif
@ -1351,7 +1347,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement)
tmp->ExtendedDOMSlots()->mShadowRoot = nullptr;
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(FragmentOrElement)
@ -1576,7 +1571,6 @@ bool NodeHasActiveFrame(Document* aCurrentDoc, nsINode* aNode) {
aNode->AsElement()->GetPrimaryFrame();
}
// CanSkip checks if aNode is known-live, and if it is, returns true. If aNode
// is in a known-live DOM tree, CanSkip may also remove other objects from
// purple buffer and unmark event listeners and user data. If the root of the
@ -1592,8 +1586,7 @@ bool FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed) {
bool unoptimizable = aNode->UnoptimizableCCNode();
Document* currentDoc = aNode->GetComposedDoc();
if (currentDoc && IsCertainlyAliveNode(aNode, currentDoc) &&
(!unoptimizable || NodeHasActiveFrame(currentDoc, aNode)
)) {
(!unoptimizable || NodeHasActiveFrame(currentDoc, aNode))) {
MarkNodeChildren(aNode);
return true;
}
@ -1796,7 +1789,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(FragmentOrElement)
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
}
// Check that whenever we have effect properties, MayHaveAnimations is set.
#ifdef DEBUG
nsAtom** effectProps = EffectSet::GetEffectSetPropertyAtoms();

Просмотреть файл

@ -190,7 +190,6 @@ class FragmentOrElement : public nsIContent {
*/
RefPtr<ShadowRoot> mShadowRoot;
/**
* Web components custom element data.
*/

Просмотреть файл

@ -61,18 +61,18 @@ void IDTracker::ResetToURIFragmentID(nsIContent* aFromContent, nsIURI* aURI,
nsIContent* bindingParent = aFromContent->GetBindingParent();
if (bindingParent && !aFromContent->IsInShadowTree()) {
// This happens, for example, if aFromContent is part of the content
// inserted by a call to Document::InsertAnonymousContent, which we
// also want to handle. (It also happens for <use>'s anonymous
// content etc.)
Element* anonRoot =
doc->GetAnonRootIfInAnonymousContentContainer(aFromContent);
if (anonRoot) {
mElement = nsContentUtils::MatchElementId(anonRoot, ref);
// We don't have watching working yet for anonymous content, so bail out
// here.
return;
}
// This happens, for example, if aFromContent is part of the content
// inserted by a call to Document::InsertAnonymousContent, which we
// also want to handle. (It also happens for <use>'s anonymous
// content etc.)
Element* anonRoot =
doc->GetAnonRootIfInAnonymousContentContainer(aFromContent);
if (anonRoot) {
mElement = nsContentUtils::MatchElementId(anonRoot, ref);
// We don't have watching working yet for anonymous content, so bail out
// here.
return;
}
}
bool isEqualExceptRef;

Просмотреть файл

@ -53,9 +53,9 @@ enum class IsRemoveNotification {
# define COMPOSED_DOC_DECL
#endif
# define CALL_BINDING_MANAGER(func_, params_) \
do { \
} while (0)
#define CALL_BINDING_MANAGER(func_, params_) \
do { \
} while (0)
// This macro expects the ownerDocument of content_ to be in scope as
// |Document* doc|

Просмотреть файл

@ -184,7 +184,6 @@
#include "nsNetCID.h"
#include "nsIArray.h"
#include "nsIDragService.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/Selection.h"

Просмотреть файл

@ -394,7 +394,6 @@ class nsIContent : public nsINode {
return slots ? slots->mBindingParent.get() : nullptr;
}
/**
* Gets the ShadowRoot binding for this element.
*

Просмотреть файл

@ -117,7 +117,6 @@ static inline nsINode* GetFlattenedTreeParentNode(const nsINode* aNode) {
}
}
MOZ_ASSERT(!parentAsContent->IsActiveChildrenElement(),
"<xbl:children> isn't in the flattened tree");

Просмотреть файл

@ -617,7 +617,6 @@ bool nsJSUtils::GetScopeChainForElement(
return true;
}
/* static */
void nsJSUtils::ResetTimeZone() { JS::ResetTimeZone(); }

Просмотреть файл

@ -241,7 +241,6 @@ class nsJSUtils {
JSContext* aCx, mozilla::dom::Element* aElement,
JS::MutableHandleVector<JSObject*> aScopeChain);
static void ResetTimeZone();
static bool DumpEnabled();

Просмотреть файл

@ -57,7 +57,6 @@ nsNodeInfoManager::~nsNodeInfoManager() {
// Note: mPrincipal may be null here if we never got inited correctly
mPrincipal = nullptr;
if (gNodeInfoManagerLeakPRLog)
MOZ_LOG(gNodeInfoManagerLeakPRLog, LogLevel::Debug,
("NODEINFOMANAGER %p destroyed", this));
@ -103,7 +102,6 @@ nsresult nsNodeInfoManager::Init(mozilla::dom::Document* aDocument) {
mPrincipal = NullPrincipal::CreateWithoutOriginAttributes();
mDefaultPrincipal = mPrincipal;
mDocument = aDocument;
@ -116,7 +114,6 @@ nsresult nsNodeInfoManager::Init(mozilla::dom::Document* aDocument) {
}
void nsNodeInfoManager::DropDocumentReference() {
// This is probably not needed anymore.
for (auto iter = mNodeInfoHash.Iter(); !iter.Done(); iter.Next()) {
iter.Data()->mDocument = nullptr;
@ -358,7 +355,6 @@ bool nsNodeInfoManager::InternalMathMLEnabled() {
void nsNodeInfoManager::AddSizeOfIncludingThis(nsWindowSizes& aSizes) const {
aSizes.mDOMOtherSize += aSizes.mState.mMallocSizeOf(this);
// Measurement of the following members may be added later if DMD finds it
// is worthwhile:
// - mNodeInfoHash

Просмотреть файл

@ -97,7 +97,6 @@ class nsNodeInfoManager final {
void RemoveNodeInfo(mozilla::dom::NodeInfo* aNodeInfo);
/**
* Returns true if SVG nodes in this document have real SVG semantics.
*/

Просмотреть файл

@ -198,7 +198,6 @@ nsresult nsXULPrototypeCache::PutScript(nsIURI* aURI,
return NS_OK;
}
void nsXULPrototypeCache::FlushScripts() { mScriptTable.Clear(); }
void nsXULPrototypeCache::Flush() {
@ -492,7 +491,6 @@ static void ReportSize(const nsCString& aPath, size_t aAmount,
aData);
}
/* static */
void nsXULPrototypeCache::CollectMemoryReports(
nsIHandleReportCallback* aHandleReport, nsISupports* aData) {
@ -515,7 +513,6 @@ void nsXULPrototypeCache::CollectMemoryReports(
other += sInstance->mScriptTable.ShallowSizeOfExcludingThis(mallocSizeOf);
// TODO Report content inside mScriptTable?
other +=
sInstance->mStartupCacheURITable.ShallowSizeOfExcludingThis(mallocSizeOf);

Просмотреть файл

@ -60,7 +60,6 @@ class nsXULPrototypeCache : public nsIObserver {
JSScript* GetScript(nsIURI* aURI);
nsresult PutScript(nsIURI* aURI, JS::Handle<JSScript*> aScriptObject);
/**
* Get a style sheet by URI. If the style sheet is not in the cache,
* returns nullptr.

Просмотреть файл

@ -1667,7 +1667,6 @@ void PresShell::EndObservingDocument() {
char* nsPresShell_ReflowStackPointerTop;
#endif
nsresult PresShell::Initialize() {
if (mIsDestroying) {
return NS_OK;
@ -1745,7 +1744,6 @@ nsresult PresShell::Initialize() {
// scope may have killed us too
NS_ENSURE_STATE(!mHaveShutDown);
// XBLConstructorRunner might destroy us.
NS_ENSURE_STATE(!mHaveShutDown);
}
@ -4076,7 +4074,6 @@ void PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush aFlush) {
mPresContext->RestyleManager()->ProcessPendingRestyles();
}
// Now those constructors or events might have posted restyle
// events. At the same time, we still need up-to-date style data.
// In particular, reflow depends on style being completely up to

Просмотреть файл

@ -70,7 +70,6 @@ inline int32_t PseudoCompareType(nsIFrame* aFrame, nsIContent** aContent) {
return 0;
}
/* static */
bool nsGenConList::NodeAfter(const nsGenConNode* aNode1,
const nsGenConNode* aNode2) {
@ -100,9 +99,7 @@ bool nsGenConList::NodeAfter(const nsGenConNode* aNode1,
int32_t cmp = nsLayoutUtils::CompareTreePosition(content1, content2);
// DoCompareTreePosition doesn't know about XBL anonymous content, and we
// probably shouldn't bother teaching it about it.
MOZ_ASSERT(cmp != 0
,
"same content, different frames");
MOZ_ASSERT(cmp != 0, "same content, different frames");
return cmp > 0;
}

Просмотреть файл

@ -518,8 +518,7 @@ bool InspectorUtils::IsValidCSSColor(GlobalObject& aGlobalObject,
void InspectorUtils::GetBindingURLs(GlobalObject& aGlobalObject,
Element& aElement,
nsTArray<nsString>& aResult) {
}
nsTArray<nsString>& aResult) {}
/* static */
bool InspectorUtils::SetContentState(GlobalObject& aGlobalObject,

Просмотреть файл

@ -1692,9 +1692,9 @@ already_AddRefed<nsIURI> SVGObserverUtils::GetBaseURLForLocalRef(
nsIContent* bindingParent = content->GetBindingParent();
if (bindingParent) {
MOZ_ASSERT(content->IsInNativeAnonymousSubtree(),
"a non-native anonymous tree which is not from "
"an XBL binding?");
MOZ_ASSERT(content->IsInNativeAnonymousSubtree(),
"a non-native anonymous tree which is not from "
"an XBL binding?");
}
}