mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibWeb: Don't compare the focus chain's GC::Root contents by reference
The focus chain always consists of newly created GC::Root objects, so the condition always produced `false`. The fix is to use GC::Root's overloaded operator== method, which compares the pointers of the stored type. This fixes Figma dropdowns and context menus instantly disappearing upon opening them. This is because they become focused when they insert them. Because of this bug, it would fire blur events all the way up to and including the window. Figma listens for the blur event on the window, and when received, it will instantly hide dropdowns and context menus. The intention behind this seems to be hiding them when the user clicks off the browser window, or switches tab.
This commit is contained in:
parent
fac88b698f
commit
bf34b63439
Notes:
github-actions[bot]
2025-01-30 18:31:37 +00:00
Author: https://github.com/Lubrsi
Commit: bf34b63439
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3408
4 changed files with 89 additions and 4 deletions
|
@ -44,7 +44,7 @@ static void run_focus_update_steps(Vector<GC::Root<DOM::Node>> old_chain, Vector
|
|||
// pop the last entry from old chain and the last entry from new chain and redo this step.
|
||||
while (!old_chain.is_empty()
|
||||
&& !new_chain.is_empty()
|
||||
&& &old_chain.last() == &new_chain.last()) {
|
||||
&& old_chain.last() == new_chain.last()) {
|
||||
(void)old_chain.take_last();
|
||||
(void)new_chain.take_last();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue