Bug 248870
Summary: | createLink & unLink Command should not make anchor elements with same name attribute | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | karlcow, rniwa, webkit-bug-importer, wenson_hsieh |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari Technology Preview | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Ahmad Saleem
Hi Team,
While going through Blink's comment, I came across another potential which can be merged:
Blink Commit - https://src.chromium.org/viewvc/blink?view=revision&revision=185635
Webkit GitHub Source - https://github.com/WebKit/WebKit/blob/4cc6515988ce049468e3c05836107192648b037a/Source/WebCore/editing/ApplyStyleCommand.cpp#LL1074
Failing Tests (also Fail in Firefox Nightly 109) - https://jsfiddle.net/6rftoakp/show
Appreciate if someone can give input whether matching Chrome behavior is desirable or not?
Thanks!
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ryosuke Niwa
The patch is oddly specific about name content attribute of anchor element. There are other elements with name attribute. Why are we not considering those? Also, there is nothing wrong with multiple elements to have the same name so I'm not certain if we want to remove name attribute.
Ahmad Saleem
(In reply to Ryosuke Niwa from comment #1)
> The patch is oddly specific about name content attribute of anchor element.
> There are other elements with name attribute. Why are we not considering
> those? Also, there is nothing wrong with multiple elements to have the same
> name so I'm not certain if we want to remove name attribute.
I think you are right and if I go through Chrome Bug history, it seems that it was impacting "editing-in-js" library effort of trying to move "execCommand" to JS.
Link - https://github.com/yosinch/editing/issues/35
Plus Safari works like this:
> JSFiddle - https://jsfiddle.net/c4817ys2/
> Apply - document.execCommand("createLink", false, "URL");
*** Safari 16.1 & Firefox Nightly 109 ***
True
*** Chrome Canary 110 ***
First run nothing and then second will show "true" similar to Safari & Firefox.
Radar WebKit Bug Importer
<rdar://problem/103354383>