mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Bug 1397178 - Make EditorBase::GetRoot() not call nsIEditor::GetRootElement() r=smaug
In the old design, EditorBase::mRootElement is initialized when nsIEditor::GetRootElement() is called. Therefore, EditorBase::GetRoot() calls if mRootElement is nullptr. However, mRootElement is now initialized when EditorBase::UpdateRootElement() is called and it's always initialized when EditorBase::Init() is called. So, EditorBase::GetRoot() doesn't need to call nsIEditor::GetRootElement() anymore. MozReview-Commit-ID: 6dNEJaGNMZe --HG-- extra : rebase_source : ed29488cfd1434fb200387706ca5a96cb2185090
This commit is contained in:
parent
0627f8b207
commit
7fb91d43b5
@ -972,16 +972,7 @@ public:
|
||||
/**
|
||||
* Fast non-refcounting editor root element accessor
|
||||
*/
|
||||
Element* GetRoot()
|
||||
{
|
||||
if (!mRootElement) {
|
||||
// Let GetRootElement() do the work
|
||||
nsCOMPtr<nsIDOMElement> root;
|
||||
GetRootElement(getter_AddRefs(root));
|
||||
}
|
||||
|
||||
return mRootElement;
|
||||
}
|
||||
Element* GetRoot() const { return mRootElement; }
|
||||
|
||||
/**
|
||||
* Likewise, but gets the editor's root instead, which is different for HTML
|
||||
|
Loading…
Reference in New Issue
Block a user