mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 19:56:30 +00:00
LibWeb: Indicate focus on contenteditable elements
This mirrors what Chrome and Firefox do.
This commit is contained in:
parent
05d6090fcc
commit
3a741b0ce6
Notes:
github-actions[bot]
2025-08-20 09:37:31 +00:00
Author: https://github.com/gmta
Commit: 3a741b0ce6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5920
3 changed files with 4 additions and 1 deletions
|
@ -4078,7 +4078,7 @@ bool Element::should_indicate_focus() const
|
|||
|
||||
// * If the element which supports keyboard input (such as an input element, or any other element that would
|
||||
// triggers a virtual keyboard to be shown on focus if a physical keyboard were not present), indicate focus.
|
||||
if (is<HTML::FormAssociatedTextControlElement>(this))
|
||||
if (is<HTML::FormAssociatedTextControlElement>(this) || is_editable_or_editing_host())
|
||||
return true;
|
||||
|
||||
// * If the user interacts with the page via keyboard or some other non-pointing device, indicate focus. (This means
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
INPUT: rgb(0, 0, 0) auto 3px
|
||||
BUTTON: rgb(0, 0, 0) 0px
|
||||
DIV: rgb(0, 0, 0) auto 3px
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<input value="foo"><br>
|
||||
<button>bar</button>
|
||||
<div contenteditable>baz</div>
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
|
@ -13,5 +14,6 @@ test(() => {
|
|||
|
||||
runOutlineTest('input');
|
||||
runOutlineTest('button');
|
||||
runOutlineTest('div[contenteditable]');
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue