Bug 1931736. Add missing braces around if/loop statements in layout/forms/. r=layout-reviewers,emilio

Depends on D229246

Differential Revision: https://phabricator.services.mozilla.com/D229247
This commit is contained in:
Jonathan Watt
2024-11-17 05:03:58 +00:00
parent e0f5a09cba
commit 89c1154d34
4 changed files with 31 additions and 11 deletions

View File

@@ -270,7 +270,9 @@ nsresult nsTextControlFrame::EnsureEditorInitialized() {
// never get used. So, now this method is being called lazily only
// when we actually need an editor.
if (mEditorHasBeenInitialized) return NS_OK;
if (mEditorHasBeenInitialized) {
return NS_OK;
}
Document* doc = mContent->GetComposedDoc();
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
@@ -862,7 +864,9 @@ nsresult nsTextControlFrame::SetSelectionEndPoints(
uint32_t aSelStart, uint32_t aSelEnd, SelectionDirection aDirection) {
NS_ASSERTION(aSelStart <= aSelEnd, "Invalid selection offsets!");
if (aSelStart > aSelEnd) return NS_ERROR_FAILURE;
if (aSelStart > aSelEnd) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsINode> startNode, endNode;
uint32_t startOffset, endOffset;