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

Unified Diff: Source/core/editing/VisibleUnits.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/editing/SimplifyMarkupCommand.cpp ('k') | Source/core/editing/iterators/TextIterator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleUnits.cpp
diff --git a/Source/core/editing/VisibleUnits.cpp b/Source/core/editing/VisibleUnits.cpp
index 589dfb138473916c1dd0a46af6c5c1e9e79b0866..06555882b673f4e530f22ee2e1cd46581a552b18 100644
--- a/Source/core/editing/VisibleUnits.cpp
+++ b/Source/core/editing/VisibleUnits.cpp
@@ -1115,8 +1115,8 @@ VisiblePosition startOfParagraph(const VisiblePosition& c, EditingBoundaryCrossi
n = NodeTraversal::previousPostOrder(*n, startBlock);
continue;
}
- LayoutStyle* style = r->style();
- if (style->visibility() != VISIBLE) {
+ const LayoutStyle& style = r->styleRef();
+ if (style.visibility() != VISIBLE) {
n = NodeTraversal::previousPostOrder(*n, startBlock);
continue;
}
@@ -1127,7 +1127,7 @@ VisiblePosition startOfParagraph(const VisiblePosition& c, EditingBoundaryCrossi
if (r->isText() && toRenderText(r)->renderedTextLength()) {
ASSERT_WITH_SECURITY_IMPLICATION(n->isTextNode());
type = Position::PositionIsOffsetInAnchor;
- if (style->preserveNewline()) {
+ if (style.preserveNewline()) {
RenderText* text = toRenderText(r);
int i = text->textLength();
int o = offset;
@@ -1194,8 +1194,8 @@ VisiblePosition endOfParagraph(const VisiblePosition &c, EditingBoundaryCrossing
n = NodeTraversal::next(*n, stayInsideBlock);
continue;
}
- LayoutStyle* style = r->style();
- if (style->visibility() != VISIBLE) {
+ const LayoutStyle& style = r->styleRef();
+ if (style.visibility() != VISIBLE) {
n = NodeTraversal::next(*n, stayInsideBlock);
continue;
}
@@ -1208,7 +1208,7 @@ VisiblePosition endOfParagraph(const VisiblePosition &c, EditingBoundaryCrossing
ASSERT_WITH_SECURITY_IMPLICATION(n->isTextNode());
int length = toRenderText(r)->textLength();
type = Position::PositionIsOffsetInAnchor;
- if (style->preserveNewline()) {
+ if (style.preserveNewline()) {
RenderText* text = toRenderText(r);
int o = n == startNode ? offset : 0;
for (int i = o; i < length; ++i) {
« no previous file with comments | « Source/core/editing/SimplifyMarkupCommand.cpp ('k') | Source/core/editing/iterators/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698