Masayuki Nakano b2e135f779 Bug 1845445 - Make ContentEventHandler::ShouldBreakLineBefore use nsHTMLTag instead of nsINode::IsAnyOfHTMLElements with a lot of params r=smaug
It's expensive to call `nsINode::IsAnyOfHTMLElements` with a lot of arguments
due to its recursive calls (in this case, called with 30 arguments).

Additionally, the unknown element check with `do_QueryObject` is also expensive.

Once we get an `nsHTMLTag`, we can use a `switch` statement.

Note that I realized `nsHTMLTag_small` is not defined only on Windows if
`nsHTMLTags.h` is included after `rpcndr.h` in the Windows SDK since there is
```
#define small char
```

In the header file.  This patch includes the workaround for this issue.

Differential Revision: https://phabricator.services.mozilla.com/D184553
2023-08-09 02:31:50 +00:00
..