Skip to content

Commit

Permalink
Use previous_html_element_weak_ for pointer out events
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsavage1 committed Aug 7, 2023
1 parent 3623b78 commit b1f8939
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cobalt/layout/topmost_event_target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ void SendStateChangeLeaveEvents(
for (scoped_refptr<dom::Element> element = previous_element;
element && element != nearest_common_ancestor;
element = element->parent_element()) {
DCHECK(element->AsHTMLElement()->IsDesignated());
if (!element->AsHTMLElement()->IsDesignated()) {
DCHECK(false);
}
element->DispatchEvent(new dom::PointerEvent(
base::Tokens::pointerleave(), web::Event::kNotBubbles,
web::Event::kNotCancelable, view, *event_init));
Expand All @@ -274,7 +276,9 @@ void SendStateChangeLeaveEvents(
for (scoped_refptr<dom::Element> element = previous_element;
element && element != nearest_common_ancestor;
element = element->parent_element()) {
DCHECK(element->AsHTMLElement()->IsDesignated());
if (!element->AsHTMLElement()->IsDesignated()) {
DCHECK(false);
}
element->DispatchEvent(new dom::MouseEvent(
base::Tokens::mouseleave(), web::Event::kNotBubbles,
web::Event::kNotCancelable, view, *event_init));
Expand Down Expand Up @@ -607,7 +611,7 @@ void TopmostEventTarget::HandleScrollState(

scoped_refptr<dom::HTMLElement> previous_html_element(
previous_html_element_weak_);
DispatchPointerEventsForScrollStart(target_element, event_init);
DispatchPointerEventsForScrollStart(previous_html_element, event_init);
pointer_state->SetWasCancelled(pointer_id);
pointer_state->ClearPendingPointerCaptureTargetOverride(pointer_id);

Expand Down

0 comments on commit b1f8939

Please sign in to comment.