Ignore:
Timestamp:
Oct 16, 2007, 1:13:24 PM (18 years ago)
Author:
darin
Message:

JavaScriptCore:

Reviewed by Maciej and Geoff (and looked over by Eric).

  • wtf/ASCIICType.h: Added.
  • wtf/DisallowCType.h: Added.
  • kjs/config.h: Include DisallowCType.h.
  • kjs/date_object.cpp: (KJS::skipSpacesAndComments): (KJS::findMonth): (KJS::parseDate):
  • kjs/function.cpp: (KJS::decode):
  • kjs/ustring.cpp: (KJS::UString::toDouble): Use ASCIICType.h functions instead of ctype.h ones.

WebCore:

Reviewed by Maciej and Geoff (and looked over by Eric).

  • ForwardingHeaders/wtf/ASCIICType.h: Added.
  • ForwardingHeaders/wtf/DisallowCType.h: Added.
  • WebCorePrefix.h: Get rid of inclusion of <ctype.h>.
  • config.h: Include DisallowCType.h.
  • css/CSSParser.cpp: (WebCore::ParseString::lower):
  • css/CSSPrimitiveValue.cpp: (WebCore::isCSSTokenizerIdentifier):
  • css/CSSStyleDeclaration.cpp: (WebCore::propertyID):
  • html/HTMLSelectElement.cpp: (WebCore::stripLeadingWhiteSpace):
  • html/HTMLTokenizer.cpp: (WebCore::tagMatch):
  • loader/FTPDirectoryParser.cpp: (WebCore::parseOneFTPLine):
  • loader/TextResourceDecoder.cpp: (WebCore::TextResourceDecoder::checkForHeadCharset):
  • platform/DeprecatedCString.cpp: (WebCore::DeprecatedCString::lower): (WebCore::DeprecatedCString::upper): (WebCore::DeprecatedCString::find): (WebCore::DeprecatedCString::contains):
  • platform/DeprecatedString.cpp: (WebCore::equalCaseInsensitive): (WebCore::isCharacterAllowedInBase): (WebCore::DeprecatedString::find): (WebCore::DeprecatedString::contains): (WebCore::toIntegralType):
  • platform/DeprecatedString.h: (WebCore::DeprecatedChar::isSpace): (WebCore::DeprecatedChar::lower): (WebCore::DeprecatedChar::upper):
  • platform/KURL.cpp: (WebCore::KURL::parse):
  • platform/StringImpl.cpp: (WebCore::isSpace): (WebCore::StringImpl::containsOnlyWhitespace): (WebCore::StringImpl::isLower): (WebCore::StringImpl::lower): (WebCore::StringImpl::find): (WebCore::StringImpl::reverseFind): (WebCore::equalIgnoringCase):
  • platform/TextEncodingRegistry.cpp: (WebCore::TextEncodingNameHash::equal): (WebCore::TextEncodingNameHash::hash): (WebCore::atomicCanonicalTextEncodingName):
  • platform/mac/KeyEventMac.mm: (WebCore::keyIdentifierForKeyEvent):
  • platform/win/KeyEventWin.cpp: (WebCore::keyIdentifierForWindowsKeyCode):
  • platform/win/PopupMenuWin.cpp: (WebCore::isASCIIPrintable): (WebCore::PopupWndProc):
  • plugins/win/PluginViewWin.cpp: (WebCore::capitalizeRFC822HeaderFieldName):
  • rendering/RenderText.cpp: (WebCore::RenderText::widthFromCache): Use ASCIICType.h functions instead of ctype.h ones.

WebKit:

Reviewed by Maciej and Geoff (and looked over by Eric).

  • ForwardingHeaders/wtf/ASCIICType.h: Added.
  • ForwardingHeaders/wtf/DisallowCType.h: Added.
  • WebKitPrefix.h: Include DisallowCType.h.
  • Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Use toASCIILower.
  • WebView/WebHTMLView.mm: (-[WebHTMLView callWebCoreCommand:]): Use toASCIIUpper. (-[WebTextCompleteController filterKeyDown:]): Add a list of specific character codes, instead of using ispunct.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/function.cpp

    r26619 r26676  
    11// -*- c-basic-offset: 2 -*-
    22/*
    3  *  This file is part of the KDE libraries
    43 *  Copyright (C) 1999-2002 Harri Porten ([email protected])
    54 *  Copyright (C) 2001 Peter Kelly ([email protected])
    6  *  Copyright (C) 2003 Apple Computer, Inc.
     5 *  Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
    76 *  Copyright (C) 2007 Cameron Zwarich ([email protected])
    87 *
     
    4140#include <assert.h>
    4241#include <string.h>
    43 #include <ctype.h>
    44 
     42
     43#include <wtf/ASCIICType.h>
    4544#include <wtf/unicode/Unicode.h>
    4645
     
    583582    if (c == '%') {
    584583      int charLen = 0;
    585       if (k <= len - 3 && isxdigit(p[1].uc) && isxdigit(p[2].uc)) {
     584      if (k <= len - 3 && isASCIIHexDigit(p[1].uc) && isASCIIHexDigit(p[2].uc)) {
    586585        const char b0 = Lexer::convertHex(p[1].uc, p[2].uc);
    587586        const int sequenceLen = UTF8SequenceLength(b0);
     
    592591          for (int i = 1; i < sequenceLen; ++i) {
    593592            const UChar* q = p + i * 3;
    594             if (q[0] == '%' && isxdigit(q[1].uc) && isxdigit(q[2].uc))
     593            if (q[0] == '%' && isASCIIHexDigit(q[1].uc) && isASCIIHexDigit(q[2].uc))
    595594              sequence[i] = Lexer::convertHex(q[1].uc, q[2].uc);
    596595            else {
     
    620619        // For that, it's good to support the wonky "%u" syntax for compatibility with WinIE.
    621620        if (k <= len - 6 && p[1] == 'u'
    622             && isxdigit(p[2].uc) && isxdigit(p[3].uc)
    623             && isxdigit(p[4].uc) && isxdigit(p[5].uc)) {
     621            && isASCIIHexDigit(p[2].uc) && isASCIIHexDigit(p[3].uc)
     622            && isASCIIHexDigit(p[4].uc) && isASCIIHexDigit(p[5].uc)) {
    624623          charLen = 6;
    625624          u = Lexer::convertUnicode(p[2].uc, p[3].uc, p[4].uc, p[5].uc);
Note: See TracChangeset for help on using the changeset viewer.