Bug 101678

Summary: khtml dont close links with wbr tag
Product: [Applications] konqueror Reporter: gallir
Component: khtml parsingAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: hisham, mail4ilia, roman.kalukiewicz
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description gallir 2005-03-17 11:18:09 UTC
Version:           3.4.0 (using KDE 3.4.0, Debian Package 4:3.4.0-0pre1 (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-8)
OS:                Linux (i686) release 2.6.11

If <wbr> tags are inside a link, </a> is ignored. The following external text are also considered as part of it, even if there are other links.
Comment 1 gallir 2005-03-17 11:18:39 UTC
I forgot it, a test case:

<a href="http://www.kde.org" target=_blank>Word1<wbr>Word2<wbr>Word3</a>
<br>
Other text, should not be linked.
Comment 2 Allan Sandfeld 2005-05-09 23:59:11 UTC
SVN commit 411684 by carewolf:

WBR does have higher nesting than links (similar to WebCore now)
BUG: 101678


 M  +4 -4      trunk/KDE/kdelibs/khtml/html/dtd.cpp  


--- trunk/KDE/kdelibs/khtml/html/dtd.cpp #411683:411684
@@ -147,7 +147,7 @@
     1, // ID_U
     5, // ID_UL
     1, // ID_VAR
-    4, // ID_WBR
+    1, // ID_WBR
     5, // ID_XMP
     0, // ID_TEXT
 };
@@ -254,7 +254,7 @@
     REQUIRED,  // ID_U
     REQUIRED,  // ID_UL
     REQUIRED,  // ID_VAR
-    REQUIRED,  // ID_WBR
+    OPTIONAL,  // ID_WBR
     REQUIRED,  // ID_XMP
     REQUIRED   // ID_TEXT
 };
@@ -650,8 +650,8 @@
     case ID_MAP:
 	// We accept SCRIPT in client-side image maps as an extension to the DTD.
         // MAP: ( _3 + | AREA + | SCRIPT + )
-        return check_array(childID, tag_list_3) || 
-            childID == ID_AREA || 
+        return check_array(childID, tag_list_3) ||
+            childID == ID_AREA ||
             childID == ID_SCRIPT;
     case ID_OBJECT:
     case ID_EMBED:
Comment 3 Maksim Orlovich 2005-05-12 01:14:35 UTC
*** Bug 105490 has been marked as a duplicate of this bug. ***
Comment 4 Maksim Orlovich 2005-05-12 01:15:01 UTC
*** Bug 101691 has been marked as a duplicate of this bug. ***
Comment 5 hisham 2005-05-12 03:08:21 UTC
Thank you for fixing it. Looking at the patch above I see some WBR-specific stuff. According to the test case I listed in Bug 101691 (reproduced below) this problem happens with other tags as well. I'm unable to test from CVS here, but please make sure that it works with other tags as well. <nobr>, <p> and <blockquote> are some examples that trigger the issue in 3.4.0. Again, thank you!

<html> 
<body> 
<a href="teste.html">Hello, <p>this is a test</a>. Is this still a link? It shouldn't be. 
</body> 
</html> 
Comment 6 Allan Sandfeld 2005-05-12 12:08:28 UTC
The other cases are illegally nested HTML. It will work in KDE 3.5 where we take hand of invalid nesting (also called residual styles), but it will not be ported to 3.4.1
Comment 7 Maksim Orlovich 2005-06-16 23:23:13 UTC
*** Bug 79686 has been marked as a duplicate of this bug. ***