Bug 135050 - [regression] anchor tags without href aren't closed soon enough
Summary: [regression] anchor tags without href aren't closed soon enough
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml parsing (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-03 17:48 UTC by Germain Garand
Modified: 2006-10-21 12:35 UTC (History)
0 users

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 Germain Garand 2006-10-03 17:48:41 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

since it appears styles are now applied to all anchors, even without href (sounds quite strange to me, was that an intended change?), those really ought to be closed pretty soonish...

Testcase:
data:text/html,<style>a{color:red;font-size:30px;content:"failed"}</style><a><table><tr><td>passed

Real world:
http://www.maxconsole.net/?mode=news
(hover viewport anywhere => text becomes bold because of a:hover matching <a name="#top"> right after body)
Comment 1 Allan Sandfeld 2006-10-20 12:13:27 UTC
In this case it seems Firefox closes Anchors when they encounter a TABLE.
Comment 2 Allan Sandfeld 2006-10-20 14:21:43 UTC
SVN commit 597449 by carewolf:

Firefox rather arbitrarily doesn't allow TABLEs inside Anchors. 
Lets match that restriction.
BUG: 135050


 M  +1 -0      dtd.cpp  


--- branches/KDE/3.5/kdelibs/khtml/html/dtd.cpp #597448:597449
@@ -597,6 +597,7 @@
     case ID_NOBR:
     case ID_WBR:
         // _1 *
+        if(tagID == ID_A && childID == ID_TABLE) return false;
         return check_array(childID, tag_list_1) || check_array(childID, tag_list_6);
     case ID_P:
         // P: ( _0 | TABLE | NOSCRIPT) *
Comment 3 Allan Sandfeld 2006-10-20 17:47:01 UTC
Though after looking more closely at the tests. It seem more like Firefox does allow TABLES inside Anchors, but a table for some reason doesn't inherit any style from an anchor. 
Comment 4 Germain Garand 2006-10-20 18:51:41 UTC
Is that a quirk? It sounds like all those style resets that happen for tables in quirk mode.
Comment 5 Allan Sandfeld 2006-10-21 12:35:05 UTC
SVN commit 597669 by carewolf:

Correct fix of #135050
CCBUG: 135050


 M  +2 -1      css/quirks.css  
 M  +0 -1      html/dtd.cpp  


--- branches/KDE/3.5/kdelibs/khtml/css/quirks.css #597668:597669
@@ -18,13 +18,14 @@
 
 /* Tables reset both line-height and white-space in quirks mode.
    Compatible with WinIE. For some reason they don't reset font-family */
-TABLE {
+table {
     white-space: normal;
     line-height: normal;
     color: -khtml-text;
     font-size: medium;
     empty-cells: hide;
     text-align: -khtml-auto;
+    font-weight: initial;
 }
 
 LAYER {
--- branches/KDE/3.5/kdelibs/khtml/html/dtd.cpp #597668:597669
@@ -597,7 +597,6 @@
     case ID_NOBR:
     case ID_WBR:
         // _1 *
-        if(tagID == ID_A && childID == ID_TABLE) return false;
         return check_array(childID, tag_list_1) || check_array(childID, tag_list_6);
     case ID_P:
         // P: ( _0 | TABLE | NOSCRIPT) *