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

Unified Diff: Source/core/layout/TextAutosizer.cpp

Issue 1162383003: C++11: Replace 0 with nullptr where applicable in layout code. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add one more file. Created 5 years, 6 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/layout/TextAutosizer.h ('k') | Source/core/layout/TextRunConstructor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/TextAutosizer.cpp
diff --git a/Source/core/layout/TextAutosizer.cpp b/Source/core/layout/TextAutosizer.cpp
index 4b90863eac86e8fc8651e8117e59bb71615872ae..775abc5a182660170f0043a7dd4db078320c9780 100644
--- a/Source/core/layout/TextAutosizer.cpp
+++ b/Source/core/layout/TextAutosizer.cpp
@@ -121,17 +121,17 @@ static const LayoutObject* parentElementLayoutObject(const LayoutObject* layoutO
// so we need to obtain this from the DOM tree.
const Node* node = layoutObject->node();
if (!node)
- return 0;
+ return nullptr;
// FIXME: This should be using LayoutTreeBuilderTraversal::parent().
if (Element* parent = node->parentElement())
return parent->layoutObject();
- return 0;
+ return nullptr;
}
static bool isNonTextAreaFormControl(const LayoutObject* layoutObject)
{
- const Node* node = layoutObject ? layoutObject->node() : 0;
+ const Node* node = layoutObject ? layoutObject->node() : nullptr;
if (!node || !node->isElementNode())
return false;
const Element* element = toElement(node);
@@ -278,7 +278,7 @@ static bool hasExplicitWidth(const LayoutBlock* block)
TextAutosizer::TextAutosizer(const Document* document)
: m_document(document)
- , m_firstBlockToBeginLayout(0)
+ , m_firstBlockToBeginLayout(nullptr)
#if ENABLE(ASSERT)
, m_blocksThatHaveBegunLayout()
#endif
@@ -423,7 +423,7 @@ float TextAutosizer::inflate(LayoutObject* parent, InflateBehavior behavior, flo
Cluster* cluster = currentCluster();
bool hasTextChild = false;
- LayoutObject* child = 0;
+ LayoutObject* child = nullptr;
if (parent->isLayoutBlock() && (parent->childrenInline() || behavior == DescendToInnerBlocks))
child = toLayoutBlock(parent)->firstChild();
else if (parent->isLayoutInline())
@@ -611,7 +611,7 @@ TextAutosizer::BlockFlags TextAutosizer::classifyBlock(const LayoutObject* layou
bool TextAutosizer::clusterWouldHaveEnoughTextToAutosize(const LayoutBlock* root, const LayoutBlock* widthProvider)
{
- Cluster hypotheticalCluster(root, classifyBlock(root), 0);
+ Cluster hypotheticalCluster(root, classifyBlock(root), nullptr);
return clusterHasEnoughTextToAutosize(&hypotheticalCluster, widthProvider);
}
@@ -714,15 +714,15 @@ TextAutosizer::Cluster* TextAutosizer::maybeCreateCluster(const LayoutBlock* blo
{
BlockFlags flags = classifyBlock(block);
if (!(flags & POTENTIAL_ROOT))
- return 0;
+ return nullptr;
- Cluster* parentCluster = m_clusterStack.isEmpty() ? 0 : currentCluster();
+ Cluster* parentCluster = m_clusterStack.isEmpty() ? nullptr : currentCluster();
ASSERT(parentCluster || block->isLayoutView());
// If a non-independent block would not alter the SUPPRESSING flag, it doesn't need to be a cluster.
bool parentSuppresses = parentCluster && (parentCluster->m_flags & SUPPRESSING);
if (!(flags & INDEPENDENT) && !(flags & EXPLICIT_WIDTH) && !!(flags & SUPPRESSING) == parentSuppresses)
- return 0;
+ return nullptr;
Cluster* cluster = new Cluster(block, flags, parentCluster, getSupercluster(block));
#ifdef AUTOSIZING_DOM_DEBUG_INFO
@@ -737,11 +737,11 @@ TextAutosizer::Supercluster* TextAutosizer::getSupercluster(const LayoutBlock* b
{
Fingerprint fingerprint = m_fingerprintMapper.get(block);
if (!fingerprint)
- return 0;
+ return nullptr;
BlockSet* roots = m_fingerprintMapper.getTentativeClusterRoots(fingerprint);
if (!roots || roots->size() < 2 || !roots->contains(block))
- return 0;
+ return nullptr;
SuperclusterMap::AddResult addResult = m_superclusters.add(fingerprint, PassOwnPtr<Supercluster>());
if (!addResult.isNewEntry)
@@ -957,7 +957,7 @@ const LayoutObject* TextAutosizer::findTextLeaf(const LayoutObject* parent, size
}
--depth;
- return 0;
+ return nullptr;
}
void TextAutosizer::applyMultiplier(LayoutObject* layoutObject, float multiplier, RelayoutBehavior relayoutBehavior)
« no previous file with comments | « Source/core/layout/TextAutosizer.h ('k') | Source/core/layout/TextRunConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698