Bug 65546 - [test case] <p> ended at <noscript>
Summary: [test case] <p> ended at <noscript>
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml parsing (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-05 16:56 UTC by Thomas Friedrichsmeier
Modified: 2006-06-08 15:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
test case (207 bytes, text/html)
2004-11-19 15:59 UTC, Stephan Kulow
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Friedrichsmeier 2003-10-05 16:56:01 UTC
Version:            (using KDE KDE 3.1.4)
Installed from:    Debian testing/unstable Packages

Consider the following short example html-code:

<html>
<body>
<p>There should not be a
<script type="text/javascript">
<!--
document.write ("break");
//-->
</script>
<noscript>break</noscript>
in this paragraph!</p>
</body>
</html>

Konqueror will put a linebreak in the paragraph. This occurs regardless of whether javascript is turned on or off. The break seems to arise at the opening <noscript>-tag. Indeed, the <noscript>-tag seems to be the culprit: even if the <script>...</script> section is removed, there will still be a line break at the opening <noscript>-tag, while the problem goes away, if you remove the <noscript/>-section only.

Further, if you put an align="center" in the opening <p>-tag, you will note, that obviously the whole paragraph gets closed at the <noscript>-tag (the first half of the paragraph will be centered, the second half on a separate line will be left-aligned).

Renders as expected (no line/paragraph break) in Mozilla 1.4.
Comment 1 Stephan Kulow 2003-11-02 11:18:33 UTC

*** This bug has been marked as a duplicate of 47241 ***
Comment 2 Thomas Friedrichsmeier 2003-11-02 16:11:46 UTC
Sorry, I don't think this is a duplicate of 47241. It may be related internally, I don't know about that, but it does seem to me to be an entirely different matter.
This bug has nothing to do with withespace-handling. The essence of this bug is, that an opening "<noscript>"-tag should not be considered as closing a <p>-tag that it's located inside.
I.e. the minimal testcase is the following (regardless of whether javascript is enabled or disabled):

<p align="right">This is right-aligned <noscript>and</noscript> this should be right-aligned, too, since it should be the same paragraph.</p>

This is a different situation from 47241. It's simply, that the <noscript>-tag should not close the paragraph, same as a <script>-tag does not close the containing <p> either. The rendering _inside_ the <noscript/>-section is not the problem here (I admit, the bug is somewhat mistitled).
Comment 3 Thomas Friedrichsmeier 2004-05-10 18:38:52 UTC
Still present in 3.2.2
Comment 4 Stephan Kulow 2004-11-19 15:59:55 UTC
Created attachment 8335 [details]
test case
Comment 5 Stephan Kulow 2004-11-19 16:00:29 UTC
but you're aware it's illegal HTML, aren't you?
Comment 6 Thorsten Schnebeck 2004-11-23 01:50:26 UTC
Hmm, accordind to selfhtml you can not use <noscipt> in <p> but in these blockelements:

applet | blockquote | body | button | center | dd | del | div | fieldset | form | iframe | ins | li | map | noframes | noscript | object | td | th

So the example seems to be wrong html. But what about real world sites? :-}

Bye

  Thorsten
Comment 7 Stephan Kulow 2004-11-23 12:15:50 UTC
real world sites don't care about legal HTML.
Comment 8 Allan Sandfeld 2006-06-08 15:35:16 UTC
Opera has same behavior as Firefox
Comment 9 Allan Sandfeld 2006-06-08 15:48:28 UTC
SVN commit 549401 by carewolf:

Allow noscript in P like Firefox and Opera
BUG:65546


 M  +2 -2      dtd.cpp  


--- branches/KDE/3.5/kdelibs/khtml/html/dtd.cpp #549400:549401
@@ -599,8 +599,8 @@
         // _1 *
         return check_array(childID, tag_list_1) || check_array(childID, tag_list_6);
     case ID_P:
-        // P: ( _0 | TABLE ) *
-        return check_array(childID, tag_list_0) || (!strict && childID == ID_TABLE);
+        // P: ( _0 | TABLE | NOSCRIPT) *
+        return check_array(childID, tag_list_0) || (!strict && (childID == ID_TABLE || childID == ID_NOSCRIPT));
     case ID_H1:
     case ID_H2:
     case ID_H3: