[webkit-reviews] review granted: [Bug 190977] '-webkit-user-select: all' is not respected in editable views : [Attachment 353313] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Nov 5 19:15:32 PST 2018
Ryosuke Niwa <rniwa at webkit.org> has granted Tim Horton <thorton at apple.com>'s
request for review:
Bug 190977: '-webkit-user-select: all' is not respected in editable views
https://bugs.webkit.org/show_bug.cgi?id=190977
Attachment 353313: Patch
https://bugs.webkit.org/attachment.cgi?id=353313&action=review
--- Comment #22 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 353313
--> https://bugs.webkit.org/attachment.cgi?id=353313
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=353313&action=review
r=me once the following amendments are made.
> Source/WebCore/html/HTMLElement.cpp:407
> if (auto* startElement = is<Element>(node) ? &downcast<Element>(node) :
node.parentElement()) {
> for (auto& element : lineageOfType<HTMLElement>(*startElement)) {
This loop has the same issue as computeEditabilityFromComputedStyle.
You need to add a check for documentIsEditable before the switch.
Also, please add a test (add a test where the web view is editable & there is a
contenteditable=false content.
Make sure that content is editable. We should also add a test for
-webkit-user-modify at the same time too.
> Source/WebCore/html/HTMLElement.cpp:433
> - return editabilityFromContentEditableAttr(*this) !=
Editability::ReadOnly;
> + return editabilityFromContentEditableAttr(*this, false) !=
Editability::ReadOnly;
Please add an enum class instead of using a boolean like this.
> LayoutTests/ChangeLog:10
> + * editing/selection/user-select-all-in-editable-view-expected.txt:
Added.
> + * editing/selection/user-select-all-in-editable-view.html: Added.
A better place to put more tests I'm asking you to add would be
LayoutTests/editing/editability/
But I suppose these tests could stay here.
> LayoutTests/editing/selection/user-select-all-in-editable-view.html:4
> +<p id="description">This tests that moving the cursor inside a 'user-select:
all' element expands the selection to the entire element. The cursor should not
end up inside the 'user-select: all' element, but rather in the middle of
"after".</p>
Please add an instruction on how to run this test manually in the browser.
e.g. you can execute setBaseAndExtent outside testRunner / UI helper check.
Otherwise, it's gonna be really hard to verify that it works in the browser
later.
More information about the webkit-reviews
mailing list