WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
26443
[:first-letter][createlink][contenteditable] Safari creates a link on wrong characters with document.execCommand("createlink", false, "somelink") if the contenteditable element has a :first-letter rule applied to it.
https://bugs.webkit.org/show_bug.cgi?id=26443
Summary
[:first-letter][createlink][contenteditable] Safari creates a link on wrong c...
Dan POPA
Reported
2009-06-16 06:57:55 PDT
Safari crashes on document.execCommand("createlink", false, "somelink") if the contenteditable element has a :first-letter rule applied to it. Steps to reproduce: 1. have the following in a page: <style> .someclass:first-letter { font-weight: bold; } </style> <div class="someclass" contenteditable="true">contentEditable element. Some text and some words.</div> <input type="button" value="Create link" onclick="document.execCommand('createlink', false, '
http://www.google.com
')" /> 2. Select something from the contenteditable DIV. 3. Click the button. Result: Safari crashes after a few seconds. A few details, notes on this behavior: Note 1: Can't select the first character/letter, see
bug #6185
Note 2: Safari doesn't crash if the selection is inside the first word and it starts before or after the second character in the first word. The selection is shifted one character to the left. The contenteditable element cannot be focused anymore after createlink if the selection started before the second character, only the link can be focused in this case. See attachment for testcase.
Attachments
Testcase showing described behavior
(1.38 KB, text/html)
2009-06-16 06:59 PDT
,
Dan POPA
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Dan POPA
Comment 1
2009-06-16 06:59:43 PDT
Created
attachment 31348
[details]
Testcase showing described behavior
Dan POPA
Comment 2
2009-06-16 07:01:22 PDT
Possible related bugs:
bug #22256
Reproduceable crash with @font-face and :first-letter pseudo class
bug #15602
Quirksmode: CSS1: WebKit fails dynamic :first-letter test
bug #14550
Non-layout style change does not update nested first-letter
bug #6185
Bug 6185
: CSS1: character styled with :first-letter is not selectable
Dan POPA
Comment 3
2009-06-16 07:08:35 PDT
No crash in Safari 3.2.3 But the selection is shifted one character to the left and clicking after the newly created link doesn't set the selection at the click location (same as in the second note from the bug description)
thaddee6yann
Comment 4
2009-12-28 02:32:11 PST
Possibly related issues: * any text insertion is shifted by a seemingly arbitrary number of characters, usually 1. * a character entered at the end duplicates the line and sometimes deletes a number of characters at the end of the line. Note: this is only true on the first line.
Kent Tamura
Comment 5
2010-08-09 01:51:48 PDT
I took a look at the code, and my conclusion is we should close
Bug#6185
before this. ("close" means to fix it or to decide we won't fix it.)
Ahmad Saleem
Comment 6
2022-06-23 15:58:21 PDT
Based on attached test and following steps from Description, I am not able to crash Safari 15.5 on macOS 12.4. This was fixed long back as commented in
Comment 03
. Although - first letter non-selection bug is still present on attached test case (for which we have separate bug -
https://bugs.webkit.org/show_bug.cgi?id=6185
). Although,
Comment 05
mentions that this bug should remain open till some conclusion is reached for the bug). IMO - We can close this since it is not crashing and leave 6185 open for fixing since now all other browsers have fixed it and first letter is selectable. Thanks!
Ryosuke Niwa
Comment 7
2022-06-23 22:08:22 PDT
Safari doesn't hit any crash anymore.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug