Closed Bug 1845445 Opened 1 year ago Closed 1 year ago

Make `ContentEventHandler::ShouldBreakLineBefore` stop using `IsAnyOfHTMLElements`

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P2)

defect

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [sp3])

Attachments

(1 file)

The call is with 30 params and it appears in the profile. Additionally, the call of do_QueryObject also appears in the profile.

With using nsHTMLTags, we can solve these performance issue with the cost of accessing the hash table.

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.

Whiteboard: [sp3]
Attachment #9345727 - Attachment description: Bug 1845445 - Make `ContentEventHandler::ShouldBreakLineBefore` use `nsHTMLTag` instead of `nsINode::IsAnyOfHTMLElements` with a lot of params r=#dom-core → Bug 1845445 - Make `ContentEventHandler::ShouldBreakLineBefore` use `nsHTMLTag` instead of `nsINode::IsAnyOfHTMLElements` with a lot of params r=smaug!,#dom-core
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/25a29224e55d Make `ContentEventHandler::ShouldBreakLineBefore` use `nsHTMLTag` instead of `nsINode::IsAnyOfHTMLElements` with a lot of params r=smaug
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: