[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: PATCH: fixing my banking site ;)'
From:       David Faure <david () mandrakesoft ! com>
Date:       2002-03-21 16:02:22
[Download RAW message or body]

On Wednesday 20 March 2002 01:48, Dirk Mueller wrote:
> On Mit, 20 Mär 2002, David Faure wrote:
> 
> > The support for ATTR_ID, with this test, was added by Dirk during the big
> > "Christmas hacking" commit. Is it okay to remove the test?
> 
> Hmm, difficult decision. I've added that code bacause I've read in the XHTML 
> documentation that name attribute is deprecated and should be replaced by 
> "id" (i.e. both are handled equivalent). However, I figured this might break 
> some other webpages, so I only enabled it for XHTML valid pages. 
> 
> when commenting out the code 
> 
> <foo id=blubb name=blah> will be different from 
> <foo name=blubb id=blah>
> 
> which is not exactly nice. there should be a priority handling (like id 
> always overwrites name) probably, but it needs investigation how the usual 
> browsers handle this. 

Index: html_baseimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_baseimpl.cpp,v
retrieving revision 1.157
diff -u -p -r1.157 html_baseimpl.cpp
--- html_baseimpl.cpp   2002/03/03 23:21:59     1.157
+++ html_baseimpl.cpp   2002/03/21 15:59:48
@@ -231,8 +231,15 @@ void HTMLFrameElementImpl::parseAttribut
         url = khtml::parseURL(attr->val());
         break;
     case ATTR_ID:
-        if (getDocument()->htmlMode() != DocumentImpl::XHtml) break;
-        // fall through
+        // IE6 behaviour for frames['bleh']:
+        // it stores the name, and the id somewhere (not in the window object id property...)
+        // and looks for a matching id first, then for a matching name.
+        // To make at least the non-duplicate case work (only id set, and unique),
+        // we store the id as the name if there is no name.
+        // If both id and name are set, we currently use the name.
+        if ( name.isEmpty() )
+            name = attr->value();
+        break;
     case ATTR_NAME:
         name = attr->value();
         break;

That's the easiest way to fix this site, while keeping maximum compat with
previous versions of Konqueror (name is used if both name and id are set).
Real IE behavior would require much bigger change (and generally I think
people very rarely use both name and id for frames!)

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://people.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic