Closed
Bug 542632
Opened 15 years ago
Closed 15 years ago
Protect nsGenericHTMLElement::GetHrefURIForAnchors
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a2
People
(Reporter: sdwilsh, Assigned: sdwilsh)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
We should protect it so consumers no longer access it. This also makes the dns prefetch code use the cached URI.
Attachment #423857 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•15 years ago
|
Depends on: async-visited-check
Comment 1•15 years ago
|
||
>+ Link *link = static_cast<Link *>(static_cast<nsISupports *>(content.get()));
Why is this cast ok?
Assignee | ||
Comment 2•15 years ago
|
||
Because we only ever add Link elements to this queue, which are stored as weak references. We QI the weak reference to nsIContent, so we can test if it is in the document (and exists). We already know it's a Link for sure (we added it), so we have to cast down to nsISupports since that is what Link inherits from, and then cast to Link.
Comment 3•15 years ago
|
||
> so we have to cast down to nsISupports since that is what Link inherits from,
> and then cast to Link
But the nsISupports that nsIContent inherits from (and casts to) is not the same as the nsISupports Link inherits from, is it?
I would fully expect this code to either crash or behave really oddly if actually executed.
Assignee | ||
Comment 4•15 years ago
|
||
Bah, that's right. What's the right way to get to Link in this case? Do I have to add an IID for it to QI to?
Comment 5•15 years ago
|
||
That seems like the simplest way to go...
Assignee | ||
Comment 6•15 years ago
|
||
Darn, OK. New patch soon.
Assignee | ||
Comment 7•15 years ago
|
||
I'm actually not sure how to do this QI and not destroy the other QI's. Thoughts?
Comment 8•15 years ago
|
||
Destroy in what sense?
Assignee | ||
Comment 9•15 years ago
|
||
Nevermind. I wasn't thinking. The classes that implement Link do the QI implementation.
Assignee | ||
Comment 10•15 years ago
|
||
I tried making that far harder than it had to be...
Attachment #423857 -
Attachment is obsolete: true
Attachment #426369 -
Flags: review?(bzbarsky)
Attachment #423857 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 11•15 years ago
|
||
Comment on attachment 426369 [details] [diff] [review]
v1.1
Build finished, but this patch isn't right. Arg (startup crash dereferencing a null pointer)
Attachment #426369 -
Attachment is obsolete: true
Attachment #426369 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 12•15 years ago
|
||
OK, this one actually runs.
Attachment #426386 -
Flags: review?(bzbarsky)
Comment 13•15 years ago
|
||
Comment on attachment 426386 [details] [diff] [review]
v1.2
>+++ b/content/html/content/src/nsHTMLAnchorElement.cpp
> NS_HTML_CONTENT_INTERFACE_TABLE4(nsHTMLAnchorElement,
Needs to become TABLE5.
r=bzbarsky
Attachment #426386 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 14•15 years ago
|
||
(In reply to comment #13)
> Needs to become TABLE5.
Fixed locally.
Assignee | ||
Comment 15•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a2
Version: unspecified → Trunk
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
•