This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
isContentEditable returns false for
…ements, but true for children https://bugs.webkit.org/show_bug.cgi?id=240834 Reviewed by Ryosuke Niwa. * Source/WebCore/dom/Node.cpp: (WebCore::computeEditabilityFromComputedStyle): Remove a `display: none` check. This check is wrong for two reasons: 1) It only consults the style of the immediate element, not whether or not that element is in a `display: none` subtree. This regressed in r160966. This causes a confusing situation where `display: none` affects the editability of only the element it is directly applied to. 2) isContentEditable is not specified to be affected by `display: none`. * LayoutTests/editing/editability/isContentEditable-in-display-none-expected.txt: Added. * LayoutTests/editing/editability/isContentEditable-in-display-none.html: Added. Add a test that dumps the editability of a variety of different configurations of contenteditable elements and their children. Before this change, this test would have said that #nonVisible (the display: none contenteditable element) was read-only, but its child <p> was editable. Now we agree with Gecko and Blink who both say that both are editable. * LayoutTests/fast/events/event-input-contentEditable-expected.txt: * LayoutTests/fast/events/event-input-contentEditable.html: Adjust this test to expect an input event to be dispatched for programmatic editing in display: none elements. Also add a sub-test that checks the same, but in a child element. Before this change, we would not dispatch an input event to the display: none contenteditable itself, but *would* dispatch an input event for input into a child element. Now we agree with Gecko, who dispatch events in both cases. Canonical link: https://commits.webkit.org/250921@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing 5 changed files with 86 additions and 7 deletions.