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

Unified Diff: third_party/WebKit/Source/core/dom/Text.cpp

Issue 2390543002: Reflow comments in core/dom/. (Closed)
Patch Set: Reformat comments in core/dom/. Created 4 years, 2 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 | « third_party/WebKit/Source/core/dom/Text.h ('k') | third_party/WebKit/Source/core/dom/TextLinkColors.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Text.cpp
diff --git a/third_party/WebKit/Source/core/dom/Text.cpp b/third_party/WebKit/Source/core/dom/Text.cpp
index d589ac79c748bb512a2eab3a7b2c1df923df6a2d..be2d847be5126ca138a2ad9e51db4a8f2965841e 100644
--- a/third_party/WebKit/Source/core/dom/Text.cpp
+++ b/third_party/WebKit/Source/core/dom/Text.cpp
@@ -1,7 +1,8 @@
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
+ * reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -191,12 +192,13 @@ String Text::wholeText() const {
Text* Text::replaceWholeText(const String& newText) {
// Remove all adjacent text nodes, and replace the contents of this one.
- // Protect startText and endText against mutation event handlers removing the last ref
+ // Protect startText and endText against mutation event handlers removing the
+ // last ref
Text* startText = const_cast<Text*>(earliestLogicallyAdjacentTextNode(this));
Text* endText = const_cast<Text*>(latestLogicallyAdjacentTextNode(this));
- ContainerNode* parent =
- parentNode(); // Protect against mutation handlers moving this node during traversal
+ ContainerNode* parent = parentNode(); // Protect against mutation handlers
+ // moving this node during traversal
for (Node* n = startText;
n && n != this && n->isTextNode() && n->parentNode() == parent;) {
Node* nodeToRemove = n;
@@ -279,7 +281,8 @@ bool Text::textLayoutObjectIsNeeded(const ComputedStyle& style,
if (style.preserveNewline())
return true;
- // childNeedsDistributionRecalc() here is rare, only happens JS calling surroundContents() etc. from DOMNodeInsertedIntoDocument etc.
+ // childNeedsDistributionRecalc() here is rare, only happens JS calling
+ // surroundContents() etc. from DOMNodeInsertedIntoDocument etc.
if (document().childNeedsDistributionRecalc())
return true;
@@ -297,8 +300,9 @@ bool Text::textLayoutObjectIsNeeded(const ComputedStyle& style,
(!prev || !prev->isInline()))
return false;
- // Avoiding creation of a layoutObject for the text node is a non-essential memory optimization.
- // So to avoid blowing up on very wide DOMs, we limit the number of siblings to visit.
+ // Avoiding creation of a layoutObject for the text node is a non-essential
+ // memory optimization. So to avoid blowing up on very wide DOMs, we limit
+ // the number of siblings to visit.
unsigned maxSiblingsToVisit = 50;
LayoutObject* first = parent.slowFirstChild();
@@ -307,8 +311,9 @@ bool Text::textLayoutObjectIsNeeded(const ComputedStyle& style,
first = first->nextSibling();
if (!first || first == layoutObject() ||
LayoutTreeBuilderTraversal::nextSiblingLayoutObject(*this) == first) {
- // If we're adding children to this flow our previous siblings are not in the layout tree yet so we
- // cannot know if we will be the first child in the line and collapse away. We have to assume we need a layout object.
+ // If we're adding children to this flow our previous siblings are not in
+ // the layout tree yet so we cannot know if we will be the first child in
+ // the line and collapse away. We have to assume we need a layout object.
Node* firstChildNode =
parent.node() ? LayoutTreeBuilderTraversal::firstChild(*parent.node())
: nullptr;
@@ -367,8 +372,9 @@ void Text::reattachLayoutTreeIfNeeded(const AttachContext& context) {
if (layoutObjectIsNeeded == !!layoutObject())
return;
- // The following is almost the same as Node::reattachLayoutTree() except that we create a layoutObject only if needed.
- // Not calling reattachLayoutTree() to avoid repeated calls to Text::textLayoutObjectIsNeeded().
+ // The following is almost the same as Node::reattachLayoutTree() except that
+ // we create a layoutObject only if needed. Not calling reattachLayoutTree()
+ // to avoid repeated calls to Text::textLayoutObjectIsNeeded().
AttachContext reattachContext(context);
reattachContext.performingReattach = true;
@@ -394,8 +400,8 @@ void Text::recalcTextStyle(StyleRecalcChange change, Text* nextTextSibling) {
}
}
-// If a whitespace node had no layoutObject and goes through a recalcStyle it may
-// need to create one if the parent style now has white-space: pre.
+// If a whitespace node had no layoutObject and goes through a recalcStyle it
+// may need to create one if the parent style now has white-space: pre.
bool Text::needsWhitespaceLayoutObject() {
DCHECK(!layoutObject());
if (const ComputedStyle* style = parentComputedStyle())
« no previous file with comments | « third_party/WebKit/Source/core/dom/Text.h ('k') | third_party/WebKit/Source/core/dom/TextLinkColors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698