Closed
Bug 102437
Opened 23 years ago
Closed 22 years ago
[FIX]outdated view source charset handling can be removed
Categories
(Core :: Internationalization, defect, P1)
Core
Internationalization
Tracking
()
VERIFIED
FIXED
mozilla1.3alpha
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
(Keywords: intl, perf)
Attachments
(1 file, 1 obsolete file)
2.25 KB,
patch
|
hjtoi-bugzilla
:
review+
|
Details | Diff | Splinter Review |
nsXMLDocument.cpp has a lot of charset handling stuff for view-source.
Unfortunately, view-source is no longer an XML document; it's been an HTML
document for over a year now. I can't figure out whether this charset detection
needs to be moved over to nsHTMLDocument or just deleted or what....
Comment 2•23 years ago
|
||
please be specific.
Assignee | ||
Comment 3•23 years ago
|
||
Do you mean I should be specific as to what code I mean?
Comment 4•23 years ago
|
||
yea
Assignee | ||
Comment 5•23 years ago
|
||
http://lxr.mozilla.org/seamonkey/source/content/xml/document/src/nsXMLDocument.cpp#467
The code is:
if(bIsHTML &&(0 == nsCRT::strcmp("view-source", aCommand))) {
// only do this for view-source
//view source is now an XML document and we need to make provisions
//for the usual charset use when displaying those documents, this
//code mirrors nsHTMLDocument.cpp
... about 150 lines of charset detection code ...
}
Actually, the enclosing
462 nsCOMPtr<nsIContentViewer> cv;
463 docShell->GetContentViewer(getter_AddRefs(cv));
464 if (cv) {
also looks like it could go.
Comment 6•23 years ago
|
||
nhotta- can you take a look at this one ?
Assignee: ftang → nhotta
Priority: -- → P4
Comment 7•23 years ago
|
||
So is this requesting to use the detection code in nsHTMLDocument for XML?
Status: NEW → ASSIGNED
Assignee | ||
Comment 8•23 years ago
|
||
No.
The code in nsXMLDocument is only used if we are viewing source. That means that
we never use it (since view source now uses an HTML document to show the source,
so XML documents never have aCommand == "view-source"). So it's just code
that's doing nothing. Therefore we should either remove it (reducing bloat) or
move it over to nsHTMLDocument if that does not contain equivalent detection
(improving correctness).
Updated•23 years ago
|
Keywords: mozilla1.0
Comment 10•23 years ago
|
||
Reassign to shanjian.
Assignee: nhotta → shanjian
Status: ASSIGNED → NEW
Target Milestone: mozilla1.0 → ---
Updated•23 years ago
|
QA Contact: andreasb → ylong
Comment 11•23 years ago
|
||
*** Bug 129966 has been marked as a duplicate of this bug. ***
Comment 12•23 years ago
|
||
I filed bug 129966 and bzbarsky pointed me to this bug. What is needed is just
to delete a chunk of code (c.f. comment #5) that has become useless as a result
of using another approach for the view-source feature.
Updated•23 years ago
|
Status: NEW → ASSIGNED
Comment 13•23 years ago
|
||
It goes back to bug 12502 & bug 72299. The following diff (from bug 12502) shows
exactly the .h files & chunk of code that have become unnecessary.
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvsroot&subdir=mozilla/content/xml/document/src&command=DIFF_FRAMESET&file=nsXMLDocument.cpp&rev2=1.54&rev1=1.53
Comment 14•23 years ago
|
||
updating title to better reflect the reality.
Summary: view source charset handling may need to be moved → outdated view source charset handling can be removed
Assignee | ||
Comment 15•22 years ago
|
||
I realized today that this is doing some expensive and useless work on every
single XML file (including fun shit like XBL bindings and such).
Assignee | ||
Comment 16•22 years ago
|
||
bbaetz? rbs? reviews?
Assignee: shanjian → bzbarsky
Status: ASSIGNED → NEW
Keywords: perf
Priority: P4 → P1
Summary: outdated view source charset handling can be removed → [FIX]outdated view source charset handling can be removed
Target Milestone: --- → mozilla1.3alpha
Comment 17•22 years ago
|
||
Comment on attachment 105390 [details] [diff] [review]
remove the junk
r=bbaetz
the non-mine stuff was never being run, because bISHTML should never be true
for an XML document, + the strcmp for viewsource would fail anyway.
Attachment #105390 -
Flags: review+
Comment on attachment 105390 [details] [diff] [review]
remove the junk
sr=heikki
I want more patches like this :)
Attachment #105390 -
Flags: superreview+
Comment 19•22 years ago
|
||
Is the left-over intentional (e.g., in .h)? (c.f. the bonsai diff in comment #13).
Comment 20•22 years ago
|
||
Also, |charsetSource| and the whole chunk of code commented as "check channel's
charset..." seem useless now.
Assignee | ||
Comment 21•22 years ago
|
||
The charset/charsetsource is passed to the parser... I left it in fairly
deliberately, because I can't tell for sure that it's safe to remove it. Is it?
Assignee | ||
Comment 22•22 years ago
|
||
This comment got trapped in mid-air limbo.. it's a response to comment 19:
more or less, since I also left in the code that gets the charset from the
channel... that part may still make sense in XML that's not view-source.
I landed the patch (before seeing rbs' comment). Patch to clean up the headers
coming up...
Assignee | ||
Comment 23•22 years ago
|
||
Attachment #105390 -
Attachment is obsolete: true
Comment 24•22 years ago
|
||
r/sr=rbs if you need it.
Assignee | ||
Comment 25•22 years ago
|
||
I do. heikki? Bradley?
Updated•22 years ago
|
Attachment #105407 -
Flags: review+
Comment on attachment 105407 [details] [diff] [review]
more junk-busting
r=heikki
Assignee | ||
Comment 27•22 years ago
|
||
Checked in. The rest of that code looks like it might actually do something (in
fact it almost certainly does, in the case when the XML is not UTF8 and does not
specify an encoding in the XML decl, which is legal if you specify it in the
HTTP headers). So marking fixed.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 28•22 years ago
|
||
No regression was found with view page source on trunk build, so marking as
verified with this code change bug.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•