domstubs.idl should not include nsAString.h

VERIFIED FIXED

Status

()

Core
DOM: Core & HTML
VERIFIED FIXED
14 years ago
7 years ago

People

(Reporter: Marco Pesenti Gritti, Assigned: Marco Pesenti Gritti)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

14 years ago
As per #238088 nsStringAPI.h and nsAString.h conflicts. nsAString.h should only
be used by files in the mozilla codebase.
Including it in domstubs.idl we make impossible to use nsIDOMXXX and
nsEmbedString contemporarily by embedding applications.
This makes the frozen DOM interfaces unusable with the SDK.
Flags: blocking1.7?
(Assignee)

Comment 2

14 years ago
Is the Truncate () necessary ?

nsTSubstring SetIsVoid (PR_TRUE) method seem to be doing it already
http://lxr.mozilla.org/mozilla/source/xpcom/string/src/nsTSubstring.cpp#485

Also there is similar SetToNull code without the Truncate () call
http://lxr.mozilla.org/mozilla/source/extensions/webservices/soap/src/nsSOAPUtils.h#175

If so would s/DOMStringIsNull/IsVoid s/SetDOMStringToNull/SetIsVoid(TRUE) be
considered an acceptable solution ? I dont see disadvantages in using the string
api directly but I'm not familiar with either DOM or string code.
The disadvantage to using the string API directly is that it's not frozen so we
don't guarantee binary compatibility.
The easiest solution is probably to move these helpers elsewhere, into something
not included by frozen headers.
(Assignee)

Comment 5

14 years ago
Ok, I looked in the dom headers and I couldnt find any good candidate.
Suggestions are welcome.
Maybe nsDOMUtils.cpp/.h is in order ? (IHMO at that point getting rid of the
helpers and use the aString.IsVoid/SetIsVoid in the mozilla DOM implementation
would be cleaner, at least if Truncate() is redundant).
(Assignee)

Comment 6

14 years ago
Created attachment 145028 [details] [diff] [review]
Move the helpers out to nsDOMString.h

I did not use nsDOMUtils.h because there is a file with the same name in
extensions/
(Assignee)

Updated

14 years ago
Attachment #145028 - Flags: superreview?(jst)
Attachment #145028 - Flags: review?(bsmedberg)
Comment on attachment 145028 [details] [diff] [review]
Move the helpers out to nsDOMString.h

+inline void SetDOMStringToNull(nsAString& aString)
+{
+  aString.Truncate();
+  aString.SetIsVoid(PR_TRUE);
+}

Seems like you can remove the call to Truncate(), as you mentioned earlier.

sr=jst for making this change, I'm sure we'll find more helpers to add to this
header file as we move forward...
Attachment #145028 - Flags: superreview?(jst) → superreview+
Attachment #145028 - Flags: review?(bsmedberg)
Attachment #145028 - Flags: review+
Attachment #145028 - Flags: approval1.7?
(Assignee)

Comment 8

14 years ago
Created attachment 145082 [details] [diff] [review]
Updated patch without Truncate() as request by jst
Attachment #145028 - Flags: approval1.7? → approval1.7+

Comment 9

14 years ago
fixed-on-trunk for 1.7 final
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED

Updated

14 years ago
Flags: blocking1.7?

Updated

9 years ago
Component: DOM: Core → DOM: Core & HTML
QA Contact: ian → general
V. based on code inspection.
Assignee: general → mpgritti
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.