mozjs78/backport-CVE-2023-25736-remove-useless-static_cast-r-mccr8.patch
2025-05-18 17:11:07 +00:00

36 lines
1.3 KiB
Diff

From 57d312791ac30f049de79abfb12e1b65a5c9b738 Mon Sep 17 00:00:00 2001
From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Fri, 20 Jan 2023 16:34:12 +0000
Subject: [PATCH] remove useless static_cast, r=mccr8
Conflict:NA
Reference:https://hg.mozilla.org/integration/autoland/rev/84398671e7e1872f3ddf17f28b3f87905c6bd3d8
---
dom/base/Selection.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dom/base/Selection.cpp b/dom/base/Selection.cpp
index eb70edcc31..cd3164e392 100644
--- a/dom/base/Selection.cpp
+++ b/dom/base/Selection.cpp
@@ -442,14 +442,13 @@ static nsresult GetTableSelectionMode(const nsRange& aRange,
return NS_OK;
}
- nsIContent* startContent = static_cast<nsIContent*>(startNode);
- if (!(startNode->IsElement() && startContent->IsHTMLElement())) {
+ if (!startNode->IsHTMLElement()) {
// Implies a check for being an element; if we ever make this work
// for non-HTML, need to keep checking for elements.
return NS_OK;
}
- if (startContent->IsHTMLElement(nsGkAtoms::tr)) {
+ if (startNode->IsHTMLElement(nsGkAtoms::tr)) {
*aTableSelectionType = TableSelectionMode::Cell;
} else // check to see if we are selecting a table or row (column and all
// cells not done yet)
--
2.33.0