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

Unified Diff: WebCore/rendering/RenderTextFragment.cpp

Issue 3324013: Merge 66911 - 2010-09-07 Abhishek Arya <inferno@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 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 | « LayoutTests/fast/text/one-letter-transform-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/rendering/RenderTextFragment.cpp
===================================================================
--- WebCore/rendering/RenderTextFragment.cpp (revision 67116)
+++ WebCore/rendering/RenderTextFragment.cpp (working copy)
@@ -48,9 +48,9 @@
{
Node* e = node();
RefPtr<StringImpl> result = ((e && e->isTextNode()) ? static_cast<Text*>(e)->dataImpl() : contentString());
- if (result && (start() > 0 || start() < result->length()))
- result = result->substring(start(), end());
- return result.release();
+ if (!result)
+ return 0;
+ return result->substring(start(), end());
}
void RenderTextFragment::destroy()
@@ -81,7 +81,7 @@
if (start()) {
Node* e = node();
StringImpl* original = ((e && e->isTextNode()) ? static_cast<Text*>(e)->dataImpl() : contentString());
- if (original)
+ if (original && start() <= original->length())
return (*original)[start() - 1];
}
« no previous file with comments | « LayoutTests/fast/text/one-letter-transform-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698