Bug 87221 - [test case] attribute/> causes attribute to be dropped
Summary: [test case] attribute/> causes attribute to be dropped
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml parsing (show other bugs)
Version: 3.2.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 94630 120347 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-14 23:18 UTC by Bugs Kde Org
Modified: 2006-08-24 15:26 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bugs Kde Org 2004-08-14 23:18:47 UTC
Version:           3.2.2 (using KDE 3.2.2, Gentoo)
Compiler:          gcc version 3.3.3 20040412 (Gentoo Hardened Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6)
OS:                Linux (i686) release 2.4.20-wolk4.0s-pre9

I include 2 html files. The first is rendered fine. The second is rendered wrong. The difference is the space between 'checked' and '/'. Both are valid ISO-HTML and should be rendered the same.

The first:
<!DOCTYPE HTML PUBLIC "ISO/IEC 15445:2000//DTD HTML//EN">
<html><head><title>T</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<form action="" method="get" accept-charset="utf-8">
<div><input type="radio" name="ms" value="ht" checked /></div>
</form>
</body></html>

The second:

<!DOCTYPE HTML PUBLIC "ISO/IEC 15445:2000//DTD HTML//EN">
<html><head><title>T</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<form action="" method="get" accept-charset="utf-8">
<div><input type="radio" name="ms" value="ht" checked/></div>
</form>
</body></html>
Comment 1 Stephan Kulow 2004-08-15 12:15:37 UTC
Reference to the spec? I never heared of ISO-HTML before
Comment 2 Bugs Kde Org 2004-08-15 12:40:43 UTC
Use Google:

http://www.cs.tcd.ie/15445/15445.HTML

ISO-HTML is a standard, not a recommendation. validator.w3c.org can validate ISO-HTML.
Comment 3 lexual 2004-11-27 07:36:47 UTC
2nd example comes us selected in mozilla 1.7.3 and unselected in kde 3.3.1.
1st example works fine.
Comment 4 Maksim Orlovich 2006-01-30 06:26:59 UTC
*** Bug 120347 has been marked as a duplicate of this bug. ***
Comment 5 Maksim Orlovich 2006-01-30 06:36:02 UTC
*** Bug 94630 has been marked as a duplicate of this bug. ***
Comment 6 Germain Garand 2006-08-24 15:26:20 UTC
SVN commit 576632 by ggarand:


support parsing of attribute/>
not taking WC patch on this one has it looks a tad cheesy.

BUG: 87221



 M  +10 -5     htmltokenizer.cpp  


--- branches/KDE/3.5/kdelibs/khtml/html/htmltokenizer.cpp #576631:576632
@@ -904,8 +904,16 @@
                         unsigned int a;
                         cBuffer[cBufferPos] = '\0';
                         a = khtml::getAttrID(cBuffer, cBufferPos);
-                        if ( !a )
-                            attrName = QString::fromLatin1(QCString(cBuffer, cBufferPos+1).data());
+                        if ( !a ) {
+                            // did we just get /> or e.g checked/>
+                            if (curchar == '>' && cBufferPos >=1 && cBuffer[cBufferPos-1] == '/') {
+                                currToken.flat = true;
+                                if (cBufferPos>1)
+                                    a = khtml::getAttrID(cBuffer, cBufferPos-1);
+                            }
+                            if (!a)
+                                attrName = QString::fromLatin1(QCString(cBuffer, cBufferPos+1).data());
+                        }
 
                         dest = buffer;
                         *dest++ = a;
@@ -915,9 +923,6 @@
                         else
                             kdDebug( 6036 ) << "Known attribute: " << QCString(cBuffer, cBufferPos+1).data() << endl;
 #endif
-                        // did we just get />
-                        if (!a && cBufferPos == 1 && *cBuffer == '/' && curchar == '>')
-                            currToken.flat = true;
 
                         tag = SearchEqual;
                         break;