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

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

Issue 414863002: Minimize RenderObject* casting to RenderText* (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 5 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 | « no previous file | Source/core/dom/Text.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Range.cpp
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp
index 3e56d9b4e1893ca8eb1378af080aaa09a1bd14c8..6df09014175cf654ddad1eb8d39b7fd4496e95b6 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -1659,14 +1659,13 @@ void Range::getBorderAndTextQuads(Vector<FloatQuad>& quads) const
}
}
} else if (node->isTextNode()) {
- if (RenderObject* renderer = toText(node)->renderer()) {
- RenderText& renderText = toRenderText(*renderer);
+ if (RenderText* renderText = toText(node)->renderer()) {
int startOffset = (node == startContainer) ? m_start.offset() : 0;
int endOffset = (node == endContainer) ? m_end.offset() : INT_MAX;
Vector<FloatQuad> textQuads;
- renderText.absoluteQuadsForRange(textQuads, startOffset, endOffset);
- m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(textQuads, renderText);
+ renderText->absoluteQuadsForRange(textQuads, startOffset, endOffset);
+ m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(textQuads, *renderText);
quads.appendVector(textQuads);
}
« no previous file with comments | « no previous file | Source/core/dom/Text.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698