Closed Bug 1834002 Opened 1 year ago Closed 1 year ago

Avoid InvalidateFrameSubtree in HTMLInputElement::SetCheckedInternal

Categories

(Core :: DOM: Core & HTML, task)

task

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: mstange, Assigned: smaug, NeedInfo)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [sp3])

Attachments

(1 file)

The call to InvalidateFrameSubtree shows up in TodoMVC-Svelte profiles under inputElement.click(): https://share.firefox.dev/3BIh6uF

It's not much, but any amount we can shave off from this profile is valuable.

https://searchfox.org/mozilla-central/rev/2ca95198a2a0806de358a0484d96d4354e3cbaab/dom/html/HTMLInputElement.cpp#2954-2965

void HTMLInputElement::SetCheckedInternal(bool aChecked, bool aNotify) {
  // Set the value
  mChecked = aChecked;

  // Notify the frame
  if (mType == FormControlType::InputCheckbox ||
      mType == FormControlType::InputRadio) {
    nsIFrame* frame = GetPrimaryFrame();
    if (frame) {
      frame->InvalidateFrameSubtree();
    }
  }

Can this be replaced with SchedulePaint() / DLBI?

Flags: needinfo?(tnikkel)

Or the UpdateState call below should be enough, no?

Component: Web Painting → DOM: Core & HTML
Attachment #9350823 - Attachment description: WIP: Bug 1834002 - Avoid InvalidateFrameSubtree in HTMLInputElement::SetCheckedInternal, r=emilio → Bug 1834002 - Avoid InvalidateFrameSubtree in HTMLInputElement::SetCheckedInternal, r=emilio
Assignee: nobody → smaug
Status: NEW → ASSIGNED
Blocks: 1834003
Pushed by opettay@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8bfc7a975567 Avoid InvalidateFrameSubtree in HTMLInputElement::SetCheckedInternal, r=emilio
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: