-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explosion when playing with the basic styles #4048
Comments
The same is on https://ckeditor5.github.io/ |
I can also reproduce it - hitting twice italic button on the text containing an edge of the bold fragment. |
Similar one (in terms of steps) https://github.com/ckeditor/ckeditor5-engine/issues/711. |
I spent a couple of minutes debugging this issue and here's a little I have found. For the following data in the editor (after bold and italic) <p>This <i>[is <strong>an]</strong></i><strong> editor</strong> instance.</p> the second italic command execution (like in the screencast) fails in The algorithm falls into this condition and I'm not quite sure why it is so but something tells me either:
I suppose some more serious view vs. DOM debugging is necessary to figure it out. I hoped a simple fix will do the trick but I'm afraid there's none 😞. |
I think that #453 is a DUP of this ticket, but we need to confirm it after fixing this one. |
One more TC to test after fixing this issue: https://github.com/ckeditor/ckeditor5-basic-styles/issues/46. Since I closed it as a DUP of this, if it turns out that it's a different issue, it needs to be reported here. |
Two more similar tickets: https://github.com/ckeditor/ckeditor5-list/issues/58 and https://github.com/ckeditor/ckeditor5-engine/issues/701. |
We had a debugging session with @Reinmar and we came up to some conclusions. We mainly focused on test case reported by @oskarwrobel. Thing is that there are situations when |
During a short discussion with @pjasiun we agreed that it should be Why we can't rely on Therefore, we prevent updating text nodes which parent elements are about to be updated too. But this means that we may get outdated text nodes in the DOM after And therefore, |
It turned out to not be true. The
The issue, as found by @szymonkups, is somewhere else. Or at least part of the issue. Let's consider this example. We're changing: <p><i><b1>foo</b1></i><b2>bar</b2></p> to: <p><b1>foobar</b1></p>
First, we call
Unfortunately, on step 1, we unbind The solution: don't unbind elements which are in the view or will be in the DOM after the changes. |
While analysing this we also noticed that it's unclear where the renderer uses So, our idea is to remove We should also warn about this in |
It's also worth linking to https://github.com/ckeditor/ckeditor5-engine/issues/888 as it's the change which introduced unbinding. It may contain interesting information. |
Fix: Prevent unbinding elements that are reused during rendering. Closes #922. BREAKING CHANGE: Removed `Renderer#getCorrespondingDom()` and `Renderer#getCorrespondingView()` methods. BREAKING CHANGE: Renamed `Renderer#getCorrespondingDomText()` method to `Renderer#findCorrespondingDomText()` and `Renderer#getCorrespondingViewText()` to `Renderer#findCorrespondingViewText()`. BREAKING CHANGE: Merged `Renderer#getCorrespondingDomElement()` and `Renderer#getCorrespondingDomDocumentFragment()` into one method `Renderer#mapViewToDom()`. BREAKING CHANGE: Merged `Renderer#getCorrespondingViewElement()` and `Renderer#getCorrespondingViewDocumentFragment()` into `Renderer#mapDomToView()`.
The text was updated successfully, but these errors were encountered: