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

Unified Diff: Source/core/editing/ApplyBlockElementCommand.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated change after Doug's review. Created 5 years, 10 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/TreeScope.cpp ('k') | Source/core/editing/EditorCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ApplyBlockElementCommand.cpp
diff --git a/Source/core/editing/ApplyBlockElementCommand.cpp b/Source/core/editing/ApplyBlockElementCommand.cpp
index bfec394063c6093a8538b3e3e75ab354e4421eaf..0fb0b64856e68a451711e5a5dd1eea476bdc3575 100644
--- a/Source/core/editing/ApplyBlockElementCommand.cpp
+++ b/Source/core/editing/ApplyBlockElementCommand.cpp
@@ -173,7 +173,7 @@ static bool isNewLineAtPosition(const Position& position)
return textAtPosition[0] == '\n';
}
-static LayoutStyle* layoutStyleOfEnclosingTextNode(const Position& position)
+static const LayoutStyle* layoutStyleOfEnclosingTextNode(const Position& position)
{
if (position.anchorType() != Position::PositionIsOffsetInAnchor || !position.containerNode() || !position.containerNode()->isTextNode())
return 0;
@@ -188,7 +188,7 @@ void ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded(const
document().updateRenderTreeIfNeeded();
bool isStartAndEndOnSameNode = false;
- if (LayoutStyle* startStyle = layoutStyleOfEnclosingTextNode(start)) {
+ if (const LayoutStyle* startStyle = layoutStyleOfEnclosingTextNode(start)) {
isStartAndEndOnSameNode = layoutStyleOfEnclosingTextNode(end) && start.containerNode() == end.containerNode();
bool isStartAndEndOfLastParagraphOnSameNode = layoutStyleOfEnclosingTextNode(m_endOfLastParagraph) && start.containerNode() == m_endOfLastParagraph.containerNode();
@@ -215,7 +215,7 @@ void ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded(const
document().updateRenderTreeIfNeeded();
- if (LayoutStyle* endStyle = layoutStyleOfEnclosingTextNode(end)) {
+ if (const LayoutStyle* endStyle = layoutStyleOfEnclosingTextNode(end)) {
bool isEndAndEndOfLastParagraphOnSameNode = layoutStyleOfEnclosingTextNode(m_endOfLastParagraph) && end.deprecatedNode() == m_endOfLastParagraph.deprecatedNode();
// Include \n at the end of line if we're at an empty paragraph
if (endStyle->preserveNewline() && start == end && end.offsetInContainerNode() < end.containerNode()->maxCharacterOffset()) {
@@ -247,7 +247,7 @@ VisiblePosition ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfN
{
VisiblePosition endOfNextParagraph = endOfParagraph(endOfCurrentParagraph.next());
Position position = endOfNextParagraph.deepEquivalent();
- LayoutStyle* style = layoutStyleOfEnclosingTextNode(position);
+ const LayoutStyle* style = layoutStyleOfEnclosingTextNode(position);
if (!style)
return endOfNextParagraph;
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/editing/EditorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698