| Summary: | Errors parsing a www.pygame.org page | ||
|---|---|---|---|
| Product: | [Applications] konqueror | Reporter: | Federico Asara <ze4lot> | 
| Component: | khtml parsing | Assignee: | Konqueror Bugs <konqueror-bugs-null> | 
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| 
        
          Description
        
        
          Federico Asara
        
        
        
        
          2006-02-19 12:56:09 UTC
        
       hmm, the parser seems to inappropriately give a standalone input a form which shadows the function context:
<form class='addcomment' action='comment_new.php'>
   <input type='hidden' name='link' value='pygame.Surface'>
   <input type='submit' value='Add a Comment'>
</form>
</div>
<div id='pygame.Surface-comments'>
 <input type='button' value='Comments (2)' onclick='comments_show("pygame.Surface");'></div>  <br> 
SVN commit 517005 by ivor:
Replace one form reattach hack with another, pending a  better fix.
BUG: 122968
BUG: 122273
CCBUG: 116790
 M  +1 -5      html_formimpl.cpp  
 M  +9 -0      htmlparser.cpp  
--- branches/KDE/3.5/kdelibs/khtml/html/html_formimpl.cpp #517004:517005
@@ -886,11 +886,7 @@
     {
         if( p->id() == ID_FORM )
             return static_cast<HTMLFormElementImpl *>(p);
-        NodeImpl *s = p->previousSibling();
-        if (!s)
-            p = p->parentNode();
-        else
-            p = s;
+        p = p->parentNode();
     }
 #ifdef FORMS_DEBUG
     kdDebug( 6030 ) << "couldn't find form!" << endl;
--- branches/KDE/3.5/kdelibs/khtml/html/htmlparser.cpp #517004:517005
@@ -1388,6 +1388,15 @@
         blockElem->removeChild(currNode, exceptionCode);
         newNode->appendChild(currNode, exceptionCode);
         currNode = nextNode;
+
+ // TODO - To be replaced.
+        // Re-register form elements with currently active form, step 1 will have removed them
+        if (form)
+        {
+            HTMLGenericFormElementImpl *e = static_cast<HTMLGenericFormElementImpl *>(currNode);
+            if (e)
+                form->registerFormElement(e);
+        }
     }
 
     // Step 4: Place |newNode| under |blockElem|.  |blockElem| is still out of the document, so no
This bug still occurs in KDE 3.5.2 (don't know if the above patch has been applied to 3.5.2 version?) The fix will be in KDE 3.5.3 |