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

Side by Side Diff: third_party/WebKit/Source/core/dom/Text.cpp

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global Created 3 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 unified diff | Download patch
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 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
5 * reserved. 5 * reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // Both non-empty text nodes. Merge them. 78 // Both non-empty text nodes. Merge them.
79 unsigned offset = length(); 79 unsigned offset = length();
80 String nextTextData = nextText->data(); 80 String nextTextData = nextText->data();
81 String oldTextData = data(); 81 String oldTextData = data();
82 setDataWithoutUpdate(data() + nextTextData); 82 setDataWithoutUpdate(data() + nextTextData);
83 updateTextLayoutObject(oldTextData.length(), 0); 83 updateTextLayoutObject(oldTextData.length(), 0);
84 84
85 document().didMergeTextNodes(*this, *nextText, offset); 85 document().didMergeTextNodes(*this, *nextText, offset);
86 86
87 // Empty nextText for layout update. 87 // Empty nextText for layout update.
88 nextText->setDataWithoutUpdate(emptyString()); 88 nextText->setDataWithoutUpdate(emptyString);
89 nextText->updateTextLayoutObject(0, nextTextData.length()); 89 nextText->updateTextLayoutObject(0, nextTextData.length());
90 90
91 // Restore nextText for mutation event. 91 // Restore nextText for mutation event.
92 nextText->setDataWithoutUpdate(nextTextData); 92 nextText->setDataWithoutUpdate(nextTextData);
93 nextText->updateTextLayoutObject(0, 0); 93 nextText->updateTextLayoutObject(0, 0);
94 94
95 document().incDOMTreeVersion(); 95 document().incDOMTreeVersion();
96 didModifyData(oldTextData, CharacterData::UpdateFromNonParser); 96 didModifyData(oldTextData, CharacterData::UpdateFromNonParser);
97 nextText->remove(IGNORE_EXCEPTION_FOR_TESTING); 97 nextText->remove(IGNORE_EXCEPTION_FOR_TESTING);
98 } 98 }
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 449
450 Text* Text::cloneWithData(const String& data) { 450 Text* Text::cloneWithData(const String& data) {
451 return create(document(), data); 451 return create(document(), data);
452 } 452 }
453 453
454 DEFINE_TRACE(Text) { 454 DEFINE_TRACE(Text) {
455 CharacterData::trace(visitor); 455 CharacterData::trace(visitor);
456 } 456 }
457 457
458 } // namespace blink 458 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698