Closed
Bug 181697
Opened 23 years ago
Closed 21 years ago
<strong> element extends its effect unnecessarily when <LI> tag is not closed
Categories
(Core :: DOM: HTML Parser, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: momoi, Assigned: mrbkap)
References
Details
(Keywords: compat, regression, testcase)
Attachments
(2 files)
|
654 bytes,
text/html
|
Details | |
|
2.37 KB,
patch
|
bzbarsky
:
review+
rbs
:
superreview+
|
Details | Diff | Splinter Review |
** Observed with 2002-11-23 trunk build **
When you have a source like the following:
===========
...
...
<UL>
<strong>
<LI> Line 1
<LI> Line 2
</strong>
</UL>
<P>
Line 3: Outside the <strong> element.
...
...
===========
the effect of <strong> extends to Line 3. I have seen some documents
displaying mostly in bold because of this problem.
There are a couple of ways to avoid this problem.
1. Close each of the 2 <LI> with </LI>.
or
2. Move <strong> in front of <ul>.
I'll attach a sample test case next.
| Reporter | ||
Comment 1•23 years ago
|
||
| Reporter | ||
Comment 2•23 years ago
|
||
This is a regression from 1.0 branch.
I can see this problem in:
The latest 1.0.2 branch build.
The latest trunk build.
but not in Mozilla 1.0 or Netscape 6.2.x builds.
This is basic stuff and should be fixed as ASAP,
hopefully before the next major release.
| Reporter | ||
Comment 3•23 years ago
|
||
Note that once you have this problem, all text after the
problem spot will be in bold type.
->Parser, not Style System.
Assignee: dbaron → harishd
Component: Style System → Parser
QA Contact: ian → moied
Updated•23 years ago
|
| Assignee | ||
Comment 7•21 years ago
|
||
*** Bug 263674 has been marked as a duplicate of this bug. ***
| Assignee | ||
Comment 8•21 years ago
|
||
This may be related to bug 256731 (auto-closing phrase-level elements seems to
be pretty broken).
| Assignee | ||
Comment 9•21 years ago
|
||
*** Bug 207032 has been marked as a duplicate of this bug. ***
| Assignee | ||
Comment 10•21 years ago
|
||
So in nsElementTable.cpp, I made <li> a kBlockEntity, and allowed font to
contain it through gFontKids... but this changes the regression test
bug7823.html since we used to allow <li> as a child of <b>, and with my change
we don't. So because <b> is a kFontStyle, it was auto-closing the <li> since it
could contain it <li> (see
http://lxr.mozilla.org/seamonkey/source/parser/htmlparser/src/nsElementTable.cpp#2166
for the gory details) and now we don't close it since kFontStyles cannot contain
kBlockEntities.
Note that with my change, we parse that testcase much closer to IE (it does
funky things with the DOM that we don't do, since we do RS and it just seems to
deal with mismatched close tags).
Also, the parser regression tests exploded when I tried to run them, so I think
something screwy is going on there, too, but I doubt it's related to this bug.
I'll attach a patch tomorrow at some point. bz, rbs, do you have any opinions here?
Assignee: harishd → mrbkap
Comment 11•21 years ago
|
||
| Assignee | ||
Comment 12•21 years ago
|
||
This is the described patch. One style note: this file makes no attempt to
respect the 80 char limit, and I don't think now is the time to start enforcing
such a limit.
| Assignee | ||
Updated•21 years ago
|
Attachment #163891 -
Flags: superreview?(rbs)
Attachment #163891 -
Flags: review?(bzbarsky)
Comment 13•21 years ago
|
||
Comment on attachment 163891 [details] [diff] [review]
patch v1
>Index: src/nsElementTable.cpp
>+ /*parent,incl,exclgroups*/ kBlockEntity, kFlowEntity, kSelf, // changed this to kBlockEntity so we enable RS handling for
s/this to kBlockEntity/this back to kBlockEntity/ and r=bzbarsky
Attachment #163891 -
Flags: review?(bzbarsky) → review+
Comment 14•21 years ago
|
||
Comment on attachment 163891 [details] [diff] [review]
patch v1
sr=rbs
Attachment #163891 -
Flags: superreview?(rbs) → superreview+
| Assignee | ||
Comment 15•21 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 16•21 years ago
|
||
*** Bug 139689 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•