Bug 1379421: Remove unneeded null-checks in RestyleManager.
Container is the result of dereferencing a non-null variable, so there's no way
that can be null.
MozReview-Commit-ID: 42xWAeHxR5E
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -150,18 +150,17 @@ RestyleManager::RestyleForInsertOrChange
// The container might be a document or a ShadowRoot.
if (!aContainer->IsElement()) {
return;
}
Element* container = aContainer->AsElement();
NS_ASSERTION(!aChild->IsRootOfAnonymousSubtree(),
"anonymous nodes should not be in child lists");
- uint32_t selectorFlags =
- container ? (container->GetFlags() & NODE_ALL_SELECTOR_FLAGS) : 0;
+ uint32_t selectorFlags = container->GetFlags() & NODE_ALL_SELECTOR_FLAGS;
if (selectorFlags == 0)
return;
if (selectorFlags & NODE_HAS_EMPTY_SELECTOR) {
// see whether we need to restyle the container
bool wasEmpty = true; // :empty or :-moz-only-whitespace
for (nsIContent* child = container->GetFirstChild();
child;
@@ -245,18 +244,17 @@ RestyleManager::ContentRemoved(nsINode*
if (aOldChild->IsRootOfAnonymousSubtree()) {
// This should be an assert, but this is called incorrectly in
// HTMLEditor::DeleteRefToAnonymousNode and the assertions were clogging
// up the logs. Make it an assert again when that's fixed.
MOZ_ASSERT(aOldChild->GetProperty(nsGkAtoms::restylableAnonymousNode),
"anonymous nodes should not be in child lists (bug 439258)");
}
- uint32_t selectorFlags =
- container ? (container->GetFlags() & NODE_ALL_SELECTOR_FLAGS) : 0;
+ uint32_t selectorFlags = container->GetFlags() & NODE_ALL_SELECTOR_FLAGS;
if (selectorFlags == 0)
return;
if (selectorFlags & NODE_HAS_EMPTY_SELECTOR) {
// see whether we need to restyle the container
bool isEmpty = true; // :empty or :-moz-only-whitespace
for (nsIContent* child = container->GetFirstChild();
child;