|
|
Created:
4 years, 5 months ago by yoichio Modified:
4 years, 5 months ago CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionContenteditable w/ "-webkit-user-select:all" should be editable.
<div id ="div" style="-webkit-user-select:all" contenteditable="true"></div>
should be editable.
In this CL, we ignore "-webkit-user-select:all" if element has
|contenteditable="true| in
Node::hasEditableStyle and expandSelection by user click.
BUG=618920
TEST=editing/selection/user-select/user-select-all-contenteditable.html, mouse/click-
user-select-all-textarea.html, user-select/user-select-all-contenteditable.html
Committed: https://crrev.com/d607a605c05ae726b55aa3a28b32c94a2ab597ff
Cr-Commit-Position: refs/heads/master@{#405440}
Patch Set 1 #Patch Set 2 : update #
Total comments: 6
Patch Set 3 : update #
Total comments: 8
Patch Set 4 : add selection test #
Total comments: 10
Patch Set 5 : update #Patch Set 6 : update #Patch Set 7 : update #
Messages
Total messages: 49 (18 generated)
Description was changed from ========== contenteditable is editable init BUG= ========== to ========== Contenteditable w/ "-webkit-user-select:all" should be editable. <div id ="div" style="-webkit-user-select:all" contenteditable="true"></div> should be editable. In this CL, we ignore "-webkit-user-select:all" if element has |contenteditable="true| in Node::hasEditableStyle and expandSelection by user click. BUG= ==========
Description was changed from ========== Contenteditable w/ "-webkit-user-select:all" should be editable. <div id ="div" style="-webkit-user-select:all" contenteditable="true"></div> should be editable. In this CL, we ignore "-webkit-user-select:all" if element has |contenteditable="true| in Node::hasEditableStyle and expandSelection by user click. BUG= ========== to ========== Contenteditable w/ "-webkit-user-select:all" should be editable. <div id ="div" style="-webkit-user-select:all" contenteditable="true"></div> should be editable. In this CL, we ignore "-webkit-user-select:all" if element has |contenteditable="true| in Node::hasEditableStyle and expandSelection by user click. BUG=618920 TEST=editing/selection/user-select/user-select-all-contenteditable.html ==========
yoichio@chromium.org changed reviewers: + yosin@chromium.org
https://codereview.chromium.org/2120913002/diff/20001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html (right): https://codereview.chromium.org/2120913002/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:9: eventSender.mouseMoveTo(div.offsetLeft, div.offsetTop + 5); Please use Selection API instead of using |eventSender| to run this test in other browsers. https://codereview.chromium.org/2120913002/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:13: assert_equals(div.innerText, "barfoo"); Can we use assert_selection()? https://codereview.chromium.org/2120913002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Node.cpp (right): https://codereview.chromium.org/2120913002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Node.cpp:560: const bool isContentEditable = node.isHTMLElement() && toHTMLElement(node).contentEditable() == "true"; We should not check "contentEditable" attribute. editability is defined by -webkit-user-modify. We need to support following case: <div contentEditable> ... <span style="user-select: all">this content is editable</span> ... </div>
update
Patchset #3 (id:40001) has been deleted
https://codereview.chromium.org/2120913002/diff/20001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html (right): https://codereview.chromium.org/2120913002/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:9: eventSender.mouseMoveTo(div.offsetLeft, div.offsetTop + 5); On 2016/07/06 07:56:48, Yosi_UTC9 wrote: > Please use Selection API instead of using |eventSender| to run this test in > other browsers. Done. https://codereview.chromium.org/2120913002/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:13: assert_equals(div.innerText, "barfoo"); On 2016/07/06 07:56:48, Yosi_UTC9 wrote: > Can we use assert_selection()? Done. https://codereview.chromium.org/2120913002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Node.cpp (right): https://codereview.chromium.org/2120913002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Node.cpp:560: const bool isContentEditable = node.isHTMLElement() && toHTMLElement(node).contentEditable() == "true"; On 2016/07/06 07:56:48, Yosi_UTC9 wrote: > We should not check "contentEditable" attribute. editability is defined by > -webkit-user-modify. > > We need to support following case: > > <div contentEditable> > ... > <span style="user-select: all">this content is editable</span> > ... > </div> Done.
https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html (right): https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:11: selection.collapse(selection.document.getElementById('div'), 0); Why not put "|" in test sample?
https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html (right): https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:11: selection.collapse(selection.document.getElementById('div'), 0); On 2016/07/07 08:59:48, Yosi_UTC9 wrote: > Why not put "|" in test sample? That's because "putting a caret inside the element" is a part of test.
https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html (right): https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:11: selection.collapse(selection.document.getElementById('div'), 0); On 2016/07/07 at 09:03:27, yoichio wrote: > On 2016/07/07 08:59:48, Yosi_UTC9 wrote: > > Why not put "|" in test sample? > > That's because "putting a caret inside the element" is a part of test. assert_selection() does for you. It is Selection#collapse() and Selection#extend(). Doing this is redundant. https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:12: selection.document.execCommand("insertText", false, "bar"); nit: s/"/'/g Since we make independent from "insertText" command behavior. How about checking HTMLElement.isContentEditable? Also, we may want to test in nested element case, e.g. elements in content editable w/o "contentEditable" attribute which was fixed in PS#2. BTW, what is result of Selection#extend() to attempt select partially in "user-select:all" content. It is better to have a test for "insertText" with "user-select:all" in editing/execCommand/insert_text_in_user_select_all.html.
update
https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html (right): https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:11: selection.collapse(selection.document.getElementById('div'), 0); On 2016/07/08 01:15:04, Yosi_UTC9 wrote: > On 2016/07/07 at 09:03:27, yoichio wrote: > > On 2016/07/07 08:59:48, Yosi_UTC9 wrote: > > > Why not put "|" in test sample? > > > > That's because "putting a caret inside the element" is a part of test. > > assert_selection() does for you. It is Selection#collapse() and > Selection#extend(). Doing this is redundant. This is not redundant. assert_selection("foo|bar",...) is preparation for test and should not be a part of test. If so, do you think assert_selection("foo|bar","noop","foo|bar") intents to test Selection.collapse()? Neither it doesn't look such that and I don't think so. https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:12: selection.document.execCommand("insertText", false, "bar"); On 2016/07/08 01:15:04, Yosi_UTC9 wrote: > nit: s/"/'/g > Done. > Since we make independent from "insertText" command behavior. > How about checking HTMLElement.isContentEditable? > Also, we may want to test in nested element case, e.g. elements in content > editable w/o "contentEditable" attribute which was fixed in PS#2. > > BTW, what is result of Selection#extend() to attempt select partially in > "user-select:all" content. > > It is better to have a test for "insertText" with "user-select:all" in > editing/execCommand/insert_text_in_user_select_all.html. This is a stable-blocker-regression that user can't type text in user-select:all and CE element. Ideally I want test to 'click' and 'enter key' other than JS selection API(thus I used eventSender).
https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html (right): https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:12: selection.document.execCommand("insertText", false, "bar"); On 2016/07/08 at 02:30:39, yoichio wrote: > On 2016/07/08 01:15:04, Yosi_UTC9 wrote: > > nit: s/"/'/g > > > Done. > > > Since we make independent from "insertText" command behavior. > > How about checking HTMLElement.isContentEditable? > > Also, we may want to test in nested element case, e.g. elements in content > > editable w/o "contentEditable" attribute which was fixed in PS#2. > > > > BTW, what is result of Selection#extend() to attempt select partially in > > "user-select:all" content. > > > > It is better to have a test for "insertText" with "user-select:all" in > > editing/execCommand/insert_text_in_user_select_all.html. > This is a stable-blocker-regression that user can't type text in user-select:all and CE element. > Ideally I want test to 'click' and 'enter key' other than JS selection API(thus I used eventSender). Stable-blocker or not isn't related to review. We should have following test case: - HTMLElement.isContentEditable - assert_selection for user-select:all - Selection#collapse - Selection#extend - Selection#setBaseAndExtend - Selection#addRange - Selection#modify - "InsertText" = No need to have Selection#collapse() - Mouse click If you expect to merge into release branch, it is OK to split C++ change and layout tests for ease of merging only C++ part.
update
Patchset #5 (id:90001) has been deleted
Patchset #4 (id:70001) has been deleted
https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html (right): https://codereview.chromium.org/2120913002/diff/60001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:12: selection.document.execCommand("insertText", false, "bar"); On 2016/07/08 05:21:02, Yosi_UTC9 wrote: > On 2016/07/08 at 02:30:39, yoichio wrote: > > On 2016/07/08 01:15:04, Yosi_UTC9 wrote: > > > nit: s/"/'/g > > > > > Done. > > > > > Since we make independent from "insertText" command behavior. > > > How about checking HTMLElement.isContentEditable? > > > Also, we may want to test in nested element case, e.g. elements in content > > > editable w/o "contentEditable" attribute which was fixed in PS#2. > > > > > > BTW, what is result of Selection#extend() to attempt select partially in > > > "user-select:all" content. > > > > > > It is better to have a test for "insertText" with "user-select:all" in > > > editing/execCommand/insert_text_in_user_select_all.html. > > This is a stable-blocker-regression that user can't type text in > user-select:all and CE element. > > Ideally I want test to 'click' and 'enter key' other than JS selection > API(thus I used eventSender). > > Stable-blocker or not isn't related to review. > We should have following test case: > - HTMLElement.isContentEditable > - assert_selection for user-select:all > - Selection#collapse > - Selection#extend > - Selection#setBaseAndExtend > - Selection#addRange > - Selection#modify > - "InsertText" = No need to have Selection#collapse() > - Mouse click > > If you expect to merge into release branch, it is OK to split C++ change and > layout tests for ease of merging only C++ part. > > Done.
https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html (right): https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:7: test(function(){ It seems there are not test for HTMLElement.isContentEditable. https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:10: selection => selection.collapse(selection.document.getElementById('div'), 0), Please use other than zero or adding another test using non-zero value. We would like to see we can set caret anywhere we want. https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:15: '<div contenteditable="true" id="div" style="-webkit-user-select:all">^foo|</div>'); We should check attempting partial selection becomes full selection, e.g. <div style="user-select:all">ab^cd|ef</div> => selecting "cd" becomes "abcdef" <div style="user-select:all">^abcdef|</div> https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:64: var div = selection.document.getElementById('div'); Please add assert_not_undefined(window.eventSender, 'this test requires window.eventSender');
https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html (right): https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:60: test(function(){ Could you move this test case to another file to upstream other test cases?
update
Patchset #5 (id:120001) has been deleted
https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html (right): https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:7: test(function(){ On 2016/07/08 09:30:50, Yosi_UTC9 wrote: > It seems there are not test for HTMLElement.isContentEditable. Done. https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:10: selection => selection.collapse(selection.document.getElementById('div'), 0), On 2016/07/08 09:30:50, Yosi_UTC9 wrote: > Please use other than zero or adding another test using non-zero value. > We would like to see we can set caret anywhere we want. Done. https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:15: '<div contenteditable="true" id="div" style="-webkit-user-select:all">^foo|</div>'); On 2016/07/08 09:30:50, Yosi_UTC9 wrote: > We should check attempting partial selection becomes full selection, e.g. > > <div style="user-select:all">ab^cd|ef</div> > => selecting "cd" becomes "abcdef" > <div style="user-select:all">^abcdef|</div> Done. https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:60: test(function(){ On 2016/07/11 01:38:41, Yosi_UTC9 wrote: > Could you move this test case to another file to upstream other test cases? Done. https://codereview.chromium.org/2120913002/diff/90002/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html:64: var div = selection.document.getElementById('div'); On 2016/07/08 09:30:50, Yosi_UTC9 wrote: > Please add > assert_not_undefined(window.eventSender, 'this test requires > window.eventSender'); Done.
editing/selection/user-select/user-select-all-contenteditable.html is failed: This is a testharness.js-based test. FAIL Selection API can edit in -webkit-user-select:all contenteditable element You should specify caret position in "<div contenteditable="true" id="div" style="-webkit-user-select:all">f^oo</div>". PASS Execcommand inserttext in -webkit-user-select:all contenteditable element PASS -webkit-user-select:all contenteditable element is HTMLElement.isContentEditable == true Harness: the test ran to completion.
Patchset #6 (id:160001) has been deleted
Done. PTAL.
lgtm
The CQ bit was checked by yoichio@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
yoichio@chromium.org changed reviewers: + tkent@chromium.org
Add tkent@ for core/dom owner.
Is the new behavior compatible with other browsers? Does text form controls with user-select:all work well?
Description was changed from ========== Contenteditable w/ "-webkit-user-select:all" should be editable. <div id ="div" style="-webkit-user-select:all" contenteditable="true"></div> should be editable. In this CL, we ignore "-webkit-user-select:all" if element has |contenteditable="true| in Node::hasEditableStyle and expandSelection by user click. BUG=618920 TEST=editing/selection/user-select/user-select-all-contenteditable.html ========== to ========== Contenteditable w/ "-webkit-user-select:all" should be editable. <div id ="div" style="-webkit-user-select:all" contenteditable="true"></div> should be editable. In this CL, we ignore "-webkit-user-select:all" if element has |contenteditable="true| in Node::hasEditableStyle and expandSelection by user click. BUG=618920 TEST=editing/selection/user-select/user-select-all-contenteditable.html, mouse/click- user-select-all-textarea.html, user-select/user-select-all-contenteditable.html ==========
On 2016/07/13 00:04:03, tkent wrote: > Is the new behavior compatible with other browsers? Only FireFox supports -moz-user-select:all and its behavior with contenteditabel is weird: user can put a caret only on the head of text and can input characters but can't move caret. (https://github.com/w3c/csswg-drafts/issues/231) > Does text form controls with user-select:all work well? Nice catch. Text form should ignore user-select property. Add the test click-user-select-all-textarea.html. We still have another issue that drag to selection over user-select:all and editable element triggers all-selection. I will fix it later CL.
lgtm. Thank you for the clarification.
The CQ bit was checked by yoichio@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from yosin@chromium.org Link to the patchset: https://codereview.chromium.org/2120913002/#ps200001 (title: "update")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by yoichio@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Contenteditable w/ "-webkit-user-select:all" should be editable. <div id ="div" style="-webkit-user-select:all" contenteditable="true"></div> should be editable. In this CL, we ignore "-webkit-user-select:all" if element has |contenteditable="true| in Node::hasEditableStyle and expandSelection by user click. BUG=618920 TEST=editing/selection/user-select/user-select-all-contenteditable.html, mouse/click- user-select-all-textarea.html, user-select/user-select-all-contenteditable.html ========== to ========== Contenteditable w/ "-webkit-user-select:all" should be editable. <div id ="div" style="-webkit-user-select:all" contenteditable="true"></div> should be editable. In this CL, we ignore "-webkit-user-select:all" if element has |contenteditable="true| in Node::hasEditableStyle and expandSelection by user click. BUG=618920 TEST=editing/selection/user-select/user-select-all-contenteditable.html, mouse/click- user-select-all-textarea.html, user-select/user-select-all-contenteditable.html ==========
Message was sent while issue was closed.
Committed patchset #7 (id:200001)
Message was sent while issue was closed.
CQ bit was unchecked.
Message was sent while issue was closed.
Description was changed from ========== Contenteditable w/ "-webkit-user-select:all" should be editable. <div id ="div" style="-webkit-user-select:all" contenteditable="true"></div> should be editable. In this CL, we ignore "-webkit-user-select:all" if element has |contenteditable="true| in Node::hasEditableStyle and expandSelection by user click. BUG=618920 TEST=editing/selection/user-select/user-select-all-contenteditable.html, mouse/click- user-select-all-textarea.html, user-select/user-select-all-contenteditable.html ========== to ========== Contenteditable w/ "-webkit-user-select:all" should be editable. <div id ="div" style="-webkit-user-select:all" contenteditable="true"></div> should be editable. In this CL, we ignore "-webkit-user-select:all" if element has |contenteditable="true| in Node::hasEditableStyle and expandSelection by user click. BUG=618920 TEST=editing/selection/user-select/user-select-all-contenteditable.html, mouse/click- user-select-all-textarea.html, user-select/user-select-all-contenteditable.html Committed: https://crrev.com/d607a605c05ae726b55aa3a28b32c94a2ab597ff Cr-Commit-Position: refs/heads/master@{#405440} ==========
Message was sent while issue was closed.
Patchset 7 (id:??) landed as https://crrev.com/d607a605c05ae726b55aa3a28b32c94a2ab597ff Cr-Commit-Position: refs/heads/master@{#405440} |