Closed
Bug 241739
Opened 21 years ago
Closed 20 years ago
nsXULDocument seems unable to deal with non-ascii scripts
Categories
(Core :: XUL, defect, P1)
Core
XUL
Tracking
()
RESOLVED
FIXED
mozilla1.8beta3
People
(Reporter: Biesinger, Assigned: Biesinger)
References
()
Details
(Keywords: intl)
Attachments
(2 files, 1 obsolete file)
|
282 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
|
11.60 KB,
patch
|
Biesinger
:
review+
Biesinger
:
superreview+
asa
:
approval1.8b3+
|
Details | Diff | Splinter Review |
in the OnStreamComplete impl:
3133 nsString stringStr; stringStr.AssignWithConversion(string, stringLen);
it seems somewhat unlikely that this will do the intended thing for non-ascii
(or, non-latin1) scripts.
Updated•21 years ago
|
Keywords: helpwanted
Comment 1•21 years ago
|
||
http://lxr.mozilla.org/seamonkey/source/content/base/src/nsScriptLoader.cpp#735
Can we do something similar to what's done in nsScriptLoader.cpp?
Keywords: intl
Comment 2•21 years ago
|
||
That's exactly what we want to do, in fact... It just sucks to duplicate code.
Any way to hook this crud up to the normal scriptloader?
| Assignee | ||
Comment 3•21 years ago
|
||
nsIScriptLoader:
89 void processScriptElement(in nsIDOMHTMLScriptElement aElement,
90 in nsIScriptLoaderObserver aObserver);
I suspect the type of aElement would have to change, at least.
| Assignee | ||
Comment 4•21 years ago
|
||
it could possibly use
http://lxr.mozilla.org/seamonkey/source/content/html/content/public/nsIScriptElement.h
although it may need a way to query the URL
Comment 5•21 years ago
|
||
See bug 235826. That changes the nsIScriptLoader api already.
unfortunatly i suspect it's not as easy in XUL due to the
implement-all-elements-using-a-single-class design :(
Comment 7•21 years ago
|
||
*** Bug 264014 has been marked as a duplicate of this bug. ***
Comment 8•21 years ago
|
||
The other option is to move a lot of the scritloader OnStreamComplete guts (at
least the part handling the encoding conversion) out into a static helper or an
nsContentUtils helper and have nsXULDocument reuse it...
| Assignee | ||
Updated•20 years ago
|
Assignee: nobody → cbiesinger
| Assignee | ||
Comment 9•20 years ago
|
||
crazy idea: could we maybe just create an HTMLScriptElement for <xul:script/> nodes?
You probably wouldn't be able to take advantage of the prototype stuff for
script elements then. IIRC for scripts we put the actual script in the prototype
to avoid recompiles.
| Assignee | ||
Comment 11•20 years ago
|
||
| Assignee | ||
Comment 12•20 years ago
|
||
(this patch leaves the method on nsScriptLoader, instead of putting it onto
nsContentUtils)
Attachment #185903 -
Flags: review?(bzbarsky)
| Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla1.8beta3
Comment 13•20 years ago
|
||
Comment on attachment 185903 [details] [diff] [review]
implements comment 8's suggestion
>Index: base/src/nsScriptLoader.cpp
>+nsScriptLoader::ConvertToUTF16(nsIChannel* aChannel, const PRUint8* aData,
>+ if (NS_FAILED(rv) || characterSet.IsEmpty()) {
>+ if (!aHintCharset.IsEmpty()) {
Why not use && instead of a separate if?
>+ nsString tempStr;
Why bother? Why not just write to aString directly?
r+sr=bzbarsky with those nits picked.
Attachment #185903 -
Flags: superreview+
Attachment #185903 -
Flags: review?(bzbarsky)
Attachment #185903 -
Flags: review+
| Assignee | ||
Comment 14•20 years ago
|
||
comments addressed, transferring bz's r+sr
This patch allows non-ASCII characters in XUL <script src> scripts, would be
nice to have in 1.8 - it just reuses the code for HTML/SVG <script>.
Attachment #185903 -
Attachment is obsolete: true
Attachment #185953 -
Flags: superreview+
Attachment #185953 -
Flags: review+
Attachment #185953 -
Flags: approval1.8b3?
Updated•20 years ago
|
Attachment #185953 -
Flags: approval1.8b3? → approval1.8b3+
| Assignee | ||
Comment 15•20 years ago
|
||
Checking in content/base/src/nsScriptLoader.cpp;
/cvsroot/mozilla/content/base/src/nsScriptLoader.cpp,v <-- nsScriptLoader.cpp
new revision: 1.72; previous revision: 1.71
done
Checking in content/base/src/nsScriptLoader.h;
/cvsroot/mozilla/content/base/src/nsScriptLoader.h,v <-- nsScriptLoader.h
new revision: 1.10; previous revision: 1.9
done
Checking in content/xul/document/src/nsXULDocument.cpp;
/cvsroot/mozilla/content/xul/document/src/nsXULDocument.cpp,v <--
nsXULDocument.cpp
new revision: 1.659; previous revision: 1.658
done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•20 years ago
|
Keywords: helpwanted
| Assignee | ||
Comment 16•20 years ago
|
||
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•