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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:50:57 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b4a340c6dbeee965b468dfecb06206b831cd87a8
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 18 00:18:28 2002 +0000

    	- fixed 2807340 -- Alex is case sensitive for anchors, but
    	should not be in quirks mode (other browsers aren't)
    
            * khtml/dom/html_misc.cpp: Touched this file to prevent us from requiring a
    	full build. Damned header dependencies still don't work right.
    
            * khtml/html/html_miscimpl.h: Add caseSensitive parameters.
            * khtml/html/html_miscimpl.cpp:
            (HTMLCollectionImpl::getNamedItem): Add caseSensitive parameter, and compare
    	by converting both to lower case if it's false and pass it on when recursing.
            (HTMLCollectionImpl::namedItem): Pass along a caseSensitive parameter.
            (HTMLFormCollectionImpl::getNamedItem): Pass along a caseSensitive parameter.
            (HTMLFormCollectionImpl::getNamedFormItem): Pass along, and handle, it.
            (HTMLFormCollectionImpl::getNamedImgItem): Ditto.
            (HTMLFormCollectionImpl::nextNamedItemInternal): Pass true for caseSensitive.
    
            * khtml/khtml_part.cpp: (KHTMLPart::gotoAnchor):
    	Pass false for the new caseSensitive parameter to namedItem when the document
    	mode is not strict.
    
            * kwq/KWQListBox.mm: (QListBox::sizeForNumberOfLines): Removed a stray NSLog
    	that I left in by accident.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2362 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index b4d27bd..1f5dd48 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,30 @@
 2002-10-17  Darin Adler  <darin at apple.com>
 
+	- fixed 2807340 -- Alex is case sensitive for anchors, but
+	should not be in quirks mode (other browsers aren't)
+
+        * khtml/dom/html_misc.cpp: Touched this file to prevent us from requiring a
+	full build. Damned header dependencies still don't work right.
+
+        * khtml/html/html_miscimpl.h: Add caseSensitive parameters.
+        * khtml/html/html_miscimpl.cpp:
+        (HTMLCollectionImpl::getNamedItem): Add caseSensitive parameter, and compare
+	by converting both to lower case if it's false and pass it on when recursing.
+        (HTMLCollectionImpl::namedItem): Pass along a caseSensitive parameter.
+        (HTMLFormCollectionImpl::getNamedItem): Pass along a caseSensitive parameter.
+        (HTMLFormCollectionImpl::getNamedFormItem): Pass along, and handle, it.
+        (HTMLFormCollectionImpl::getNamedImgItem): Ditto.
+        (HTMLFormCollectionImpl::nextNamedItemInternal): Pass true for caseSensitive.
+
+        * khtml/khtml_part.cpp: (KHTMLPart::gotoAnchor):
+	Pass false for the new caseSensitive parameter to namedItem when the document
+	mode is not strict.
+
+        * kwq/KWQListBox.mm: (QListBox::sizeForNumberOfLines): Removed a stray NSLog
+	that I left in by accident.
+
+2002-10-17  Darin Adler  <darin at apple.com>
+
 	- fixed 3052547 -- <select> doesn't size properly (size > 1)
 
         * khtml/rendering/render_form.cpp:
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index b4d27bd..1f5dd48 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,30 @@
 2002-10-17  Darin Adler  <darin at apple.com>
 
+	- fixed 2807340 -- Alex is case sensitive for anchors, but
+	should not be in quirks mode (other browsers aren't)
+
+        * khtml/dom/html_misc.cpp: Touched this file to prevent us from requiring a
+	full build. Damned header dependencies still don't work right.
+
+        * khtml/html/html_miscimpl.h: Add caseSensitive parameters.
+        * khtml/html/html_miscimpl.cpp:
+        (HTMLCollectionImpl::getNamedItem): Add caseSensitive parameter, and compare
+	by converting both to lower case if it's false and pass it on when recursing.
+        (HTMLCollectionImpl::namedItem): Pass along a caseSensitive parameter.
+        (HTMLFormCollectionImpl::getNamedItem): Pass along a caseSensitive parameter.
+        (HTMLFormCollectionImpl::getNamedFormItem): Pass along, and handle, it.
+        (HTMLFormCollectionImpl::getNamedImgItem): Ditto.
+        (HTMLFormCollectionImpl::nextNamedItemInternal): Pass true for caseSensitive.
+
+        * khtml/khtml_part.cpp: (KHTMLPart::gotoAnchor):
+	Pass false for the new caseSensitive parameter to namedItem when the document
+	mode is not strict.
+
+        * kwq/KWQListBox.mm: (QListBox::sizeForNumberOfLines): Removed a stray NSLog
+	that I left in by accident.
+
+2002-10-17  Darin Adler  <darin at apple.com>
+
 	- fixed 3052547 -- <select> doesn't size properly (size > 1)
 
         * khtml/rendering/render_form.cpp:
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index b4d27bd..1f5dd48 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,30 @@
 2002-10-17  Darin Adler  <darin at apple.com>
 
+	- fixed 2807340 -- Alex is case sensitive for anchors, but
+	should not be in quirks mode (other browsers aren't)
+
+        * khtml/dom/html_misc.cpp: Touched this file to prevent us from requiring a
+	full build. Damned header dependencies still don't work right.
+
+        * khtml/html/html_miscimpl.h: Add caseSensitive parameters.
+        * khtml/html/html_miscimpl.cpp:
+        (HTMLCollectionImpl::getNamedItem): Add caseSensitive parameter, and compare
+	by converting both to lower case if it's false and pass it on when recursing.
+        (HTMLCollectionImpl::namedItem): Pass along a caseSensitive parameter.
+        (HTMLFormCollectionImpl::getNamedItem): Pass along a caseSensitive parameter.
+        (HTMLFormCollectionImpl::getNamedFormItem): Pass along, and handle, it.
+        (HTMLFormCollectionImpl::getNamedImgItem): Ditto.
+        (HTMLFormCollectionImpl::nextNamedItemInternal): Pass true for caseSensitive.
+
+        * khtml/khtml_part.cpp: (KHTMLPart::gotoAnchor):
+	Pass false for the new caseSensitive parameter to namedItem when the document
+	mode is not strict.
+
+        * kwq/KWQListBox.mm: (QListBox::sizeForNumberOfLines): Removed a stray NSLog
+	that I left in by accident.
+
+2002-10-17  Darin Adler  <darin at apple.com>
+
 	- fixed 3052547 -- <select> doesn't size properly (size > 1)
 
         * khtml/rendering/render_form.cpp:
diff --git a/WebCore/khtml/dom/html_misc.cpp b/WebCore/khtml/dom/html_misc.cpp
index 1e67647..d2651cb 100644
--- a/WebCore/khtml/dom/html_misc.cpp
+++ b/WebCore/khtml/dom/html_misc.cpp
@@ -188,4 +188,3 @@ HTMLFormCollection::HTMLFormCollection(NodeImpl *base)
     impl = new HTMLFormCollectionImpl(base);
     impl->ref();
 }
-
diff --git a/WebCore/khtml/html/html_miscimpl.cpp b/WebCore/khtml/html/html_miscimpl.cpp
index 44a381b..5a7b776 100644
--- a/WebCore/khtml/html/html_miscimpl.cpp
+++ b/WebCore/khtml/html/html_miscimpl.cpp
@@ -271,7 +271,7 @@ NodeImpl *HTMLCollectionImpl::nextItem() const
 }
 
 NodeImpl *HTMLCollectionImpl::getNamedItem( NodeImpl *current, int attr_id,
-                                            const DOMString &name ) const
+                                            const DOMString &name, bool caseSensitive ) const
 {
     if(name.isEmpty())
         return 0;
@@ -347,14 +347,20 @@ NodeImpl *HTMLCollectionImpl::getNamedItem( NodeImpl *current, int attr_id,
                 kdDebug( 6030 ) << "Error in HTMLCollection, wrong tagId!" << endl;
                 break;
             }
-            if(check && e->getAttribute(attr_id) == name)
-            {
-                //kdDebug( 6030 ) << "found node: " << e << " " << current << " " << e->id() << " " << e->tagName().string() << endl;
-                return current;
+            if (check) {
+                bool found;
+                if (caseSensitive)
+                    found = e->getAttribute(attr_id) == name;
+                else
+                    found = e->getAttribute(attr_id).lower() == name.lower();
+                if (found) {
+                    //kdDebug( 6030 ) << "found node: " << e << " " << current << " " << e->id() << " " << e->tagName().string() << endl;
+                    return current;
+                }
             }
             NodeImpl *retval = 0;
             if(deep && current->firstChild())
-                retval = getNamedItem(current->firstChild(), attr_id, name);
+                retval = getNamedItem(current->firstChild(), attr_id, name, caseSensitive);
             if(retval)
             {
                 //kdDebug( 6030 ) << "got a return value " << retval << endl;
@@ -366,7 +372,7 @@ NodeImpl *HTMLCollectionImpl::getNamedItem( NodeImpl *current, int attr_id,
     return 0;
 }
 
-NodeImpl *HTMLCollectionImpl::namedItem( const DOMString &name ) const
+NodeImpl *HTMLCollectionImpl::namedItem( const DOMString &name, bool caseSensitive ) const
 {
     // http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/nameditem.asp
     // This method first searches for an object with a matching id
@@ -374,11 +380,11 @@ NodeImpl *HTMLCollectionImpl::namedItem( const DOMString &name ) const
     // object with a matching name attribute, but only on those elements
     // that are allowed a name attribute.
     idsDone = false;
-    currentItem = getNamedItem(base->firstChild(), ATTR_ID, name);
+    currentItem = getNamedItem(base->firstChild(), ATTR_ID, name, caseSensitive);
     if(currentItem)
         return currentItem;
     idsDone = true;
-    currentItem = getNamedItem(base->firstChild(), ATTR_NAME, name);
+    currentItem = getNamedItem(base->firstChild(), ATTR_NAME, name, caseSensitive);
     return currentItem;
 }
 
@@ -483,38 +489,43 @@ NodeImpl* HTMLFormCollectionImpl::getItem(NodeImpl *, int index, int&) const
     return 0;
 }
 
-NodeImpl* HTMLFormCollectionImpl::getNamedItem(NodeImpl*, int attr_id, const DOMString& name) const
+NodeImpl* HTMLFormCollectionImpl::getNamedItem(NodeImpl*, int attr_id, const DOMString& name, bool caseSensitive) const
 {
     currentPos = 0;
-    return getNamedFormItem( attr_id, name, 0 );
+    return getNamedFormItem( attr_id, name, 0, caseSensitive );
 }
 
-NodeImpl* HTMLFormCollectionImpl::getNamedFormItem(int attr_id, const DOMString& name, int duplicateNumber) const
+NodeImpl* HTMLFormCollectionImpl::getNamedFormItem(int attr_id, const DOMString& name, int duplicateNumber, bool caseSensitive) const
 {
     if(base->nodeType() == Node::ELEMENT_NODE)
     {
         HTMLElementImpl* e = static_cast<HTMLElementImpl*>(base);
         if(e->id() == ID_FORM)
         {
-            HTMLGenericFormElementImpl* element;
             HTMLFormElementImpl* f = static_cast<HTMLFormElementImpl*>(e);
 
-            for(element = f->formElements.first(); element; element = f->formElements.next())
-                if(element->isEnumeratable() && element->getAttribute(attr_id) == name)
-                {
-                    if (!duplicateNumber)
-                        return element;
-                    --duplicateNumber;
+            for(HTMLGenericFormElementImpl* e = f->formElements.first(); e; e = f->formElements.next())
+                if(e->isEnumeratable()) {
+                    bool found;
+                    if (caseSensitive)
+                        found = e->getAttribute(attr_id) == name;
+                    else
+                        found = e->getAttribute(attr_id).lower() == name.lower();
+                    if (found) {
+                        if (!duplicateNumber)
+                            return e;
+                        --duplicateNumber;
+                    }
                 }
         }
-        NodeImpl* retval = getNamedImgItem( base->firstChild(), attr_id, name, duplicateNumber );
+        NodeImpl* retval = getNamedImgItem( base->firstChild(), attr_id, name, duplicateNumber, caseSensitive );
         if ( retval )
             return retval;
     }
     return 0;
 }
 
-NodeImpl* HTMLFormCollectionImpl::getNamedImgItem(NodeImpl* current, int attr_id, const DOMString& name, int& duplicateNumber) const
+NodeImpl* HTMLFormCollectionImpl::getNamedImgItem(NodeImpl* current, int attr_id, const DOMString& name, int& duplicateNumber, bool caseSensitive) const
 {
     // strange case. IE and NS allow to get hold of <img> tags,
     // but they don't include them in the elements() collection.
@@ -522,17 +533,24 @@ NodeImpl* HTMLFormCollectionImpl::getNamedImgItem(NodeImpl* current, int attr_id
     {
         if(current->nodeType() == Node::ELEMENT_NODE)
         {
-            HTMLElementImpl *currelem = static_cast<HTMLElementImpl *>(current);
-            if(currelem->id() == ID_IMG && currelem->getAttribute(attr_id) == name)
-            {
-                if (!duplicateNumber)
-                    return current;
-                --duplicateNumber;
+            HTMLElementImpl *e = static_cast<HTMLElementImpl *>(current);
+            if(e->id() == ID_IMG) {
+                bool found;
+                if (caseSensitive)
+                    found = e->getAttribute(attr_id) == name;
+                else
+                    found = e->getAttribute(attr_id).lower() == name.lower();
+                if (found)
+                {
+                    if (!duplicateNumber)
+                        return current;
+                    --duplicateNumber;
+                }
             }
             if(current->firstChild())
             {
                 // The recursion here is the reason why this is a separate method
-                NodeImpl *retval = getNamedImgItem(current->firstChild(), attr_id, name, duplicateNumber);
+                NodeImpl *retval = getNamedImgItem(current->firstChild(), attr_id, name, duplicateNumber, caseSensitive);
                 if(retval)
                 {
                     //kdDebug( 6030 ) << "got a return value " << retval << endl;
@@ -561,12 +579,12 @@ NodeImpl * HTMLFormCollectionImpl::nextItem() const
 
 NodeImpl * HTMLFormCollectionImpl::nextNamedItemInternal( const DOMString &name ) const
 {
-    NodeImpl *retval = getNamedFormItem( idsDone ? ATTR_NAME : ATTR_ID, name, ++currentPos );
+    NodeImpl *retval = getNamedFormItem( idsDone ? ATTR_NAME : ATTR_ID, name, ++currentPos, true );
     if ( retval )
         return retval;
     if ( idsDone ) // we're done
         return 0;
     // After doing all ATTR_ID, do ATTR_NAME
     idsDone = true;
-    return getNamedItem(base->firstChild(), ATTR_NAME, name);
+    return getNamedItem(base->firstChild(), ATTR_NAME, name, true);
 }
diff --git a/WebCore/khtml/html/html_miscimpl.h b/WebCore/khtml/html/html_miscimpl.h
index ba87923..9a519ac 100644
--- a/WebCore/khtml/html/html_miscimpl.h
+++ b/WebCore/khtml/html/html_miscimpl.h
@@ -77,14 +77,14 @@ public:
     virtual NodeImpl *firstItem() const;
     virtual NodeImpl *nextItem() const;
 
-    NodeImpl *namedItem ( const DOMString &name ) const;
+    NodeImpl *namedItem ( const DOMString &name, bool caseSensitive = true ) const;
     // In case of multiple items named the same way
     NodeImpl *nextNamedItem( const DOMString &name ) const;
 
 protected:
     virtual unsigned long calcLength(NodeImpl *current) const;
     virtual NodeImpl *getItem(NodeImpl *current, int index, int &pos) const;
-    virtual NodeImpl *getNamedItem(NodeImpl *current, int attr_id, const DOMString &name) const;
+    virtual NodeImpl *getNamedItem(NodeImpl *current, int attr_id, const DOMString &name, bool caseSensitive = true) const;
     virtual NodeImpl *nextNamedItemInternal( const DOMString &name ) const;
     // the base node, the collection refers to
     NodeImpl *base;
@@ -120,11 +120,11 @@ public:
 protected:
     virtual unsigned long calcLength(NodeImpl* current) const;
     virtual NodeImpl *getItem(NodeImpl *current, int index, int& pos) const;
-    virtual NodeImpl *getNamedItem(NodeImpl* current, int attr_id, const DOMString& name) const;
+    virtual NodeImpl *getNamedItem(NodeImpl* current, int attr_id, const DOMString& name, bool caseSensitive) const;
     virtual NodeImpl *nextNamedItemInternal( const DOMString &name ) const;
 private:
-    NodeImpl* getNamedFormItem(int attr_id, const DOMString& name, int duplicateNumber) const;
-    NodeImpl* getNamedImgItem(NodeImpl* current, int attr_id, const DOMString& name, int& duplicateNumber) const;
+    NodeImpl* getNamedFormItem(int attr_id, const DOMString& name, int duplicateNumber, bool caseSensitive) const;
+    NodeImpl* getNamedImgItem(NodeImpl* current, int attr_id, const DOMString& name, int& duplicateNumber, bool caseSensitive) const;
     mutable int currentPos;
 };
 
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index a42d3dd..591e3eb 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -1820,7 +1820,7 @@ bool KHTMLPart::gotoAnchor( const QString &name )
   HTMLCollectionImpl *anchors =
       new HTMLCollectionImpl( d->m_doc, HTMLCollectionImpl::DOC_ANCHORS);
   anchors->ref();
-  NodeImpl *n = anchors->namedItem(name);
+  NodeImpl *n = anchors->namedItem(name, d->m_doc->parseMode() == DocumentImpl::Strict);
   anchors->deref();
 
   if(!n) {
diff --git a/WebCore/kwq/KWQListBox.mm b/WebCore/kwq/KWQListBox.mm
index b5b82ee..1784094 100644
--- a/WebCore/kwq/KWQListBox.mm
+++ b/WebCore/kwq/KWQListBox.mm
@@ -212,9 +212,7 @@ QSize QListBox::sizeForNumberOfLines(int lines) const
     float rowHeight = 0;
     float width = 0;
     for (int row = 0; row < rows; row++) {
-        NSBrowserCell *cell = [browser loadedCellAtRow:row column:0];
-        NSSize size = [cell cellSize];
-        NSLog(@"string is %@, width is %f", [cell stringValue], size.width);
+        NSSize size = [[browser loadedCellAtRow:row column:0] cellSize];
         width = MAX(width, size.width);
         rowHeight = MAX(rowHeight, size.height);
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list