Opened 11 years ago
Closed 11 years ago
#11641 closed Bug (fixed)
Switching between modes in framed editor removes content styles for inline editor
Reported by: | Piotrek Koszuliński | Owned by: | Piotr Jasiun |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.3.4 |
Component: | General | Version: | |
Keywords: | Cc: |
Description (last modified by )
- Download 11641.html
- Switch between modes in first editor.
- See that content in inline editor lost styles.
Attachments (2)
Change History (10)
Changed 11 years ago by
Attachment: | 11641.html added |
---|
comment:1 Changed 11 years ago by
Description: | modified (diff) |
---|---|
Milestone: | → CKEditor 4.3.4 |
Status: | new → confirmed |
Changed 11 years ago by
Attachment: | 11641.webm added |
---|
comment:2 Changed 11 years ago by
comment:3 Changed 11 years ago by
Owner: | set to Piotr Jasiun |
---|---|
Status: | confirmed → assigned |
comment:4 Changed 11 years ago by
Status: | assigned → review |
---|
The problem was in editable.detach
method. When editor was in textarea
mode this method removes styles from the page document (this.getDocument()
for textarea was page document).
Changes in t/11641 and corresponding test branch.
comment:5 Changed 11 years ago by
I wonder if there's any more straightforward way of checking if stylesheet should be removed. What if someone used other source mode than sourcearea? For example source code editor?
What if we set editable.hasStylesheet property when it adds stylesheet and then check it in detach?
PS. There are 3 minor code style issues in tests.
comment:6 Changed 11 years ago by
I'm also not sure if this.is( 'textarea' )
is the best way to check this, but this way is already used in other places in this file (here and here) and I believe that it is most important to use the same check everywhere. If we want to let user use custom source code editor we should rethink all of the if( this.is( 'textarea' ) )
conditions.
comment:7 Changed 11 years ago by
Status: | review → review_passed |
---|
Ok, you're right. We already use this check, so in this case we can do that too. However, we should take the opportunity to fix this as soon as we'll make some refactoring of editable class. The entire addCss logic is tangled. There are better ways to ensure that stylesheet will be preserved as long as there's at least one editor using it.
comment:8 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
- git:eec6b82
- tests:5e3603f
cc: love this one!