Bug 94014 - Deleting a button element leaves the style inside the button element
Summary: Deleting a button element leaves the style inside the button element
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction, InRadar
Depends on:
Blocks:
 
Reported: 2012-08-14 12:40 PDT by Ryosuke Niwa
Modified: 2022-09-08 14:32 PDT (History)
12 users (show)

See Also:


Attachments
Patch (4.66 KB, patch)
2012-08-14 20:03 PDT, Sukolsak Sakshuwong
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from gce-cr-linux-05 (359.08 KB, application/zip)
2012-08-14 20:39 PDT, WebKit Review Bot
no flags Details
Patch (4.67 KB, patch)
2012-08-14 20:52 PDT, Sukolsak Sakshuwong
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2012-08-14 12:40:59 PDT
Insert a button element in a contenteditable element, and delete it by a backspace, then insert some text. The style inside the button bleeds outside the button so that the text will be centered for example.
Comment 1 Ryosuke Niwa 2012-08-14 12:41:19 PDT
Reduction: http://www.drlongghost.com/dlg/chrome_bug

http://crbug.com/86938
Comment 2 Sukolsak Sakshuwong 2012-08-14 20:03:25 PDT
Created attachment 158488 [details]
Patch
Comment 3 WebKit Review Bot 2012-08-14 20:39:17 PDT
Comment on attachment 158488 [details]
Patch

Attachment 158488 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13492821

New failing tests:
editing/deleting/delete-button.html
Comment 4 WebKit Review Bot 2012-08-14 20:39:20 PDT
Created attachment 158491 [details]
Archive of layout-test-results from gce-cr-linux-05

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-05  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Comment 5 Sukolsak Sakshuwong 2012-08-14 20:52:41 PDT
Created attachment 158492 [details]
Patch
Comment 6 Ryosuke Niwa 2012-08-14 23:11:58 PDT
Comment on attachment 158492 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=158492&action=review

> Source/WebCore/ChangeLog:9
> +        Make the DeleteSelectionCommand save typing style only for formattable nodes
> +        according to the HTML Editing specification.

I'm not sure what you're referring here but given that our implementation doesn't match the specification at all, we should probably follow our convention for now.
Could you explain what you're trying to do here in more detail?
Comment 7 Ojan Vafai 2013-04-08 16:10:59 PDT
Comment on attachment 158492 [details]
Patch

sukolsak no longer works at Google. Removing the r? since he clearly isn't around to complete this patch.
Comment 8 Neil Ashford 2021-03-23 22:05:38 PDT
Hi,
I've discovered what is essentially the same bug using a regular <input> element, thought I'd try to bump this issue instead of making a duplicate.

Reproduction case: https://fiddle.tiny.cloud/r8haab (ignore that it's a TinyMCE fiddle, this just uses regular content editable elements).

Safari Version: Version 14.0.3 (16610.4.3.1.7)
Comment 9 Ahmad Saleem 2022-09-01 17:11:09 PDT
rniwa@webkit.org - We tried something similar in this pull request by trying to merge "Blink patch".

https://github.com/WebKit/WebKit/pull/3675

Do you think the test case from this patch would suffice? Thanks!

BY THE WAY they are are duplicates of each other, so I can mark this later on. Thanks!
Comment 10 Ryosuke Niwa 2022-09-01 17:24:45 PDT
They're related but not a duplicate. Button element isn't atomic.
Comment 11 Ahmad Saleem 2022-09-01 17:34:08 PDT
(In reply to Ryosuke Niwa from comment #10)
> They're related but not a duplicate. Button element isn't atomic.

but the Chromium bug in Comment 1 takes me to this commit:

https://src.chromium.org/viewvc/blink?view=revision&revision=154067

which is same I was trying to merge in PR

https://chromium.googlesource.com/chromium/blink/+/27371d2980715475f3443f7025141ebff8537179

______

I think the patch attached to this is of different bug and Comment 1 is referring to something else.
Comment 12 Ahmad Saleem 2022-09-01 17:37:02 PDT
I took the test case from Patch and changed it into JSFiddle:

Link - https://jsfiddle.net/zvk1juo4/

Only Chrome Canary 107 is showing it as PASS while both Firefox Nightly 107 and STP 152 is showing it as "FAILED".
Comment 13 Ahmad Saleem 2022-09-04 12:09:06 PDT
Trying my luck through landing the again - https://github.com/WebKit/WebKit/pull/4009

Fingers crossed!
Comment 14 EWS 2022-09-08 14:31:43 PDT
Committed 254285@main (c75ccbd4e966): <https://commits.webkit.org/254285@main>

Reviewed commits have been landed. Closing PR #4009 and removing active labels.
Comment 15 Radar WebKit Bug Importer 2022-09-08 14:32:20 PDT
<rdar://problem/99715641>