Closed
Bug 333673
Opened 19 years ago
Closed 16 years ago
document.implementation != document.implementation
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: erik, Assigned: smaug)
Details
Attachments
(2 files)
5.47 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
6.05 KB,
patch
|
Details | Diff | Splinter Review |
Why doesn't multiple read of document.implementation return the same object?
Updated•16 years ago
|
Assignee: general → nobody
QA Contact: ian → general
Assignee | ||
Comment 1•16 years ago
|
||
Attachment #396221 -
Flags: review?(peterv)
Assignee | ||
Updated•16 years ago
|
Assignee: nobody → Olli.Pettay
Comment 2•16 years ago
|
||
Comment on attachment 396221 [details] [diff] [review]
parity with other engines
>+ if (mDOMImplementation) {
>+ NS_ADDREF(*aImplementation = mDOMImplementation);
>+ return NS_OK;
>+ }
> nsCOMPtr<nsIURI> uri;
> NS_NewURI(getter_AddRefs(uri), "about:blank");
> NS_ENSURE_TRUE(uri, NS_ERROR_OUT_OF_MEMORY);
> PRBool hasHadScriptObject = PR_TRUE;
> nsIScriptGlobalObject* scriptObject =
> GetScriptHandlingObject(hasHadScriptObject);
> NS_ENSURE_STATE(scriptObject || !hasHadScriptObject);
> *aImplementation = new nsDOMImplementation(scriptObject, uri, uri,
> NodePrincipal());
> if (!*aImplementation) {
> return NS_ERROR_OUT_OF_MEMORY;
> }
>
>+ mDOMImplementation = *aImplementation;
> NS_ADDREF(*aImplementation);
I think I'd rather see this as:
if (!mDOMImplementation) {
nsCOMPtr<nsIURI> uri;
NS_NewURI(getter_AddRefs(uri), "about:blank");
NS_ENSURE_TRUE(uri, NS_ERROR_OUT_OF_MEMORY);
PRBool hasHadScriptObject = PR_TRUE;
nsIScriptGlobalObject* scriptObject =
GetScriptHandlingObject(hasHadScriptObject);
NS_ENSURE_STATE(scriptObject || !hasHadScriptObject);
mDOMImplementation = new nsDOMImplementation(scriptObject, uri, uri,
NodePrincipal());
if (!mDOMImplementation) {
return NS_ERROR_OUT_OF_MEMORY;
}
}
NS_ADDREF(*aImplementation = mDOMImplementation);
return NS_OK;
Attachment #396221 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 3•16 years ago
|
||
Assignee | ||
Comment 4•16 years ago
|
||
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•