Closed
Bug 43267
Opened 25 years ago
Closed 20 years ago
view source displays attributes with quotes in strange places incorrectly
Categories
(Core :: DOM: HTML Parser, defect, P3)
Core
DOM: HTML Parser
Tracking
()
VERIFIED
FIXED
Future
People
(Reporter: jmd, Assigned: mrbkap)
References
Details
(Keywords: testcase)
Attachments
(4 files)
123 bytes,
text/html
|
Details | |
4.38 KB,
patch
|
bzbarsky
:
review+
rbs
:
superreview+
|
Details | Diff | Splinter Review |
779 bytes,
text/html
|
Details | |
21.48 KB,
image/png
|
Details |
In some cases, <frameset ...> being shown wrong. Test case will follow.
Reporter | ||
Comment 1•25 years ago
|
||
OK, looks like this is caused by invalid HTML. Misplaced, unmatched quotes. It's
amazing it actually renders. Regardless, view source should have no problems
with it. 4.7 view source is fine.
The " at the end of frameborder is being cut, and the space after that.
4.7 is displaying the initial " colored as the same color as text, which is
probably the best we can hope to do.
Reporter | ||
Comment 2•25 years ago
|
||
Comment 3•25 years ago
|
||
--> xp apps.
sairuh - any ideas where this really belongs? Perhaps networking? According to
the component page, its xp apps gui, but I seem to doubt it is ben's fault.
Assignee: asa → don
Component: Browser-General → XP Apps
QA Contact: doronr → sairuh
Comment 4•25 years ago
|
||
here's the source (of the testcase) i see using View Page Source in 4.73 on
linux:
<html>
<frameset "frameborder="0" extra attributes here>
<frame src="foo.html">
<frame src="bar.html">
</frameset>
</html>
here's what i see on using today's linux commercial bits 2000.06.21.08:
<html>
<frameset "frameborder="0extra attributes here>
<frame src="foo.html">
<frame src="bar.html">
</frameset>
</html>
methinks this should go over to the Parser group...
Assignee: don → clayton
Component: XP Apps → Parser
QA Contact: sairuh → janc
Let me investigate if it's parser. Over to me.
Btw, thanx for the test case.
Assignee: clayton → harishd
This is a very low priority bug. Moving to FUTURE list.
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Harish -- First, I agree with your FUTURE approach to this. Second, if we
wanted to fix it, we could use code I added a while back to capture ws between
attributes so that viewsource would render correctly. I suspect we can use the
same mechanism to capture the (invalid) second ".
Comment 8•24 years ago
|
||
Adding to bug 57724, tracker for view-source displaying text incorrectly.
On Win98 2000121608, I see
<frameset frameborder="0" extra attributes here>
Reported earlier (for Linux):
<frameset "frameborder="0extra attributes here>
Correct:
<frameset "frameborder="0" extra attributes here>
Has it changed, or is it different on different platforms?
Updated•24 years ago
|
Keywords: correctness,
mozilla1.1
Comment 9•24 years ago
|
||
Testcase gives me
Not Found
The requested URL /foo.html was not found on this server.
Apache/1.3.12 Server at bugzilla.mozilla.org Port 80
Comment 11•24 years ago
|
||
When viewing the page source, the source does not wrap to the size of the
window. Could someone look into making the lines wrap to the window. This makes
reading the source easier than it is right now. Also, is it possible to specify
which editor should be used to read the source (though this may not be platform
independent)
Reporter | ||
Comment 12•24 years ago
|
||
+dataloss, though it's a borderline case.
Jesse: Today's linux is broken in the way win98 was for you, 6 months ago.
Ben: ignore that, the issue is with view source, yes the frame targets are 404s.
Manoj: this isn't the place for that request. That should be a new bug with
serverity=enhancement, if there isn't one already (pretty sure there is).
All: should this depend on 55583 or the other one that's regarding retrieving
original non-parsed source for things like 'save'?
Keywords: dataloss
Comment 13•24 years ago
|
||
jmd: Fixing bug 55583 wouldn't fix all of the view source munging problems,
because view source would still go through the parser to become colored.
Summary: view page source not displaying correctly → view source displays attributes with quotes in strange places incorrectly
Reporter | ||
Comment 14•24 years ago
|
||
non-colored view source is still being run through the parser? this bug still
shows with syntax coloring off...
Comment 15•24 years ago
|
||
*** This bug has been marked as a duplicate of 57724 ***
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Comment 16•23 years ago
|
||
Reopening 57724 dependencies for independent resolution.
Comment 17•23 years ago
|
||
Works fine on today's Linux CVS with and without syntax highlighting. Resolving
WORKSFORME.
Status: REOPENED → RESOLVED
Closed: 24 years ago → 23 years ago
Resolution: --- → WORKSFORME
Reporter | ||
Comment 18•23 years ago
|
||
I still see this. My testcase line should read:
<frameset "frameborder="0" extra attributes here>
^
view source isn't showing the first quote.
Reopening on choess' request.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Comment 19•22 years ago
|
||
I believe I'm experiencing this same bug. My HTML code contains:
================================================
<form action="foo.cgi">
<input type="hidden" name="tagline" value="begin \"double\" \'single\' <inside>
\\slash\\ end">;
<input type="submit" value="Save">
</form>
================================================
...but the "view source" display shows:
++++++++++++++++++++++++++++++++++++++++++++++++
<form action="openlist.phtml">
<input type="hidden" name="tagline" value="\"double\ \'single\' ><inside>
\\slash\\ xxx">;
<input type="submit" value="Save">
</form>
+++++++++++++++++++++++++++++++++++++++++++++++
The second quote mark has been removed.
Also please note the extra > that's been added.
Disclaimer: I'm not completely sure that the above is valid HTML code. I think
this is the way to escape single quotes, double quotes, backslashes, and
brackets but it's possible that this isn't valid and the bug is on *my* end.
Comment 20•22 years ago
|
||
*** Bug 179569 has been marked as a duplicate of this bug. ***
![]() |
||
Comment 21•22 years ago
|
||
The correct way to escape a quote is ", not \". But this is still a problem.
Comment 22•22 years ago
|
||
*** Bug 184816 has been marked as a duplicate of this bug. ***
Comment 23•22 years ago
|
||
By the definitions on <http://bugzilla.mozilla.org/bug_status.html#severity> and
<http://bugzilla.mozilla.org/enter_bug.cgi?format=guided>, crashing and dataloss
bugs are of critical or possibly higher severity. Only changing open bugs to
minimize unnecessary spam. Keywords to trigger this would be crash, topcrash,
topcrash+, zt4newcrash, dataloss.
Severity: normal → critical
Comment 24•22 years ago
|
||
Darned if I know how "dataloss" got stuck on this. Re-adjusting.
Severity: critical → minor
Keywords: dataloss,
mozilla1.1
Reporter | ||
Comment 25•22 years ago
|
||
It's dataloss because users and developers should rightfully assume pasting text
from view source is the same as saving that portion of the file.
If a "view" function is *changing* data, data may be lost.
Comment 26•22 years ago
|
||
We have about a gajilion of these little bugs (mostly deps of bug 57724; I just
created bug 188609 for the root cause of this mess). With all due respect, I
don't think they meet the criterion of *critical* data loss, which (AFAIK) is
meant for stuff like wiping out your form data and doubling your credit card
order, etc. I agree it's a problem, but realistically only fixing bug 188609 is
going to solve this stuff.
Assignee | ||
Comment 27•20 years ago
|
||
*** Bug 92196 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 28•20 years ago
|
||
*** Bug 182215 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 29•20 years ago
|
||
Some really fun stuff here...
This makes us not lose misplaced quotes in attributes. There are issues with
newline counting after invalid attributes, but that's another bug altogether.
I've tried to keep the behavior of the tokenizer the same in non-view-source
mode. The only real change is that in ConsumeQuotedString, I no longer call
SkipOver(). In non-view-source mode, subsequent quotes will be handled by the
SkipOver call in CAttributeToken::Consume() (when we try to consume the next
attribute).
Assignee | ||
Updated•20 years ago
|
Assignee: harishd → mrbkap
Status: REOPENED → ASSIGNED
Assignee | ||
Comment 30•20 years ago
|
||
Comment on attachment 159332 [details] [diff] [review]
patch v1
bz, could you please give this r=? I'm holding off on asking for sr= until I
have r=.
Attachment #159332 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 31•20 years ago
|
||
*** Bug 220386 has been marked as a duplicate of this bug. ***
![]() |
||
Comment 32•20 years ago
|
||
Comment on attachment 159332 [details] [diff] [review]
patch v1
Yeah, this looks reasonable. I'd like to see some testcases attached to this
bug (and maybe checked in as regression tests if we have such for parser?)
Attachment #159332 -
Flags: review?(bzbarsky) → review+
![]() |
||
Comment 33•20 years ago
|
||
Comment on attachment 159332 [details] [diff] [review]
patch v1
rbs, would you sr?
Attachment #159332 -
Flags: superreview?(rbs)
Assignee | ||
Comment 34•20 years ago
|
||
This should cover most of the cases. One thing this uncovers is that though we
don't allow " to be in attribute names, we do allow ' to be. Is this desired?
There does seem to be a parser regression test suite, but I can't get it to
run.
Comment 35•20 years ago
|
||
There are subtle differences, goto line 9:45 on the Source-of, or the 'a='b''
becomes 'a="b" '="" in the DOM-Source. But I don't mind either way unless other
people have objections.
Regarding the patch, why do you GetChar() instead of SkipOver(). Looks like you
copy the same char (quote) over itself, no? What specific problem does it fix?
Assignee | ||
Comment 36•20 years ago
|
||
(In reply to comment #35)
> There are subtle differences, goto line 9:45 on the Source-of, or the 'a='b''
> becomes 'a="b" '="" in the DOM-Source. But I don't mind either way unless other
> people have objections.
Once I fix bug 261503 this is going to turn into the same thing as when we have
extra double-quotes (technically, it should turn into ="" in the DOM source and
when we parse HTML for the real content model as opposed to view-source, those
extraneous quotes should be removed).
Once that's fixed, my eventual plan is to nuke the attributes that generate the
source |=""| in CNavDTD (after getting their newline count) since this makes us
assert (since these attributes have no name).
>
> Regarding the patch, why do you GetChar() instead of SkipOver(). Looks like you
> copy the same char (quote) over itself, no? What specific problem does it fix?
If you're referring to ConsumeQuotedString, the reason is that if we have: <a
href="b""> then that call to SkipOver loses the second quote, so view-source
misses it. I need to actually GetChar() on it because ConsumeUntil doesn't
actually consume the end condition.
bz, do you have any problems with the new parsing?
![]() |
||
Comment 37•20 years ago
|
||
No, I think the new parsing of such totally bogus stuff is OK (and will get
better once bug 261503 is fixed).
Comment 38•20 years ago
|
||
For additional context...
My symptom for this problem was in WYSIWYG Pro (a JS-based HTML editor).
I was trying to coerce it into service as a template editor, but when I
put certain Smarty tags inside an attribute the editor was destructive
to the content that I was editing, causing Smarty to fail.
I eventually determined that it was Mozilla (gecko?) whose parser was
getting confused. It's my theory that if the parser did a better job
of ignoring what it didn't understand, I might succeed in my original
goal.
Comment 39•20 years ago
|
||
Comment on attachment 159332 [details] [diff] [review]
patch v1
sr=rbs
I now see why you needed to turn SkipOver into GetChar. The skip _loops_ until
it encounter a different char...
Patch looks fine. Not much to expect from sloppy markups.
Attachment #159332 -
Flags: superreview?(rbs) → superreview+
checked in
checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago → 20 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 42•20 years ago
|
||
*** Bug 262562 has been marked as a duplicate of this bug. ***
Comment 43•20 years ago
|
||
Can this fix be landed on aviary?
![]() |
||
Comment 44•20 years ago
|
||
No. This is very much an alpha change.
Assignee | ||
Comment 45•20 years ago
|
||
*** Bug 213299 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 46•20 years ago
|
||
*** Bug 265638 has been marked as a duplicate of this bug. ***
Comment 47•20 years ago
|
||
*** Bug 270792 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 48•20 years ago
|
||
*** Bug 271217 has been marked as a duplicate of this bug. ***
Comment 49•20 years ago
|
||
Looking at the attachment "more testcases" with Firefox 1.0 (Gentoo Linux), I
have the same problems again. None of the badly quoted attributes are displayed
correctly in the view source window. That's very bad for webdesingers debugging
there dynamicly generated HTML code. Can anybody confirm these problems with
the latest Firefox release?
![]() |
||
Comment 50•20 years ago
|
||
Daniel, Firefox 1.0 is using the Gecko engine from last April. None of these
fixes are in Firefox 1.0. They will be in Firefox 1.1.
Comment 51•20 years ago
|
||
*** Bug 276972 has been marked as a duplicate of this bug. ***
Comment 52•20 years ago
|
||
verified with mozilla 1.8a6 2005-01-11-05-trunk
Status: RESOLVED → VERIFIED
Assignee | ||
Comment 53•20 years ago
|
||
*** Bug 285888 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 54•20 years ago
|
||
*** Bug 286109 has been marked as a duplicate of this bug. ***
Comment 55•20 years ago
|
||
*** Bug 292253 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
•