Repository navigation
:focus pseudo class fails to repaint on a shadow host when focus moves from outside the page inside a shadow tree - #2047
Conversation
There was a problem hiding this comment.
Not new, but we’re null checking renderer twice. I suggest:
if (auto* renderer = element->renderer(); renderer && renderer->style().hasEffectiveAppearance())
There was a problem hiding this comment.
Would it be better to call containingShadowRoot and null check it rather than checking isInShadowTree and relying on the relationship between these two checks?
There was a problem hiding this comment.
Also seems like a helper function for walking up to the containing shadow root's host could make this code a lot easier to read. That idiom must have come up elsewhere.
There was a problem hiding this comment.
Oh, actually we have such a function: Node::shadowHost. Will use that instead.
…s from outside the page inside a shadow tree https://bugs.webkit.org/show_bug.cgi?id=205531 Reviewed by Simon Fraser, Darin Adler and Wenson Hsieh. The bug was caused by FrameSelection::focusedOrActiveStateChanged only invalidating the style of the focused element. Invalidate each outer shadow host when the focus status changes to fix the bug. * Source/WebCore/editing/FrameSelection.cpp: (WebCore::FrameSelection::focusedOrActiveStateChanged): Fixed the bug. * Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.h: * Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm: (WTR::UIScriptControllerCocoa::becomeFirstResponder): Moved to UIScriptControllerIOS. (WTR::UIScriptControllerCocoa::resignFirstResponder): Ditto. * Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h: * Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm: (WTR::UIScriptControllerIOS::becomeFirstResponder): Moved from UIScriptControllerCocoa. (WTR::UIScriptControllerIOS::resignFirstResponder): Ditto. * Tools/WebKitTestRunner/mac/UIScriptControllerMac.h: * Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm: (WTR::UIScriptControllerMac::becomeFirstResponder): Added. (WTR::UIScriptControllerMac::resignFirstResponder): Added. * LayoutTests/fast/shadow-dom/focus-ring-on-shadow-host-expected.html: Added. * LayoutTests/fast/shadow-dom/focus-ring-on-shadow-host.html: Added. * LayoutTests/resources/ui-helper.js: (window.UIHelper.resignFirstResponder): Added the support for WebKit1. (window.UIHelper.becomeFirstResponder): Ditto. * LayoutTests/platform/gtk/TestExpectations: Skip the test as resignFirstResponder is not implemented on GTK+. * LayoutTests/platform/win/TestExpectations: Ditto on Windows. Canonical link: https://commits.webkit.org/252261@main
|
Committed 252261@main (e92078a): https://commits.webkit.org/252261@main Reviewed commits have been landed. Closing PR #2047 and removing active labels. |
There was a problem hiding this comment.
I don't think is the right place to do this (and we generally should not need to call invalidateStyleForSubtree at all, ever). There is already a shadow host loop in Element::setFocus. Why does that not cover this case?
There was a problem hiding this comment.
The focused element isn't changing here. It's the frame / window gaining or losing the focus.
There was a problem hiding this comment.
focus pseudo-class is flipping. We still need to invalidate correctly and preferably efficiently whatever the reason for flipping is.
There was a problem hiding this comment.
Continuing this discussion on https://bugs.webkit.org/show_bug.cgi?id=242526.
https://bugs.webkit.org/show_bug.cgi?id=312485 rdar://174932570 Reviewed by Yusuke Suzuki. Use value - trunc(value) == 0.0 for isInteger, which rejects NaN and Infinity without an explicit isFinite check since NaN - NaN and Inf - Inf both produce NaN. Add MacroAssembler::isDoubleInteger helper and use it in the DFG NumberIsInteger path, removing the manual exponent-bit extraction branch. Simplify the FTL NumberIsInteger path similarly using B3 IR. Remove redundant isFinite checks from DFG and FTL NumberIsSafeInteger, since the range check against maxSafeInteger already rejects Infinity. On ARM64 the difference in codegen is roughly: isIntegerOld(double): frintz d1, d0 fmov x8, d0 mov w9, WebKit#2047 ubfx x8, x8, WebKit#52, WebKit#11 fcmp d1, d0 ccmp x8, x9, WebKit#2, eq cset w0, lo ret isIntegerNew(double): frintz d1, d0 fsub d0, d0, d1 fcmp d0, #0.0 cset w0, eq ret No new tests, no behavior change. Covered by existing tests. Canonical link: https://commits.webkit.org/311413@main
e92078a