Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9970 closed Bug (duplicate)

BR mode inconsistency between versions

Reported by: tema Owned by:
Priority: Normal Milestone:
Component: General Version: 3.6.3
Keywords: Cc:

Description (last modified by Jakub Ś)

http://nightly.ckeditor.com/13-01-20-08-51/standard/samples/plugins/enterkey/enterkey.html

Select BR mode.

Situation:

  1. Clear all text
  2. Write a line of text
  3. Select this line
  4. Click bold (first line becomes bold)
  5. Press enter to make a new line
  6. Click bold again to disable it

In 3.6.2 everything works fine, first line is still bold, new text on the new line is not bold.

However in every version after 3.6.3, including 4.x, after last step bold for the first line is removed.

It seems that the 3.6.3 behavior looks more adequate.

Change History (7)

comment:1 Changed 7 years ago by Jakub Ś

Description: modified (diff)
Status: newconfirmed
Version: 4.0.13.6.3

Problem can be reproduced in all browsers from CKEditor 3.6.3 [7392]. It occurs also in CKEditor 4.x (v4).

comment:2 Changed 7 years ago by Jakub Ś

Resolution: duplicate
Status: confirmedclosed

This is actually DUP of #9933.

@agentcooper I have moved your TC there.

comment:3 Changed 7 years ago by tema

If this helps, the problem is inside core/dom/range.js. I took this file from 3.6.2 and moved it to 3.6.3, everything started working as expected after rebuild.

comment:4 Changed 7 years ago by Jakub Ś

If it works for you then ok but please note this is not good method of fixing things.

Each editor version is updated with new fixes and features. This change was made to introduce something. You got this working but all things mentioned in #9933 are broken again plus maybe some extra new things that don't go along with this revert.

comment:5 Changed 7 years ago by tema

Well I am still inspecting the problem.

In 3.6.3 you changed "elementBoundaryEval" (in range.js) which uses CKEDITOR.dom.walker.bogus from walker.js, which returns false for br node now.

I am thinking maybe when in br mode it should return true for every br node?

There is a line

isBogus = isBogus && parent.isBlockBoundary() && !!parent.getLast( nonEmpty );

And if br's parent is strong as mentioned in example, parent.isBlockBoundary() is obviously false.

Now all I did is patch walker.js bogus method with

if (node.is && node.is('br')) {
  return true;
}

Could you please tell me if there is any test suite I can run?

Last edited 7 years ago by tema (previous) (diff)

comment:6 Changed 7 years ago by tema

Also #9933 seems to almost work with this fix, expect there is one additional line created.

Version 0, edited 7 years ago by tema (next)

comment:7 Changed 7 years ago by Jakub Ś

@agentcooper sorry for not replying earlier - lots of user requests and no time for anything else.

I have added comment in #9933 to your fix. Perhaps it will point someone to the right direction. Your notes make sense but way to fix this is yet to be determined.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy