New issue
Advanced search Search tips

Issue 731320 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Delete content of a single cell table should not delete the whole table

Project Member Reported by jfernan...@igalia.com, Jun 8 2017

Issue description

Chrome Version: (60.0.3112.20)
OS: (Linux)

What steps will reproduce the problem?
(1) Load attached test case
(2) Delete the text in the single table cell
(3) 

What is the expected result?

Only the text inside the cell should be deleted.

What happens instead?

The entire table will get deleted


 
singleCellDelete.html
202 bytes View Download
I filed https://webkit.org/b/173117 to track this issue, also reproducible in Wk. 
Cc: yosin@chromium.org
This issue seems to be a clear interoperability issue. Neither Firefox or IE/Edge delete the whole table even when the unique cell's content is deleted. 

On the other side, this behavior looks like explicitly set during the old times of WebKit, hence it's part of Chrome since then. There are several tests that ensure there is no regression in such behavior:

editing/deleting/delete-last-char-in-table.html
editing/unsupported-content/table-delete-001.html
editing/unsupported-content/table-delete-003.html

Also, there are interesting discussion on this topic in the following bugs:

webkit.org/b/57148#c5
webkit.org/b/24238
webkit.org/b/24236

I've got a preliminary approach to address this issue but I'd need to clarify first what's the expected behavior. I couldn't find anything in the specs to figure it out.
Filed a new spec issue to gather more info on the actual expected behavior:

https://github.com/w3c/editing/issues/163

Comment 4 by yosin@chromium.org, Jun 9 2017

Status: Available (was: Untriaged)
Thanks for filing issue to w3c editing-tf!
New test case with just 1 cell. I'm not able to reproduce the issue when the table as more than one cell, even if they are all empty.
singleCellDelete.html
193 bytes View Download
Owner: jfernan...@igalia.com
Status: Started (was: Available)
It seems the patch causes some layout tests failures. All of them expect the table to be removed, so it's understandable why the patch causes such failures. We could think on rebaseline them, but I don't think it's a good idea.

The patch avoids a table to be removed even when the content of the last cell is removed and becomes an empty table. This behavior could be sensible for the test case used to file this bug: a table with a single cell. However, the cases verified by the tests table-delete-001.html and table-delete-003.html expect that empty table rows are removed as well. 

If we apply only the proposed patch we will end with a table without any tr element, which we could not select or edit anymore. If we want to avoid the table to be removed we might avoid the empty tr elements to be removed as well. This is what Firefox and IE do, however, I think current Blink's behavior makes sense and perhaps it's more useful in other uses cases.

See https://crrev.com/c/567196 for more details.
@yosin could you please share you opinion about my last comments.
It seems this behavior is under evaluation in https://crbug.com/832549
Cc: editing-dev@chromium.org
It seems we've got an agreement in the Editing TF github issue: 

 https://github.com/w3c/editing/issues/163#issuecomment-388964965

@yosin, do you think we could change blink so that it matches Firefox and Edge behavior ? 
Sorry for late response.

Could you get agreement from WebKit especially Apple? 
It seems WebKit people are not involved in github discussion[1].

Even if Blink follow the spec but WebKit doesn't, interop issue isn't solved.
All browser vendors need agree on for going forward.


[1] https://github.com/w3c/editing/issues/163
It seems that WebKit agrees on fixing the issue when the table content is deleted using backspace. As it was agreed in the  issue #163 , the selection related cases should not be affected but this change.

See comments in the WebKit bug I opened for this issue:

https://bugs.webkit.org/show_bug.cgi?id=173117#c20

So I guess we have an agreement, right ?
Project Member

Comment 13 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/39714081f59b6d1ea7c662db870b33987a309d2a

commit 39714081f59b6d1ea7c662db870b33987a309d2a
Author: Javier Fernandez <jfernandez@igalia.com>
Date: Tue Jul 17 09:32:23 2018

Don't extend selection for special elements on caret based deletes

We should not extend selection looking for special elements if the
delete operation has been triggered by a caret based selection.

This change is based on a recent [1] resolution of the Editing TF,
which acknowledges that behavior of single-cell tables must be the
same that multi-cell tables and even if the last character is
deleted, we should not delete the whole table structure.

A different case would be when the user actively selects the whole
content of a table; in this case, as we do in multi-cell tables,
the structure of single-cell tables should be deleted together
with the content.

[1] https://github.com/w3c/editing/issues/163

Bug:  731320 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I8c3e4efcc63410bf30b4889a715d92e9dda8189b
Reviewed-on: https://chromium-review.googlesource.com/1126255
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575591}
[modify] https://crrev.com/39714081f59b6d1ea7c662db870b33987a309d2a/third_party/WebKit/LayoutTests/editing/deleting/delete-last-char-in-table-expected.txt
[add] https://crrev.com/39714081f59b6d1ea7c662db870b33987a309d2a/third_party/WebKit/LayoutTests/editing/unsupported-content/table-delete-002.html
[modify] https://crrev.com/39714081f59b6d1ea7c662db870b33987a309d2a/third_party/WebKit/LayoutTests/external/wpt/editing/data/delete.js
[modify] https://crrev.com/39714081f59b6d1ea7c662db870b33987a309d2a/third_party/WebKit/LayoutTests/external/wpt/editing/data/forwarddelete.js
[modify] https://crrev.com/39714081f59b6d1ea7c662db870b33987a309d2a/third_party/WebKit/LayoutTests/external/wpt/editing/run/delete-expected.txt
[modify] https://crrev.com/39714081f59b6d1ea7c662db870b33987a309d2a/third_party/WebKit/LayoutTests/external/wpt/editing/run/forwarddelete-expected.txt
[delete] https://crrev.com/602d2720f0c353b05c3f6615b3e78ea1bd5d7255/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-002-expected.png
[delete] https://crrev.com/602d2720f0c353b05c3f6615b3e78ea1bd5d7255/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-002-expected.txt
[delete] https://crrev.com/602d2720f0c353b05c3f6615b3e78ea1bd5d7255/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-003-expected.png
[delete] https://crrev.com/602d2720f0c353b05c3f6615b3e78ea1bd5d7255/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-003-expected.txt
[modify] https://crrev.com/39714081f59b6d1ea7c662db870b33987a309d2a/third_party/blink/renderer/core/editing/commands/typing_command.cc

Status: Fixed (was: Started)
This issue should be FIXED now.

Sign in to add a comment