Last Comment Bug 688547 - Use Element* for nsIDocument::{SetSubDocumentFor,FindContentForSubDocument}
: Use Element* for nsIDocument::{SetSubDocumentFor,FindContentForSubDocument}
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla10
Assigned To: :Ms2ger
:
Mentors:
Depends on: 688544
Blocks: 690372
  Show dependency treegraph
 
Reported: 2011-09-22 11:37 PDT by :Ms2ger
Modified: 2011-10-30 05:33 PDT (History)
3 users (show)
Ms2ger: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (10.37 KB, patch)
2011-09-22 11:37 PDT, :Ms2ger
peterv: review+
Details | Diff | Review

Description :Ms2ger 2011-09-22 11:37:10 PDT
Created attachment 561807 [details] [diff] [review]
Patch v1
Comment 1 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-09-22 12:00:43 PDT
I have to ask... why do we have this at all?  Can we just have nsIDocument hold a ref to its relevant frame element, if any?
Comment 2 :Ehsan Akhgari (out sick) 2011-10-15 13:41:55 PDT
peterv: ping?
Comment 3 Peter Van der Beken [:peterv] 2011-10-17 07:00:46 PDT
Comment on attachment 561807 [details] [diff] [review]
Patch v1

Review of attachment 561807 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/base/public/nsIDocument.h
@@ +516,5 @@
>  
>    /**
>     * Get the sub document for aContent
>     */
> +  virtual nsIDocument *GetSubDocumentFor(nsIContent* aContent) const = 0;

I dislike formatting-only changes like this. (And shouldn't you have changed the |nsIDocument *|?)

@@ +521,5 @@
>  
>    /**
>     * Find the content node for which aDocument is a sub document.
>     */
> +  virtual Element* FindContentForSubDocument(nsIDocument *aDocument) const = 0;

And I especially don't understand why you'd not do the formatting change here.

::: content/base/src/nsDocument.cpp
@@ +3272,5 @@
>      const_cast<SubDocMapEntry *>
>                (static_cast<const SubDocMapEntry *>(entry));
>  
> +  e->mKey = const_cast<Element*>
> +                      (static_cast<const Element*>(key));

Rewrap.

Note You need to log in before you can comment on or make changes to this bug.