-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LibWeb: Prevent a popover crash and implement popovertarget #3285
base: master
Are you sure you want to change the base?
Conversation
Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest |
5e9dabe
to
6931acb
Compare
auto const* popover_invoker_element = dynamic_cast<PopoverInvokerElement const*>(node.ptr()); | ||
GC::Ptr<HTMLElement> popover_element = verify_cast<HTMLElement>(popover_invoker_element->m_popover_target_element.ptr()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If node
isn't a PopoverInvokerElement
, this is a null dereference.
If we know it is one, then use verify_cast
instead of dynamic_cast
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That function is only ever called on FormAssociatedElement
s which are also PopoverInvokerElement
s, so neither dynamic_cast
should fail. I don't know how to convince the compiler that a verify_cast
is valid, so the best I can do is a VERIFY(popover_invoker_element)
.
Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest |
Using whatwg/html#9457 (with some changes made to catch up with the current spec) to fix a spec bug and a crash when removing a visible popover.
The first commit is based on whatwg/html#9457 and prevents a crash when removing a visible popover.
That spec PR hasn't been merged yet and is currently slightly outdated, but the changes are spread throughout the code so I'm not sure what the best place to add a
FIXME
/AD-HOC
would be.The second commit implements
popovertarget
buttons (and includes a change to top layer elements to prevent a crash when hiding and showing a popover in the same frame).This PR also fixes 29 crashing tests and gains at least 1656 new subtest passes.
(I may start a followup PR to update and implement the remaining parts of the popover spec)