Bug 1460509 - part 57: Mark HTMLEditRules::AlignInnerBlocks() as MOZ_MUST_USE since it may cause destroying the editor r=m_kato

MozReview-Commit-ID: 8hBJPn1shZu

--HG--
extra : rebase_source : 2df70cd07015fa0895a5d7540c1179107088a8e2
This commit is contained in:
Masayuki Nakano 2018-05-16 14:54:33 +09:00
Родитель 7fd1c21f25
Коммит c97adaf670
2 изменённых файлов: 18 добавлений и 8 удалений

Просмотреть файл

@ -5872,10 +5872,15 @@ HTMLEditRules::WillAlign(const nsAString& aAlignType,
continue;
}
if (HTMLEditUtils::IsList(atCurNode.GetContainer())) {
// If we don't use CSS, add a contraint to list element: they have to
// be inside another list, i.e., >= second level of nesting
// If we don't use CSS, add a content to list element: they have to
// be inside another list, i.e., >= second level of nesting.
// XXX AlignInnerBlocks() handles list item elements and table cells.
// Is it intentional to change alignment of nested other type
// descendants too?
rv = AlignInnerBlocks(*curNode, aAlignType);
NS_ENSURE_SUCCESS(rv, rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
curDiv = nullptr;
continue;
}
@ -5924,10 +5929,6 @@ HTMLEditRules::WillAlign(const nsAString& aAlignType,
return NS_OK;
}
/**
* AlignInnerBlocks() aligns inside table cells or list items.
*/
nsresult
HTMLEditRules::AlignInnerBlocks(nsINode& aNode,
const nsAString& aAlignType)

Просмотреть файл

@ -401,7 +401,16 @@ protected:
*/
MOZ_MUST_USE nsresult DidAbsolutePosition();
nsresult AlignInnerBlocks(nsINode& aNode, const nsAString& aAlignType);
/**
* AlignInnerBlocks() calls AlignBlockContents() for every list item element
* and table cell element in aNode.
*
* @param aNode The node whose descendants should be aligned
* to aAlignType.
* @param aAlignType New value of align attribute of <div>.
*/
MOZ_MUST_USE nsresult
AlignInnerBlocks(nsINode& aNode, const nsAString& aAlignType);
/**
* AlignBlockContents() sets align attribute of <div> element which is