Opened 15 years ago

Closed 15 years ago

#3708 closed Bug (duplicate)

[webkit] inline style doesn't work for collpased range

Reported by: Garry Yao Owned by: Garry Yao
Priority: Must have (possibly next milestone) Milestone: CKEditor 3.0
Component: General Version:
Keywords: Webkit Confirmed HasPatch Cc:

Description

Reproducing Procedures

  1. Open the replace by class example page in Safari4;
  2. Click inside the text line to result in a collapsed the selection;
  3. Click on any inline style button, e.g. Bold.
    • Actual Result: Style tag is not happened at the selection position.

Attachments (2)

3708.patch (2.2 KB) - added by Garry Yao 15 years ago.
3708_2.patch (2.4 KB) - added by Garry Yao 15 years ago.

Download all attachments as: .zip

Change History (7)

Changed 15 years ago by Garry Yao

Attachment: 3708.patch added

comment:1 Changed 15 years ago by Garry Yao

Keywords: Review? added
Status: newassigned

Actually the style element has been introduced, but the culprit is webkit doesn't allow selection inside the empty element, so after you begin to type, texts fall into the outside of the style.
The idea of this patch is providing a workaround to padding a bogus node (ZWNBSP) to make the selection anchored inside the element and remove the bogus node on next user action.

comment:2 Changed 15 years ago by Garry Yao

Keywords: Review- added; Review? removed

The patch doesn't work with this case:

Reproducing Procedures

  1. Open the replace by class example page in Safari4;
  2. Click inside the text line to result in a collapsed the selection;
  3. Press 'Ctrl-B', then Press 'Ctrl-I';
    • Actual Result: Both styles don't open.

comment:3 Changed 15 years ago by Garry Yao

Keywords: Review? added; Review- removed

The key detection logic in previous patch is possibly be confused by shortcut keys like Ctrl-I, so I found a smarter way to check it:
We just need to check if the subsequent keystroke has actually result in any new character within the style.
I'm attaching a new patch following this approach.

Changed 15 years ago by Garry Yao

Attachment: 3708_2.patch added

comment:4 Changed 15 years ago by Garry Yao

Keywords: HasPatch added; Review? removed

comment:5 Changed 15 years ago by Frederico Caldeira Knabben

Resolution: duplicate
Status: assignedclosed

I understand this is an important issue, but any fix we may propose for it is prone to be broken on special cases. We have several key combinations to caret movements, as well as the possibility of having more than one style being applied at the same time (CTRL+B + CTRL+I) or even clipboard operations being activated on different ways. I mean, it's quite easy to have any fix at our side being broken.

We have been in touch with Apple for this issue. They have demonstrated interest on fixing webkit (this is an engine bug actually), but they have brought not much more than this. Hopefully we'll have something real coming from them soon.

In any case, this is a DUP of #1272.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy