Call deprecatedCharacters instead of characters at more call sites
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Jan 2014 22:47:20 +0000 (22:47 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Jan 2014 22:47:20 +0000 (22:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127631

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* API/JSValueRef.cpp:
(JSValueMakeFromJSONString):
* API/OpaqueJSString.cpp:
(OpaqueJSString::~OpaqueJSString):
* bindings/ScriptValue.cpp:
(Deprecated::jsToInspectorValue):
* inspector/ContentSearchUtilities.cpp:
(Inspector::ContentSearchUtilities::createSearchRegexSource):
* inspector/InspectorValues.cpp:
* runtime/Identifier.h:
(JSC::Identifier::deprecatedCharacters):
* runtime/JSStringBuilder.h:
(JSC::JSStringBuilder::append):
Use the new name.

Source/WebCore:

* bindings/objc/WebScriptObject.mm:
(+[WebScriptObject _convertValueToObjcValue:JSC::originRootObject:rootObject:]):
* editing/CompositeEditCommand.cpp:
(WebCore::containsOnlyWhitespace):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::insertText):
* editing/VisibleUnits.cpp:
(WebCore::startOfParagraph):
(WebCore::endOfParagraph):
* html/parser/HTMLParserIdioms.cpp:
(WebCore::stripLeadingAndTrailingHTMLSpaces):
(WebCore::parseHTMLNonNegativeInteger):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::newLineAndWhitespaceDelimiters):
* inspector/InspectorStyleTextEditor.cpp:
(WebCore::InspectorStyleTextEditor::insertProperty):
(WebCore::InspectorStyleTextEditor::internalReplaceProperty):
* platform/Length.cpp:
(WebCore::newCoordsArray):
* platform/LinkHash.cpp:
(WebCore::visitedLinkHash):
* platform/graphics/Color.cpp:
(WebCore::Color::parseHexColor):
(WebCore::Color::Color):
* platform/graphics/TextRun.h:
(WebCore::TextRun::TextRun):
* platform/text/TextEncodingRegistry.cpp:
(WebCore::atomicCanonicalTextEncodingName):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::constructTextRun):
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::width):
* svg/SVGFontElement.cpp:
(WebCore::SVGFontElement::registerLigaturesInGlyphCache):
* xml/XPathFunctions.cpp:
(WebCore::XPath::FunId::evaluate):
Use the new name.

Source/WTF:

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::replace):
* wtf/text/WTFString.h:
(WTF::String::isAllSpecialCharacters):
Use the new name.

Tools:

* TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
(TestWebKitAPI::expectBuilderContent):
(TestWebKitAPI::expectEmpty):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST):
Use the new name.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162784 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 files changed:
Source/JavaScriptCore/API/JSValueRef.cpp
Source/JavaScriptCore/API/OpaqueJSString.cpp
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bindings/ScriptValue.cpp
Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp
Source/JavaScriptCore/inspector/InspectorValues.cpp
Source/JavaScriptCore/runtime/Identifier.h
Source/JavaScriptCore/runtime/JSStringBuilder.h
Source/WTF/ChangeLog
Source/WTF/wtf/text/StringImpl.cpp
Source/WTF/wtf/text/WTFString.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/objc/WebScriptObject.mm
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/TypingCommand.cpp
Source/WebCore/editing/VisibleUnits.cpp
Source/WebCore/html/parser/HTMLParserIdioms.cpp
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/inspector/InspectorStyleTextEditor.cpp
Source/WebCore/platform/Length.cpp
Source/WebCore/platform/LinkHash.cpp
Source/WebCore/platform/graphics/Color.cpp
Source/WebCore/platform/graphics/TextRun.h
Source/WebCore/platform/text/TextEncodingRegistry.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderCombineText.cpp
Source/WebCore/svg/SVGFontElement.cpp
Source/WebCore/xml/XPathFunctions.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp
Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp

index eb99f5d..3e0cbbd 100644 (file)
@@ -327,7 +327,7 @@ JSValueRef JSValueMakeFromJSONString(JSContextRef ctx, JSStringRef string)
         LiteralParser<LChar> parser(exec, str.characters8(), length, StrictJSON);
         return toRef(exec, parser.tryLiteralParse());
     }
-    LiteralParser<UChar> parser(exec, str.characters(), length, StrictJSON);
+    LiteralParser<UChar> parser(exec, str.deprecatedCharacters(), length, StrictJSON);
     return toRef(exec, parser.tryLiteralParse());
 }
 
index b097ed4..5cc2e0a 100644 (file)
@@ -47,7 +47,7 @@ OpaqueJSString::~OpaqueJSString()
     if (!characters)
         return;
 
-    if (!m_string.is8Bit() && m_string.characters() == characters)
+    if (!m_string.is8Bit() && m_string.deprecatedCharacters() == characters)
         return;
 
     fastFree(characters);
index 09a6c4e..eb596ce 100644 (file)
@@ -1,5 +1,27 @@
 2014-01-25  Darin Adler  <darin@apple.com>
 
+        Call deprecatedCharacters instead of characters at more call sites
+        https://bugs.webkit.org/show_bug.cgi?id=127631
+
+        Reviewed by Sam Weinig.
+
+        * API/JSValueRef.cpp:
+        (JSValueMakeFromJSONString):
+        * API/OpaqueJSString.cpp:
+        (OpaqueJSString::~OpaqueJSString):
+        * bindings/ScriptValue.cpp:
+        (Deprecated::jsToInspectorValue):
+        * inspector/ContentSearchUtilities.cpp:
+        (Inspector::ContentSearchUtilities::createSearchRegexSource):
+        * inspector/InspectorValues.cpp:
+        * runtime/Identifier.h:
+        (JSC::Identifier::deprecatedCharacters):
+        * runtime/JSStringBuilder.h:
+        (JSC::JSStringBuilder::append):
+        Use the new name.
+
+2014-01-25  Darin Adler  <darin@apple.com>
+
         Get rid of ICU_UNICODE and WCHAR_UNICODE remnants
         https://bugs.webkit.org/show_bug.cgi?id=127623
 
index 5c60b1f..c72ab46 100644 (file)
@@ -117,7 +117,7 @@ static PassRefPtr<InspectorValue> jsToInspectorValue(ExecState* scriptState, JSV
         return InspectorBasicValue::create(value.asNumber());
     if (value.isString()) {
         String s = value.getString(scriptState);
-        return InspectorString::create(String(s.characters(), s.length()));
+        return InspectorString::create(String(s.deprecatedCharacters(), s.length()));
     }
 
     if (value.isObject()) {
@@ -144,7 +144,7 @@ static PassRefPtr<InspectorValue> jsToInspectorValue(ExecState* scriptState, JSV
             RefPtr<InspectorValue> inspectorValue = jsToInspectorValue(scriptState, propertyValue, maxDepth);
             if (!inspectorValue)
                 return nullptr;
-            inspectorObject->setValue(String(name.characters(), name.length()), inspectorValue);
+            inspectorObject->setValue(String(name.deprecatedCharacters(), name.length()), inspectorValue);
         }
         return inspectorObject;
     }
index 2b5296e..8f1f91c 100644 (file)
@@ -48,7 +48,7 @@ static const char regexSpecialCharacters[] = "[](){}+-*.,?\\^$|";
 static String createSearchRegexSource(const String& text)
 {
     String result;
-    const UChar* characters = text.characters();
+    const UChar* characters = text.deprecatedCharacters();
     String specials(regexSpecialCharacters);
 
     for (unsigned i = 0; i < text.length(); i++) {
index 211dacd..4cdf71e 100644 (file)
@@ -472,7 +472,7 @@ inline void doubleQuoteString(const String& str, StringBuilder* dst)
                 //    is also optional.  It would also be a pain to implement here.
                 unsigned int symbol = static_cast<unsigned int>(c);
                 String symbolCode = String::format("\\u%04X", symbol);
-                dst->append(symbolCode.characters(), symbolCode.length());
+                dst->append(symbolCode.deprecatedCharacters(), symbolCode.length());
             } else
                 dst->append(c);
         }
index 0abb527..6733ec5 100644 (file)
@@ -55,7 +55,7 @@ namespace JSC {
         const String& string() const { return m_string; }
         StringImpl* impl() const { return m_string.impl(); }
         
-        const UChar* characters() const { return m_string.characters(); }
+        const UChar* deprecatedCharacters() const { return m_string.deprecatedCharacters(); }
         int length() const { return m_string.length(); }
         
         CString ascii() const { return m_string.ascii(); }
index 5d4960e..7b1c1a5 100644 (file)
@@ -105,7 +105,7 @@ public:
             }
             upConvert();
         }
