Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(670)

Unified Diff: Source/core/dom/Element.cpp

Issue 23717008: Remove useless null checks from Node::document() call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/dom/EventPathWalker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index ce5e91a04f284c071f7fabb080953e601ae0b4b1..053babdc763cbbf59ec183bac24aa1214c8647e4 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -195,7 +195,7 @@ PassRefPtr<Element> Element::create(const QualifiedName& tagName, Document* docu
Element::~Element()
{
#ifndef NDEBUG
- if (document() && document()->renderer()) {
+ if (document()->renderer()) {
// When the document is not destroyed, an element that was part of a named flow
// content nodes should have been removed from the content nodes collection
// and the inNamedFlow flag reset.
@@ -1126,7 +1126,7 @@ void Element::parserSetAttributes(const Vector<Attribute>& attributeVector)
if (attributeVector.isEmpty())
return;
- if (document() && document()->sharedObjectPool())
+ if (document()->sharedObjectPool())
m_elementData = document()->sharedObjectPool()->cachedShareableElementDataWithAttributes(attributeVector);
else
m_elementData = ShareableElementData::createWithAttributes(attributeVector);
@@ -3237,7 +3237,7 @@ void Element::styleAttributeChanged(const AtomicString& newStyleString, Attribut
{
ASSERT(isStyledElement());
WTF::OrdinalNumber startLineNumber = WTF::OrdinalNumber::beforeFirst();
- if (document() && document()->scriptableDocumentParser() && !document()->isInDocumentWrite())
+ if (document()->scriptableDocumentParser() && !document()->isInDocumentWrite())
startLineNumber = document()->scriptableDocumentParser()->lineNumber();
if (newStyleString.isNull()) {
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/dom/EventPathWalker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698