[webkit-changes] cvs commit: WebCore/khtml/xml dom_atomicstring.cpp

Maciej mjs at opensource.apple.com
Sun Jul 10 15:40:30 PDT 2005


mjs         05/07/10 15:40:29

  Modified:    .        ChangeLog
               khtml/html htmltokenizer.cpp
               khtml/xml dom_atomicstring.cpp
  Log:
          Reviewed by John.
  
          * khtml/html/htmltokenizer.cpp:
          (khtml::HTMLTokenizer::parseTag): Don't allow !doctype as a tag name, this screws up
  	parsing and makes !doctype elements and extra text nodes get added to the DOM.
          * khtml/xml/dom_atomicstring.cpp:
          (DOM::AtomicString::equal): Add some nil checks, now that the equal this calls
  	no longer checks for nil.
  
  Revision  Changes    Path
  1.4402    +11 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4401
  retrieving revision 1.4402
  diff -u -r1.4401 -r1.4402
  --- ChangeLog	10 Jul 2005 10:39:29 -0000	1.4401
  +++ ChangeLog	10 Jul 2005 22:40:25 -0000	1.4402
  @@ -1,3 +1,14 @@
  +2005-07-10  Maciej Stachowiak  <mjs at apple.com>
  +
  +        Reviewed by John.
  +
  +        * khtml/html/htmltokenizer.cpp:
  +        (khtml::HTMLTokenizer::parseTag): Don't allow !doctype as a tag name, this screws up
  +	parsing and makes !doctype elements and extra text nodes get added to the DOM.
  +        * khtml/xml/dom_atomicstring.cpp:
  +        (DOM::AtomicString::equal): Add some nil checks, now that the equal this calls
  +	no longer checks for nil.
  +
   2005-07-10  Eric Seidel  <eseidel at apple.com>
   
           Reviewed by mjs.
  
  
  
  1.97      +4 -2      WebCore/khtml/html/htmltokenizer.cpp
  
  Index: htmltokenizer.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/htmltokenizer.cpp,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- htmltokenizer.cpp	9 Jul 2005 20:19:11 -0000	1.96
  +++ htmltokenizer.cpp	10 Jul 2005 22:40:29 -0000	1.97
  @@ -1059,8 +1059,10 @@
                       ptr[--len] = '\0';
   
                   // Now that we've shaved off any invalid / that might have followed the name), make the tag.
  -                currToken.tagName = AtomicString(ptr);
  -                currToken.beginTag = beginTag;
  +                if (ptr[0] != '!' && strcmp(ptr, "!doctype") != 0) {
  +                    currToken.tagName = AtomicString(ptr);
  +                    currToken.beginTag = beginTag;
  +                }
                   dest = buffer;
                   tag = SearchAttribute;
                   cBufferPos = 0;
  
  
  
  1.11      +6 -1      WebCore/khtml/xml/dom_atomicstring.cpp
  
  Index: dom_atomicstring.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_atomicstring.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- dom_atomicstring.cpp	9 Jul 2005 20:19:21 -0000	1.10
  +++ dom_atomicstring.cpp	10 Jul 2005 22:40:29 -0000	1.11
  @@ -55,7 +55,12 @@
   
   bool AtomicString::equal(const AtomicString &a, const char *b)
   { 
  -    return DOM::equal(a.m_string.implementation(), b); 
  +    DOMStringImpl *impl = a.m_string.implementation();
  +    if ((!impl || !impl->s) && !b)
  +        return true;
  +    if ((!impl || !impl->s) || !b)
  +        return false;
  +    return DOM::equal(impl, b); 
   }
   
   inline DOMStringImpl *convert(const char* const& c, unsigned hash)
  
  
  



More information about the webkit-changes mailing list