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

Unified Diff: Source/core/dom/Text.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 | « Source/core/dom/Text.h ('k') | Source/core/editing/CompositeEditCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Text.cpp
diff --git a/Source/core/dom/Text.cpp b/Source/core/dom/Text.cpp
index 9f0c090974f3957a4fbfa3e2481a6309c2b06bb9..95a0846aff981ca734fabf80783c529b6e7d5ded 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -124,7 +124,7 @@ PassRefPtrWillBeRawPtr<Text> Text::splitText(unsigned offset, ExceptionState& ex
return nullptr;
if (renderer())
- toRenderText(renderer())->setTextWithOffset(dataImpl(), 0, oldStr.length());
+ renderer()->setTextWithOffset(dataImpl(), 0, oldStr.length());
if (parentNode())
document().didSplitTextNode(*this);
@@ -310,7 +310,7 @@ void Text::attach(const AttachContext& context)
void Text::recalcTextStyle(StyleRecalcChange change, Text* nextTextSibling)
{
- if (RenderText* renderer = toRenderText(this->renderer())) {
+ if (RenderText* renderer = this->renderer()) {
if (change != NoChange || needsStyleRecalc())
renderer->setStyle(document().ensureStyleResolver().styleForText(this));
if (needsStyleRecalc())
@@ -336,7 +336,7 @@ void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfRe
{
if (!inActiveDocument())
return;
- RenderText* textRenderer = toRenderText(renderer());
+ RenderText* textRenderer = renderer();
if (!textRenderer || !textRendererIsNeeded(*textRenderer->style(), *textRenderer->parent())) {
lazyReattachIfAttached();
// FIXME: Editing should be updated so this is not neccesary.
« no previous file with comments | « Source/core/dom/Text.h ('k') | Source/core/editing/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698