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

Side by Side Diff: Source/WebCore/dom/CharacterData.cpp

Issue 10444080: Merge 118471 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 6 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/events/dom-character-data-modified-textarea-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 26 matching lines...) Expand all
37 using namespace std; 37 using namespace std;
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 void CharacterData::setData(const String& data, ExceptionCode&) 41 void CharacterData::setData(const String& data, ExceptionCode&)
42 { 42 {
43 const String& nonNullData = !data.isNull() ? data : emptyString(); 43 const String& nonNullData = !data.isNull() ? data : emptyString();
44 if (m_data == nonNullData) 44 if (m_data == nonNullData)
45 return; 45 return;
46 46
47 RefPtr<CharacterData> protect = this;
48
47 unsigned oldLength = length(); 49 unsigned oldLength = length();
48 50
49 setDataAndUpdate(nonNullData, 0, oldLength, nonNullData.length()); 51 setDataAndUpdate(nonNullData, 0, oldLength, nonNullData.length());
50 document()->textRemoved(this, 0, oldLength); 52 document()->textRemoved(this, 0, oldLength);
51 } 53 }
52 54
53 String CharacterData::substringData(unsigned offset, unsigned count, ExceptionCo de& ec) 55 String CharacterData::substringData(unsigned offset, unsigned count, ExceptionCo de& ec)
54 { 56 {
55 checkCharDataOperation(offset, ec); 57 checkCharDataOperation(offset, ec);
56 if (ec) 58 if (ec)
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 return false; 232 return false;
231 return Node::rendererIsNeeded(context); 233 return Node::rendererIsNeeded(context);
232 } 234 }
233 235
234 bool CharacterData::offsetInCharacters() const 236 bool CharacterData::offsetInCharacters() const
235 { 237 {
236 return true; 238 return true;
237 } 239 }
238 240
239 } // namespace WebCore 241 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/dom-character-data-modified-textarea-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698