[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:15:14 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit baa79d0b56eb62e0cf9492ab5df9e677fd9c7dac
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 16 01:51:51 2002 +0000

    	Fix for 3109226, epinions page is mostly blank.  Add a hack
    	to disallow > but only inside attribute values for which there
    	is no corresponding attribute name.
    
    	Also fix attribute values with no name so that the value is
    	used as the name so that e.g., <option "selected"> works.
    
            Reviewed by darin
    
            * khtml/html/htmltokenizer.cpp:
            (HTMLTokenizer::HTMLTokenizer):
            * khtml/html/htmltokenizer.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3068 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 59170e2..0bf5e54 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,18 @@
+2002-12-15  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3109226, epinions page is mostly blank.  Add a hack
+	to disallow > but only inside attribute values for which there
+	is no corresponding attribute name.
+
+	Also fix attribute values with no name so that the value is
+	used as the name so that e.g., <option "selected"> works.
+	
+        Reviewed by darin
+
+        * khtml/html/htmltokenizer.cpp:
+        (HTMLTokenizer::HTMLTokenizer):
+        * khtml/html/htmltokenizer.h:
+
 2002-12-15  Darin Adler  <darin at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 59170e2..0bf5e54 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,18 @@
+2002-12-15  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3109226, epinions page is mostly blank.  Add a hack
+	to disallow > but only inside attribute values for which there
+	is no corresponding attribute name.
+
+	Also fix attribute values with no name so that the value is
+	used as the name so that e.g., <option "selected"> works.
+	
+        Reviewed by darin
+
+        * khtml/html/htmltokenizer.cpp:
+        (HTMLTokenizer::HTMLTokenizer):
+        * khtml/html/htmltokenizer.h:
+
 2002-12-15  Darin Adler  <darin at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/khtml/html/htmltokenizer.cpp b/WebCore/khtml/html/htmltokenizer.cpp
index fbc1540..5255f01 100644
--- a/WebCore/khtml/html/htmltokenizer.cpp
+++ b/WebCore/khtml/html/htmltokenizer.cpp
@@ -225,7 +225,8 @@ HTMLTokenizer::HTMLTokenizer(DOM::DocumentPtr *_doc, KHTMLView *_view)
     m_executingScript = 0;
     loadingExtScript = false;
     onHold = false;
-
+    attrNamePresent = false;
+    
     reset();
 }
 
@@ -963,6 +964,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                         tag = SearchValue;
                         *dest++ = 0;
                         attrName = QString::null;
+                        attrNamePresent = false;
                     }
                     else
                         tag = AttributeName;
@@ -990,9 +992,13 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                         unsigned int a;
                         cBuffer[cBufferPos] = '\0';
                         a = khtml::getAttrID(cBuffer, cBufferPos);
-                        if ( !a )
+                        if (a)
+                            attrNamePresent = true;
+                        else {
                             attrName = QString::fromLatin1(QCString(cBuffer, cBufferPos+1).data());
-
+                            attrNamePresent = !attrName.isEmpty();
+                        }
+                        
                         dest = buffer;
                         *dest++ = a;
 #ifdef TOKEN_DEBUG
@@ -1012,6 +1018,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
             if ( cBufferPos == CBUFLEN ) {
                 cBuffer[cBufferPos] = '\0';
                 attrName = QString::fromLatin1(QCString(cBuffer, cBufferPos+1).data());
+                attrNamePresent = !attrName.isEmpty();
                 dest = buffer;
                 *dest++ = 0;
                 tag = SearchEqual;
@@ -1040,6 +1047,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                         tag = SearchValue;
                         *dest++ = 0;
                         attrName = QString::null;
+                        attrNamePresent = false;
                     }
                     else {
                         DOMString v("");
@@ -1083,6 +1091,25 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                 checkBuffer();
 
                 curchar = src->unicode();
+                if (curchar == '>' && !attrNamePresent) {
+                    // Handle a case like <img '>.  Just go ahead and be willing
+                    // to close the whole tag.  Don't consume the character and
+                    // just go back into SearchEnd while ignoring the whole
+                    // value.
+                    // FIXME: Note that this is actually not a very good solution. It's
+                    // an interim hack and doesn't handle the general case of
+                    // unmatched quotes among attributes that have names. -dwh
+                    while(dest > buffer+1 && (*(dest-1) == '\n' || *(dest-1) == '\r'))
+                        dest--; // remove trailing newlines
+                    DOMString v(buffer+1, dest-buffer-1);
+                    attrName.setUnicode(buffer+1,dest-buffer-1); 
+                    currToken.addAttribute(parser->docPtr()->document(), buffer, attrName, v);
+                    tag = SearchAttribute;
+                    dest = buffer;
+                    tquote = NoQuote;
+                    break;
+                }
+                
                 if(curchar <= '\'' && !src.escaped()) {
                     // ### attributes like '&{blaa....};' are supposed to be treated as jscript.
                     if ( curchar == '&' )
@@ -1098,6 +1125,8 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                         while(dest > buffer+1 && (*(dest-1) == '\n' || *(dest-1) == '\r'))
                             dest--; // remove trailing newlines
                         DOMString v(buffer+1, dest-buffer-1);
+                        if (!attrNamePresent)
+                            attrName.setUnicode(buffer+1,dest-buffer-1); 
                         currToken.addAttribute(parser->docPtr()->document(), buffer, attrName, v);
 
                         dest = buffer;
diff --git a/WebCore/khtml/html/htmltokenizer.h b/WebCore/khtml/html/htmltokenizer.h
index ebf2b44..3da6254 100644
--- a/WebCore/khtml/html/htmltokenizer.h
+++ b/WebCore/khtml/html/htmltokenizer.h
@@ -289,7 +289,10 @@ protected:
 
     // name of an unknown attribute
     QString attrName;
-
+    // whether or not the attrname is present (either we found a known HTML attr or we found an unknown
+    // nonempty attrName).
+    bool attrNamePresent;
+    
     // Used to store the code of a srcipting sequence
     QChar *scriptCode;
     // Size of the script sequenze stored in @ref #scriptCode

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list