-        m_okay &= buffer16.tryAppend(str.characters(), length);
+        m_okay &= buffer16.tryAppend(str.deprecatedCharacters(), length);
     }
 
     void upConvert()
index d78939d..aeb15ec 100644 (file)
@@ -1,5 +1,18 @@
 2014-01-25  Darin Adler  <darin@apple.com>
 
+        Call deprecatedCharacters instead of characters at more call sites
+        https://bugs.webkit.org/show_bug.cgi?id=127631
+
+        Reviewed by Sam Weinig.
+
+        * wtf/text/StringImpl.cpp:
+        (WTF::StringImpl::replace):
+        * wtf/text/WTFString.h:
+        (WTF::String::isAllSpecialCharacters):
+        Use the new name.
+
+2014-01-25  Darin Adler  <darin@apple.com>
+
         Add a new separate LChar.h header file, to be used after we remove Unicode.h
         https://bugs.webkit.org/show_bug.cgi?id=127630
 
index fe8213c..3479425 100644 (file)
@@ -1489,7 +1489,7 @@ PassRef<StringImpl> StringImpl::replace(unsigned position, unsigned lengthToRepl
         for (unsigned i = 0; i < length() - position - lengthToReplace; ++i)
             data[i + position + lengthToInsert] = m_data8[i + position + lengthToReplace];
     } else {
-        memcpy(data + position + lengthToInsert, characters() + position + lengthToReplace,
+        memcpy(data + position + lengthToInsert, characters16() + position + lengthToReplace,
             (length() - position - lengthToReplace) * sizeof(UChar));
     }
     return newImpl;
index c4011bc..cf5a3b5 100644 (file)
@@ -632,7 +632,7 @@ inline bool String::isAllSpecialCharacters() const
 
     if (is8Bit())
         return WTF::isAllSpecialCharacters<isSpecialCharacter, LChar>(characters8(), len);
-    return WTF::isAllSpecialCharacters<isSpecialCharacter, UChar>(characters(), len);
+    return WTF::isAllSpecialCharacters<isSpecialCharacter, UChar>(characters16(), len);
 }
 
 // StringHash is the default hash for String
index da3f236..cb17788 100644 (file)
@@ -1,5 +1,50 @@
 2014-01-25  Darin Adler  <darin@apple.com>
 
+        Call deprecatedCharacters instead of characters at more call sites
+        https://bugs.webkit.org/show_bug.cgi?id=127631
+
+        Reviewed by Sam Weinig.
+
+        * bindings/objc/WebScriptObject.mm:
+        (+[WebScriptObject _convertValueToObjcValue:JSC::originRootObject:rootObject:]):
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::containsOnlyWhitespace):
+        * editing/TypingCommand.cpp:
+        (WebCore::TypingCommand::insertText):
+        * editing/VisibleUnits.cpp:
+        (WebCore::startOfParagraph):
+        (WebCore::endOfParagraph):
+        * html/parser/HTMLParserIdioms.cpp:
+        (WebCore::stripLeadingAndTrailingHTMLSpaces):
+        (WebCore::parseHTMLNonNegativeInteger):
+        * inspector/InspectorStyleSheet.cpp:
+        (WebCore::InspectorStyle::newLineAndWhitespaceDelimiters):
+        * inspector/InspectorStyleTextEditor.cpp:
+        (WebCore::InspectorStyleTextEditor::insertProperty):
+        (WebCore::InspectorStyleTextEditor::internalReplaceProperty):
+        * platform/Length.cpp:
+        (WebCore::newCoordsArray):
+        * platform/LinkHash.cpp:
+        (WebCore::visitedLinkHash):
+        * platform/graphics/Color.cpp:
+        (WebCore::Color::parseHexColor):
+        (WebCore::Color::Color):
+        * platform/graphics/TextRun.h:
+        (WebCore::TextRun::TextRun):
+        * platform/text/TextEncodingRegistry.cpp:
+        (WebCore::atomicCanonicalTextEncodingName):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::constructTextRun):
+        * rendering/RenderCombineText.cpp:
+        (WebCore::RenderCombineText::width):
+        * svg/SVGFontElement.cpp:
+        (WebCore::SVGFontElement::registerLigaturesInGlyphCache):
+        * xml/XPathFunctions.cpp:
+        (WebCore::XPath::FunId::evaluate):
+        Use the new name.
+
+2014-01-25  Darin Adler  <darin@apple.com>
+
         Get rid of ICU_UNICODE and WCHAR_UNICODE remnants
         https://bugs.webkit.org/show_bug.cgi?id=127623
 
index 5b438f7..c45672e 100644 (file)
@@ -551,7 +551,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
     if (value.isString()) {
         ExecState* exec = rootObject->globalObject()->globalExec();
         const String& u = asString(value)->value(exec);
-        return [NSString stringWithCharacters:u.characters() length:u.length()];
+        return [NSString stringWithCharacters:u.deprecatedCharacters() length:u.length()];
     }
 
     if (value.isNumber())
index 069d4d6..e211dbb 100644 (file)
@@ -667,7 +667,7 @@ void CompositeEditCommand::setNodeAttribute(PassRefPtr<Element> element, const Q
 static inline bool containsOnlyWhitespace(const String& text)
 {
     for (unsigned i = 0; i < text.length(); ++i) {
-        if (!isWhitespace(text.characters()[i]))
+        if (!isWhitespace(text.deprecatedCharacters()[i]))
             return false;
     }
     
index 1006849..1f87687 100644 (file)
@@ -152,7 +152,7 @@ void TypingCommand::insertText(Document& document, const String& text, Options o
     ASSERT(frame);
 
     if (!text.isEmpty())
-        frame->editor().updateMarkersForWordsAffectedByEditing(isSpaceOrNewline(text.characters()[0]));
+        frame->editor().updateMarkersForWordsAffectedByEditing(isSpaceOrNewline(text.deprecatedCharacters()[0]));
     
     insertText(document, text, frame->selection().selection(), options, composition);
 }
index dd05d3e..b082b3d 100644 (file)
@@ -1146,7 +1146,7 @@ VisiblePosition startOfParagraph(const VisiblePosition& c, EditingBoundaryCrossi
             ASSERT_WITH_SECURITY_IMPLICATION(n->isTextNode());
             type = Position::PositionIsOffsetInAnchor;
             if (style.preserveNewline()) {
-                const UChar* chars = toRenderText(r)->characters();
+                const UChar* chars = toRenderText(r)->deprecatedCharacters();
                 int i = toRenderText(r)->textLength();
                 int o = offset;
                 if (n == startNode && o < i)
@@ -1229,7 +1229,7 @@ VisiblePosition endOfParagraph(const VisiblePosition &c, EditingBoundaryCrossing
             int length = toRenderText(r)->textLength();
             type = Position::PositionIsOffsetInAnchor;
             if (style.preserveNewline()) {
-                const UChar* chars = toRenderText(r)->characters();
+                const UChar* chars = toRenderText(r)->deprecatedCharacters();
                 int o = n == startNode ? offset : 0;
                 for (int i = o; i < length; ++i) {
                     if (chars[i] == '\n')
index 64bd1eb..43dd13c 100644 (file)
@@ -71,7 +71,7 @@ String stripLeadingAndTrailingHTMLSpaces(const String& string)
     if (string.is8Bit())
         return stripLeadingAndTrailingHTMLSpaces(string, string.characters8(), length);
 
-    return stripLeadingAndTrailingHTMLSpaces(string, string.characters(), length);
+    return stripLeadingAndTrailingHTMLSpaces(string, string.deprecatedCharacters(), length);
 }
 
 String serializeForNumberType(const Decimal& number)
@@ -272,7 +272,7 @@ bool parseHTMLNonNegativeInteger(const String& input, unsigned& value)
         return parseHTMLNonNegativeIntegerInternal(start, start + length, value);
     }
     
-    const UChar* start = input.characters();
+    const UChar* start = input.deprecatedCharacters();
     return parseHTMLNonNegativeIntegerInternal(start, start + length, value);
 }
 
index d739563..85cb2c4 100644 (file)
@@ -723,7 +723,7 @@ NewLineAndWhitespace& InspectorStyle::newLineAndWhitespaceDelimiters() const
     int propertyIndex = 0;
     bool isFullPrefixScanned = false;
     bool lineFeedTerminated = false;
-    const UChar* characters = text.characters();
+    const UChar* characters = text.deprecatedCharacters();
     while (propertyIndex < propertyCount) {
         const WebCore::CSSPropertySourceData& currentProperty = sourcePropertyData->at(propertyIndex++);
 
index f3099a8..c17c3de 100644 (file)
@@ -82,7 +82,7 @@ void InspectorStyleTextEditor::insertProperty(unsigned index, const String& prop
     if (insertLast && !insertFirstInSource) {
         propertyStart = styleBodyLength;
         if (propertyStart && textToSet.length()) {
-            const UChar* characters = m_styleText.characters();
+            const UChar* characters = m_styleText.deprecatedCharacters();
 
             long curPos = propertyStart - 1; // The last position of style declaration, since propertyStart points past one.
             while (curPos && isHTMLSpace(characters[curPos]))
@@ -230,7 +230,7 @@ void InspectorStyleTextEditor::internalReplaceProperty(const InspectorStylePrope
     const SourceRange& range = property.sourceData.range;
     long replaceRangeStart = range.start;
     long replaceRangeEnd = range.end;
-    const UChar* characters = m_styleText.characters();
+    const UChar* characters = m_styleText.deprecatedCharacters();
     long newTextLength = newText.length();
     String finalNewText = newText;
 
@@ -241,7 +241,7 @@ void InspectorStyleTextEditor::internalReplaceProperty(const InspectorStylePrope
         if (replaceRangeStart >= fullPrefixLength && m_styleText.substring(replaceRangeStart - fullPrefixLength, fullPrefixLength) == fullPrefix)
             replaceRangeStart -= fullPrefixLength;
     } else if (newTextLength) {
-        if (isHTMLLineBreak(newText.characters()[newTextLength - 1])) {
+        if (isHTMLLineBreak(newText.deprecatedCharacters()[newTextLength - 1])) {
             // Coalesce newlines of the original and new property values (to avoid a lot of blank lines while incrementally applying property values).
             bool foundNewline = false;
             bool isLastNewline = false;
index bd6cc2a..4e16d15 100644 (file)
@@ -88,7 +88,7 @@ static int countCharacter(const UChar* data, unsigned length, UChar character)
 std::unique_ptr<Length[]> newCoordsArray(const String& string, int& len)
 {
     unsigned length = string.length();
-    const UChar* data = string.characters();
+    const UChar* data = string.deprecatedCharacters();
     StringBuffer<UChar> spacified(length);
     for (unsigned i = 0; i < length; i++) {
         UChar cc = data[i];
index 2a42c85..5f24b20 100644 (file)
@@ -217,7 +217,7 @@ LinkHash visitedLinkHash(const String& url)
 
     if (length && url.is8Bit())
         return visitedLinkHashInline(url.characters8(), length);
-    return visitedLinkHashInline(url.characters(), length);
+    return visitedLinkHashInline(url.deprecatedCharacters(), length);
 }
 
 LinkHash visitedLinkHash(const UChar* url, unsigned length)
index 59d3759..7de24eb 100644 (file)
@@ -165,7 +165,7 @@ bool Color::parseHexColor(const String& name, RGBA32& rgb)
         return false;
     if (name.is8Bit())
         return parseHexColor(name.characters8(), name.length(), rgb);
-    return parseHexColor(name.characters(), name.length(), rgb);
+    return parseHexColor(name.deprecatedCharacters(), name.length(), rgb);
 }
 
 int differenceSquared(const Color& c1, const Color& c2)
@@ -182,7 +182,7 @@ Color::Color(const String& name)
         if (name.is8Bit())
             m_valid = parseHexColor(name.characters8() + 1, name.length() - 1, m_color);
         else
-            m_valid = parseHexColor(name.characters() + 1, name.length() - 1, m_color);
+            m_valid = parseHexColor(name.deprecatedCharacters() + 1, name.length() - 1, m_color);
     } else
         setNamedColor(name);
 }
index 565525f..213b263 100644 (file)
@@ -128,7 +128,7 @@ public:
             m_data.characters8 = s.characters8();
             m_is8Bit = true;
         } else {
-            m_data.characters16 = s.characters();
+            m_data.characters16 = s.deprecatedCharacters();
             m_is8Bit = false;
         }
 #else
index 6bdd8fa..d66f82b 100644 (file)
@@ -341,7 +341,7 @@ const char* atomicCanonicalTextEncodingName(const String& alias)
     if (alias.is8Bit())
         return atomicCanonicalTextEncodingName<LChar>(alias.characters8(), alias.length());
 
-    return atomicCanonicalTextEncodingName<UChar>(alias.characters(), alias.length());
+    return atomicCanonicalTextEncodingName<UChar>(alias.deprecatedCharacters(), alias.length());
 }
 
 bool noExtendedTextEncodingNameUsed()
index 0a9ba35..75a7fe3 100644 (file)
@@ -5448,7 +5448,7 @@ TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, c
 #if ENABLE(8BIT_TEXTRUN)
     if (length && string.is8Bit())
         return constructTextRunInternal(context, font, string.characters8(), length, style, expansion, flags);
-    return constructTextRunInternal(context, font, string.characters(), length, style, expansion, flags);
+    return constructTextRunInternal(context, font, string.deprecatedCharacters(), length, style, expansion, flags);
 #else
     return constructTextRunInternal(context, font, string.deprecatedCharacters(), length, style, expansion, flags);
 #endif
index 7b577b2..dd4fd31 100644 (file)
@@ -60,7 +60,7 @@ void RenderCombineText::setTextInternal(const String& text)
 
 float RenderCombineText::width(unsigned from, unsigned length, const Font& font, float xPosition, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
 {
-    if (!characters())
+    if (!deprecatedCharacters())
         return 0;
 
     if (m_isCombined)
index 8b96e49..c035523 100644 (file)
@@ -94,7 +94,7 @@ void SVGFontElement::registerLigaturesInGlyphCache(Vector<String>& ligatures)
         unsigned unicodeLength = unicode.length();
         ASSERT(unicodeLength > 1);
 
-        const UChar* characters = unicode.characters();
+        const UChar* characters = unicode.deprecatedCharacters();
         for (unsigned i = 0; i < unicodeLength; ++i) {
             String lookupString(characters + i, 1);
             m_glyphMap.collectGlyphsForString(lookupString, glyphs);
index 012199e..e6d9809 100644 (file)
@@ -340,7 +340,7 @@ Value FunId::evaluate() const
 
         // If there are several nodes with the same id, id() should return the first one.
         // In WebKit, getElementById behaves so, too, although its behavior in this case is formally undefined.
-        Node* node = contextScope.getElementById(String(idList.characters() + startPos, endPos - startPos));
+        Node* node = contextScope.getElementById(String(idList.deprecatedCharacters() + startPos, endPos - startPos));
         if (node && resultSet.add(node).isNewEntry)
             result.append(node);
         
index 2146152..f5751c6 100644 (file)
@@ -1,3 +1,18 @@
+2014-01-25  Darin Adler  <darin@apple.com>
+
+        Call deprecatedCharacters instead of characters at more call sites
+        https://bugs.webkit.org/show_bug.cgi?id=127631
+
+        Reviewed by Sam Weinig.
+
+        * TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
+        (TestWebKitAPI::expectBuilderContent):
+        (TestWebKitAPI::expectEmpty):
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WTF/StringImpl.cpp:
+        (TestWebKitAPI::TEST):
+        Use the new name.
+
 2014-01-25  Anders Carlsson  <andersca@apple.com>
 
         Modernize HashTable threading code
index d1b5b43..9ca5d6e 100644 (file)
@@ -38,14 +38,14 @@ static void expectBuilderContent(const String& expected, const StringBuilder& bu
 {
     // Not using builder.toString() or builder.toStringPreserveCapacity() because they all
     // change internal state of builder.
-    EXPECT_EQ(expected, String(builder.characters(), builder.length()));
+    EXPECT_EQ(expected, String(builder.deprecatedCharacters(), builder.length()));
 }
 
 void expectEmpty(const StringBuilder& builder)
 {
     EXPECT_EQ(0U, builder.length());
     EXPECT_TRUE(builder.isEmpty());
-    EXPECT_EQ(0, builder.characters());
+    EXPECT_EQ(0, builder.deprecatedCharacters());
 }
 
 TEST(StringBuilderTest, DefaultConstructor)
@@ -72,20 +72,20 @@ TEST(StringBuilderTest, Append)
     StringBuilder builder1;
     builder.append("", 0);
     expectBuilderContent("0123456789abcdefg#", builder);
-    builder1.append(builder.characters(), builder.length());
+    builder1.append(builder.deprecatedCharacters(), builder.length());
     builder1.append("XYZ");
-    builder.append(builder1.characters(), builder1.length());
+    builder.append(builder1.deprecatedCharacters(), builder1.length());
     expectBuilderContent("0123456789abcdefg#0123456789abcdefg#XYZ", builder);
 
     StringBuilder builder2;
     builder2.reserveCapacity(100);
     builder2.append("xyz");
-    const UChar* characters = builder2.characters();
+    const UChar* characters = builder2.deprecatedCharacters();
     builder2.append("0123456789");
-    ASSERT_EQ(characters, builder2.characters());
+    ASSERT_EQ(characters, builder2.deprecatedCharacters());
     builder2.toStringPreserveCapacity(); // Test after reifyString with buffer preserved.
     builder2.append("abcd");
-    ASSERT_EQ(characters, builder2.characters());
+    ASSERT_EQ(characters, builder2.deprecatedCharacters());
 
     // Test appending UChar32 characters to StringBuilder.
     StringBuilder builderForUChar32Append;
@@ -140,7 +140,7 @@ TEST(StringBuilderTest, ToStringPreserveCapacity)
     ASSERT_EQ(capacity, builder.capacity());
     ASSERT_EQ(String("0123456789"), string);
     ASSERT_EQ(string.impl(), builder.toStringPreserveCapacity().impl());
-    ASSERT_EQ(string.characters(), builder.characters());
+    ASSERT_EQ(string.deprecatedCharacters(), builder.deprecatedCharacters());
 
     // Changing the StringBuilder should not affect the original result of toStringPreserveCapacity().
     builder.append("abcdefghijklmnopqrstuvwxyz");
@@ -151,7 +151,7 @@ TEST(StringBuilderTest, ToStringPreserveCapacity)
     capacity = builder.capacity();
     string = builder.toStringPreserveCapacity();
     ASSERT_EQ(capacity, builder.capacity());
-    ASSERT_EQ(string.characters(), builder.characters());
+    ASSERT_EQ(string.deprecatedCharacters(), builder.deprecatedCharacters());
     ASSERT_EQ(String("0123456789abcdefghijklmnopqrstuvwxyz"), string);
     builder.append("ABC");
     ASSERT_EQ(String("0123456789abcdefghijklmnopqrstuvwxyz"), string);
@@ -160,7 +160,7 @@ TEST(StringBuilderTest, ToStringPreserveCapacity)
     capacity = builder.capacity();
     String string1 = builder.toStringPreserveCapacity();
     ASSERT_EQ(capacity, builder.capacity());
-    ASSERT_EQ(string1.characters(), builder.characters());
+    ASSERT_EQ(string1.deprecatedCharacters(), builder.deprecatedCharacters());
     ASSERT_EQ(String("0123456789abcdefghijklmnopqrstuvwxyzABC"), string1);
     string1.append("DEF");
     ASSERT_EQ(String("0123456789abcdefghijklmnopqrstuvwxyzABC"), builder.toStringPreserveCapacity());
@@ -170,7 +170,7 @@ TEST(StringBuilderTest, ToStringPreserveCapacity)
     capacity = builder.capacity();
     string1 = builder.toStringPreserveCapacity();
     ASSERT_EQ(capacity, builder.capacity());
-    ASSERT_EQ(string.characters(), builder.characters());
+    ASSERT_EQ(string.deprecatedCharacters(), builder.deprecatedCharacters());
     builder.resize(10);
     builder.append("###");
     ASSERT_EQ(String("0123456789abcdefghijklmnopqrstuvwxyzABC"), string1);
index 10ab9e2..d5804f6 100644 (file)
@@ -61,7 +61,7 @@ TEST(WTF, StringImplFromLiteralLoop16BitConversion)
     for (size_t i = 0; i < 10; ++i) {
         RefPtr<StringImpl> string = StringImpl::createFromLiteral("Template Literal");
 
-        ASSERT_EQ(0, memcmp(controlString->characters(), string->characters(), controlString->length() * sizeof(UChar)));
+        ASSERT_EQ(0, memcmp(controlString->deprecatedCharacters(), string->deprecatedCharacters(), controlString->length() * sizeof(UChar)));
         ASSERT_TRUE(string->has16BitShadow());
     }
 }