Opened 11 years ago
Closed 11 years ago
#11822 closed Bug (fixed)
[Webkit] Anchors editing broken in some cases
Reported by: | Olek Nowodziński | Owned by: | Olek Nowodziński |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.4.1 |
Component: | General | Version: | 4.4.0 |
Keywords: | Cc: |
Description
- Set the following HTML
<p>f<a id="x" name="x">o</a>o</p>
- Double-click the anchor.
Expected: Existing anchor is edited.
Actual: A new anchor is edited.
git:b5acf14a92926 is the first bad commit.
Change History (8)
comment:1 Changed 11 years ago by
Milestone: | → CKEditor 4.4.1 |
---|---|
Status: | new → confirmed |
comment:2 Changed 11 years ago by
comment:3 Changed 11 years ago by
Owner: | set to Olek Nowodziński |
---|---|
Status: | confirmed → assigned |
comment:4 Changed 11 years ago by
Status: | assigned → review |
---|
Pushed fix to branch:t/11822 (+tests).
This issue was much easier than suggested in comment:2. Basically git:b5acf14a restricted selection#selectElement( evt.data.link )
to elements to be edited in link dialog only, while non-empty anchors (empty ones are faked with img
) also must be selected.
comment:5 follow-up: 6 Changed 11 years ago by
I haven't noticed this while reviewing related tickets in 4.4, but the logic of doubleclick listeners (0,10,20) is tangled. Am I right that image2 could listen with priority <10, and link with the default one? I would be glad if we could revert this commit git:b5acf14a. Is it possible?
comment:6 Changed 11 years ago by
Replying to Reinmar:
I haven't noticed this while reviewing related tickets in 4.4, but the logic of doubleclick listeners (0,10,20) is tangled. Am I right that image2 could listen with priority <10, and link with the default one? I would be glad if we could revert this commit git:b5acf14a. Is it possible?
Yes, it is possible. However, if Image2 listened with priority < 10 and canceled the event before it reaches listeners in link plugin, then it would need to handle this logic, which is what I wanted to avoid. My idea was to do it gently, so the process of link discovery (evt.data.dialog = 'link' vs 'anchor'
) remains on the Link plugin-side. And thanks to 0,10,20 listeners, it is possible – there is no redundant code, which would need attention, if something has changed in Link plugin. Also, if we decide to bring support for Image2+anchors in the future, there's nothing to do there, because Link plugin takes care of invoking the right dialog etc.
comment:7 Changed 11 years ago by
Status: | review → review_passed |
---|
comment:8 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed on master with git:70a8947 on dev and c0d14c0 on tests.
Not as critical as it might seem. It's only reproducible if anchor has adjacent non-white-space text nodes. Most likely doubleclick first cause expanding selection to whole word and then it's too late for anchor feature to react.