[webkit-changes] cvs commit: WebCore/khtml/html htmltokenizer.cpp

Darin darin at opensource.apple.com
Sun Sep 11 20:40:39 PDT 2005


darin       05/09/11 20:40:38

  Modified:    .        ChangeLog
               kwq      KWQString.h
               khtml/xml dom_stringimpl.cpp dom_elementimpl.cpp
               khtml/css cssstyleselector.cpp
               khtml/dom dom_string.cpp
               khtml/html htmltokenizer.cpp
  Log:
          Reviewed by Eric.
  
          - changed back the name of a couple of string() functions that were renamed to qstring() by accident
  
          * kwq/KWQString.h: (QConstString::string): Changed function name back to string() from qstring().
          This is a function from Qt, so the name needs to match Qt -- that's just how KWQ works.
  
          * khtml/xml/dom_atomicstringlist.h: Changed the name of the function that returns the current
          AtomicString to string() back from qstring()!
  
          * khtml/css/cssstyleselector.cpp:
          (khtml::CSSStyleSelector::matchRules): Use string() instead of qstring().
          (khtml::checkPseudoState): Ditto.
          (khtml::CSSStyleSelector::checkOneSelector): Ditto.
          * khtml/dom/dom_string.cpp: (DOM::DOMString::percentage): Ditto.
          * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::finish): Ditto.
          * khtml/xml/dom_stringimpl.cpp:
          (DOM::DOMStringImpl::DOMStringImpl): Small tweak to streamline a tiny bit by using an already-computed
          boolean instead of re-checking a couple of data members.
          (DOM::parseLength): Use string() instead of qstring().
          (DOM::DOMStringImpl::toInt): Ditto.
  
          - removed some dead code
  
          * khtml/xml/dom_elementimpl.cpp: Removed XMLElementImpl.
  
  Revision  Changes    Path
  1.115     +28 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- ChangeLog	10 Sep 2005 21:33:16 -0000	1.114
  +++ ChangeLog	12 Sep 2005 03:40:36 -0000	1.115
  @@ -1,3 +1,31 @@
  +2005-09-11  Darin Adler  <darin at apple.com>
  +
  +        Reviewed by Eric.
  +
  +        - changed back the name of a couple of string() functions that were renamed to qstring() by accident
  +
  +        * kwq/KWQString.h: (QConstString::string): Changed function name back to string() from qstring().
  +        This is a function from Qt, so the name needs to match Qt -- that's just how KWQ works.
  +
  +        * khtml/xml/dom_atomicstringlist.h: Changed the name of the function that returns the current
  +        AtomicString to string() back from qstring()!
  +
  +        * khtml/css/cssstyleselector.cpp:
  +        (khtml::CSSStyleSelector::matchRules): Use string() instead of qstring().
  +        (khtml::checkPseudoState): Ditto.
  +        (khtml::CSSStyleSelector::checkOneSelector): Ditto.
  +        * khtml/dom/dom_string.cpp: (DOM::DOMString::percentage): Ditto.
  +        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::finish): Ditto.
  +        * khtml/xml/dom_stringimpl.cpp:
  +        (DOM::DOMStringImpl::DOMStringImpl): Small tweak to streamline a tiny bit by using an already-computed
  +        boolean instead of re-checking a couple of data members.
  +        (DOM::parseLength): Use string() instead of qstring().
  +        (DOM::DOMStringImpl::toInt): Ditto.
  +
  +        - removed some dead code
  +
  +        * khtml/xml/dom_elementimpl.cpp: Removed XMLElementImpl.
  +
   2005-09-10  Alexey Proskuryakov  <ap at nypop.com>
   
           Reviewed and landed by Darin.
  
  
  
  1.116     +1 -1      WebCore/kwq/KWQString.h
  
  Index: KWQString.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQString.h,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- KWQString.h	25 Aug 2005 17:47:26 -0000	1.115
  +++ KWQString.h	12 Sep 2005 03:40:36 -0000	1.116
  @@ -752,7 +752,7 @@
   public:
       QConstString(const QChar *, uint);
       ~QConstString();
  -    const QString &qstring() const { return *this; }
  +    const QString &string() const { return *this; }
   };
   
   #endif
  
  
  
  1.31      +6 -5      WebCore/khtml/xml/dom_stringimpl.cpp
  
  Index: dom_stringimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_stringimpl.cpp,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- dom_stringimpl.cpp	25 Aug 2005 17:47:21 -0000	1.30
  +++ dom_stringimpl.cpp	12 Sep 2005 03:40:37 -0000	1.31
  @@ -43,12 +43,13 @@
       return &e;
   }
   
  -DOMStringImpl::DOMStringImpl(const QChar *str, unsigned int len) {
  +DOMStringImpl::DOMStringImpl(const QChar *str, unsigned len)
  +{
       _hash = 0;
       _inTable = false;
       bool havestr = str && len;
  -    s = QT_ALLOC_QCHAR_VEC( havestr ? len : 1 );
  -    if(str && len) {
  +    s = QT_ALLOC_QCHAR_VEC(havestr ? len : 1);
  +    if (havestr) {
           memcpy( s, str, len * sizeof(QChar) );
           l = len;
       } else {
  @@ -235,7 +236,7 @@
           ++i;
   
       bool ok;
  -    int r = QConstString(s, i).qstring().toInt(&ok);
  +    int r = QConstString(s, i).string().toInt(&ok);
   
       /* Skip over any remaining digits, we are not that accurate (5.5% => 5%) */
       while (i < l && (s[i].isDigit() || s[i] == '.'))
  @@ -424,7 +425,7 @@
           }
       }
       
  -    return QConstString(s, i).qstring().toInt(ok);
  +    return QConstString(s, i).string().toInt(ok);
   }
   
   DOMStringImpl *DOMStringImpl::replace(QChar oldC, QChar newC)
  
  
  
  1.81      +0 -37     WebCore/khtml/xml/dom_elementimpl.cpp
  
  Index: dom_elementimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_elementimpl.cpp,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- dom_elementimpl.cpp	8 Sep 2005 22:54:35 -0000	1.80
  +++ dom_elementimpl.cpp	12 Sep 2005 03:40:37 -0000	1.81
  @@ -810,43 +810,6 @@
   
   // -------------------------------------------------------------------------
   
  -/*
  -XMLElementImpl::XMLElementImpl(DocumentPtr *doc, DOMStringImpl *_qualifiedName, DOMStringImpl *_namespaceURI)
  -    : ElementImpl(doc)
  -{
  -    int colonpos = -1;
  -    for (uint i = 0; i < _qualifiedName->l; ++i)
  -        if (_qualifiedName->s[i] == ':') {
  -            colonpos = i;
  -            break;
  -        }
  -
  -    if (colonpos >= 0) {
  -        // we have a prefix
  -        DOMStringImpl* localName = _qualifiedName->copy();
  -        localName->ref();
  -        localName->remove(0,colonpos+1);
  -        m_id = doc->document()->tagId(_namespaceURI, localName, false);
  -        localName->deref();
  -        
  -        // FIXME: This is a temporary situation for stage one of the QualifiedName patch.  This is also a really stupid way to
  -        // have to handle the prefix.  Way too much copying.  We should make sure the XML tokenizer has done the split
  -        // already into prefix and localName.
  -        DOMStringImpl* prefix = _qualifiedName->copy();
  -        prefix->ref();
  -        prefix->truncate(colonpos);
  -        m_tagName = QualifiedName(prefix, nullAtom, nullAtom);
  -        prefix->deref();
  -    }
  -    else
  -        // no prefix
  -        m_id = doc->document()->tagId(_namespaceURI, _qualifiedName, false);
  -}
  -
  -*/
  -
  -// -------------------------------------------------------------------------
  -
   NamedAttrMapImpl::NamedAttrMapImpl(ElementImpl *e)
       : element(e)
       , attrs(0)
  
  
  
  1.204     +6 -10     WebCore/khtml/css/cssstyleselector.cpp
  
  Index: cssstyleselector.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/cssstyleselector.cpp,v
  retrieving revision 1.203
  retrieving revision 1.204
  diff -u -r1.203 -r1.204
  --- cssstyleselector.cpp	30 Aug 2005 21:36:23 -0000	1.203
  +++ cssstyleselector.cpp	12 Sep 2005 03:40:37 -0000	1.204
  @@ -332,14 +332,10 @@
       // We need to collect the rules for id, class, tag, and everything else into a buffer and
       // then sort the buffer.
       if (element->hasID())
  -        matchRulesForList(rules->getIDRules(element->getIDAttribute().impl()),
  -                          firstRuleIndex, lastRuleIndex);
  -    if (element->hasClass()) {
  -        for (const AtomicStringList* singleClass = element->getClassList();
  -             singleClass; singleClass = singleClass->next())
  -            matchRulesForList(rules->getClassRules(singleClass->qstring().impl()),
  -                                                   firstRuleIndex, lastRuleIndex);
  -    }
  +        matchRulesForList(rules->getIDRules(element->getIDAttribute().impl()), firstRuleIndex, lastRuleIndex);
  +    if (element->hasClass())
  +        for (const AtomicStringList* singleClass = element->getClassList(); singleClass; singleClass = singleClass->next())
  +            matchRulesForList(rules->getClassRules(singleClass->string().impl()), firstRuleIndex, lastRuleIndex);
       matchRulesForList(rules->getTagRules(element->localName().impl()),
                         firstRuleIndex, lastRuleIndex);
       matchRulesForList(rules->getUniversalRules(), firstRuleIndex, lastRuleIndex);
  @@ -555,7 +551,7 @@
       }
       
       QConstString cu(attr.unicode(), attr.length());
  -    QString u = cu.qstring();
  +    QString u = cu.string();
       if ( !u.contains("://") ) {
           if ( u[0] == '/' )
               u.prepend(currentEncodedURL->host);
  @@ -1116,7 +1112,7 @@
               if (!e->hasClass())
                   return false;
               for (const AtomicStringList* c = e->getClassList(); c; c = c->next())
  -                if (c->qstring() == sel->value)
  +                if (c->string() == sel->value)
                       return true;
               return false;
           }
  
  
  
  1.21      +1 -1      WebCore/khtml/dom/dom_string.cpp
  
  Index: dom_string.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/dom/dom_string.cpp,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- dom_string.cpp	29 Aug 2005 21:29:11 -0000	1.20
  +++ dom_string.cpp	12 Sep 2005 03:40:38 -0000	1.21
  @@ -204,7 +204,7 @@
       if ( *(m_impl->s+m_impl->l-1) != QChar('%'))
          return false;
   
  -    _percentage = QConstString(m_impl->s, m_impl->l-1).qstring().toInt();
  +    _percentage = QConstString(m_impl->s, m_impl->l-1).string().toInt();
       return true;
   }
   
  
  
  
  1.111     +1 -1      WebCore/khtml/html/htmltokenizer.cpp
  
  Index: htmltokenizer.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/htmltokenizer.cpp,v
  retrieving revision 1.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- htmltokenizer.cpp	10 Sep 2005 21:33:18 -0000	1.110
  +++ htmltokenizer.cpp	12 Sep 2005 03:40:38 -0000	1.111
  @@ -1804,7 +1804,7 @@
               food += QString(scriptCode, scriptCodeSize);
           }
           else {
  -            pos = QConstString(scriptCode, scriptCodeSize).qstring().find('>');
  +            pos = QConstString(scriptCode, scriptCodeSize).string().find('>');
               food.setUnicode(scriptCode+pos+1, scriptCodeSize-pos-1); // deep copy
           }
           KHTML_DELETE_QCHAR_VEC(scriptCode);
  
  
  



More information about the webkit-changes mailing list