-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[popover] Using shadow DOM wrongly auto-hides popover by light dismiss #16234
[popover] Using shadow DOM wrongly auto-hides popover by light dismiss #16234
Conversation
EWS run on previous version of this PR (hash 59f2c6c) |
Source/WebCore/dom/Document.cpp
Outdated
for (auto& element : lineageOfType<HTMLElement>(*startElement)) { | ||
if (!clickedPopover && isShowingAutoPopover(element)) | ||
clickedPopover = &element; | ||
for (auto* element = startElement; element; element = element->parentElementInComposedTree()) { |
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.
Unfortunate that we donβt have a lineageOfType
function that works with the composed tree.
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.
Please also use RefPtr here.
Source/WebCore/dom/Document.cpp
Outdated
if (!is<HTMLElement>(element)) | ||
continue; | ||
|
||
auto* htmlElement = downcast<HTMLElement>(element); |
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.
Two choices that are better style: use dynamicDowncast
and check for nullptr
rather than using both is and downcast
, or use is
and downcast
, but pass a reference instead of a pointer to downcast
.
59f2c6c
to
4902c27
Compare
EWS run on current version of this PR (hash 4902c27) |
https://bugs.webkit.org/show_bug.cgi?id=259261 rdar://112410375 Reviewed by Ryosuke Niwa and Darin Adler. Use the flat tree as mandated by the spec when calculating which popover to light dismiss: - https://html.spec.whatwg.org/#topmost-clicked-popover - https://html.spec.whatwg.org/#nearest-inclusive-open-popover - https://html.spec.whatwg.org/#nearest-inclusive-target-popover-for-invoker * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-light-dismiss-flat-tree-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-light-dismiss-flat-tree.html: Added. * Source/WebCore/dom/Document.cpp: (WebCore::Document::handlePopoverLightDismiss): Canonical link: https://commits.webkit.org/266457@main
4902c27
to
9336846
Compare
Committed 266457@main (9336846): https://commits.webkit.org/266457@main Reviewed commits have been landed. Closing PR #16234 and removing active labels. |
9336846
4902c27
π wincairoπ§ͺ wpe-wk2π§ͺ ios-wk2-wptπ§ͺ gtk-wk2