Closed
Bug 88243
Opened 24 years ago
Closed 24 years ago
text is not correctly layouted (problems with TABLE WIDTH=)
Categories
(Core :: DOM: HTML Parser, defect, P3)
Tracking
()
VERIFIED
FIXED
mozilla0.9.4
People
(Reporter: ezh, Assigned: harishd)
References
()
Details
(Whiteboard: [fix in hand])
Attachments
(7 files)
Look at the bottom of this page. Starting at * BAD POINTS text is alligned not
as it should.
Also look at here http://forum.spylog.ru/
And here http://www.virusbtn.com/100/vb100sum.html
BTW I bet I alredy filled a bug for it, but couldn't find it. :(
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
Comment 3•24 years ago
|
||
Sorry for the <td> remark. I have it now:
<table WIDTH=50%" BORDER=0 ALIGN="CENTER" CELLSPACING=2>
The " sign after 50% makes Mozilla understand the text as WIDTH=50. To make it
evcen stranger, if you write <table "WIDTH=50%"> the effect is identical. Other
browsers show the one " case correct while ignoring the "" enclosd WIDTH completely.
Comment 4•24 years ago
|
||
In the first URL (http://forum.spylog.ru) is is the following line
<table width= cellspacing=0 cellpadding=0 border=0>
that causes trouble. Take note of the width= attribute with no value. It seems
Mozilla gives it a random value. An uninitiated variable? or the value of an
earlier WIDTH attribute?
Updated•24 years ago
|
Summary: text is not correctly layouted → text is not correctly layouted (problems with TABLE WIDTH=)
Comment 5•24 years ago
|
||
Bug 88342 about http://msdn.microsoft.com is identical. I'm not sure which
should be duped against which.
Comment 8•24 years ago
|
||
Sounds like the parser is bungling this? harishd, could you take a look? You can
assign it back to me if it's a core layout problem.
Assignee: karnaze → harishd
Component: Layout → Parser
QA Contact: petersen → bsharma
Comment 9•24 years ago
|
||
Comment 10•24 years ago
|
||
It seems this is a dup. Forget my remarks about %50 read as 50. It seems in all
the testcases width is read as 0, after all.
*** This bug has been marked as a duplicate of 75250 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Comment 11•24 years ago
|
||
This not a exact duplicate so I reopen it. The first issues look like
"width=50%"
the string tmp at
http://lxr.mozilla.org/mozilla/source/content/html/content/src/nsGenericHTMLElement.cpp#2419
is 50%"
if I change the width spec to "width="50%" the tmp string will be 50%.
If we decide to support that kind of loosy html then parser should not return a
" in the value string.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Comment 12•24 years ago
|
||
Assignee | ||
Comment 13•24 years ago
|
||
IMO, the problem is
PRBool
nsGenericHTMLElement::ParseValueOrPercentOrProportional(...)
{
nsAutoString tmp(aString);
tmp.CompressWhitespace(PR_TRUE, PR_TRUE);
PRInt32 ec, val = tmp.ToInteger(&ec);
......
if (tmp.Length() && tmp.Last() == '%') {/* XXX not 100% compatible with
ebina's code */ <<<<<<<< ----- HERE ------ <<<<<<<<<
Status: REOPENED → ASSIGNED
Assignee | ||
Comment 14•24 years ago
|
||
Comment 15•24 years ago
|
||
r = bernd, i had the same idea , but I was as afraid as you about performance
issues
Assignee | ||
Comment 16•24 years ago
|
||
*** Bug 44485 has been marked as a duplicate of this bug. ***
Whiteboard: [fix in hand]
Target Milestone: --- → mozilla0.9.3
r=heikki as well
Assignee | ||
Comment 18•24 years ago
|
||
Moving to more realistic target - m0.9.4!
Target Milestone: mozilla0.9.3 → mozilla0.9.4
Comment 19•24 years ago
|
||
sr=vidur
Reporter | ||
Comment 20•24 years ago
|
||
http://www.hp.com/ - look at the left bottom. The same issue or a new one?
Comment 21•24 years ago
|
||
Hold up a sec. Does this patch only apply to quirks mode? The width attribute
is CDATA and as such should NOT be stripped of whitespace in strict mode (see
my comments in bug 42287).
Comment 22•24 years ago
|
||
Christopher: How do you propose to parse WIDTH=50%" in strict mode? Presently it
is parsed as WIDTH="0". I understand the strict way would be to ignore it, due to
the lack of the first " character (making it equal to WIDTH="100%"). If so, the
present behavior is wrong.
Comment 23•24 years ago
|
||
Comment 24•24 years ago
|
||
I'm shooting from the hip on this (I returned Goldfarb to the library :-), but
I think you are correct: "attribute value delimiters" have to occur in matched
pairs. So <table width='50%">, <table width="50%> and <table width=50%">
should all (I think) be equivalent to <table>. I'll let you know more
definitively once I've looked over the SGML Handbook again (or would a member
of the viewing audience care to oblige? :-)
Comment 25•24 years ago
|
||
I don't think Goldfarbs SGML handbook has an answer to this question that is
relevant to HTML, SGML is very strict about how attributes (and everything else)
is parsed, any of the above would simply be parsing errors in SGML, but since
there is no concept of parsing errors in HTML :-) we'll haveto go with common
practice.
Comment 26•24 years ago
|
||
Also in strict (or "standards") mode?
Comment 27•24 years ago
|
||
Johnny: in quirks mode, we can do whatever we need to support the problem. (I
assume it's been complained about or this patch wouldn't be appearing.) My
point is that in strict mode, we should parse this like SGML, get a busted
attribute we don't understand, and silently ignore it, which would produce a
different result than our current behavior (see the latest testcase). The
reason I'm fussing with Goldfarb is to get a better idea of exactly what is
considered "broken".
As for my earlier tests, I provide the strictly parsed interpretation:
<table width='50%">
<table width="50%>
Tag isn't closed, rest of document interpreted as part of attribute value,
disappears. An Evangelism bug is filed. :-)
<table width=50%">
attributes containing % signs, etc. need to be quoted. Attribute not
understood-should drop silently. This is the case we're currently dealing with.
Comment 28•24 years ago
|
||
This seems to be my problem too... BUG 92721
It is my opinion that this behavior is generated inside of the
CAttributeToken::Consume function
at http://lxr.mozilla.org/seamonkey/source/htmlparser/src/nsHTMLTokens.cpp#1608
I worked around the problem by including a |PRUnichar('"')| [which is a double
quote inside single quotes] at nsHTMLTokens.cpp#43 but am still not convinced
this is the best approach. I offer it up here so that others may experiment.
I will continue to work through the logic of this and get back to you with my
findings.
Assignee | ||
Comment 29•24 years ago
|
||
Fix landed on 08/07/01. Marking FIXED.
FYI: If there are other issues please track it down with a new bug.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
Comment 30•24 years ago
|
||
Verified on 2001-08-08-Trunk build on WinNT.
The above url has the same problem as described.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 31•24 years ago
|
||
Bindu: could you tell me why you reopened the bug?
Assignee | ||
Comment 32•24 years ago
|
||
The fix was to correct cases like <TABLE WIDTH="80% ">.
Try attachment (id=41542). Marking FIXED again.
Status: REOPENED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
Comment 33•24 years ago
|
||
I fully agree with closing this bug.
The chip-online URL is just a case of totally bad HTML which got here by
accident. I'll attach a simplified testcase. The narrow column is the result of
putting two 200 pixel wide tables inside a 448 wide table. The thing would not
happen if aditionally the two table did not have an unnecessary <td
colspan="3"></td> element and if the absurd <li> (without a <ul>) element were
not added to make it completely non-standard. Mozilla gave it interpretation if
the absurd code which by accident was different from the interpretations of
other browsers. If it is a bug it should be IMHO filed under Evangelsm.
Comment 34•24 years ago
|
||
Comment 35•24 years ago
|
||
Verifying FIXED (WindowsME 2001080804 trunk build)
See above for my comments on the remaining bad URL.
Status: RESOLVED → VERIFIED
Comment 36•23 years ago
|
||
*** Bug 54288 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
•