Opened 7 years ago

Closed 7 years ago

#9662 closed Bug (fixed)

Unable to re-assign style to an image

Reported by: Olek Nowodziński Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.0
Component: Core : Styles Version: 4.0
Keywords: Cc:

Description (last modified by Olek Nowodziński)

  1. Open http://ckeditor4.t/ckeditor/samples/replacebycode.html
  2. Insert an image with src assets/sample.jpg
  3. Assign style "Styled image (right)"
  4. Assign style "Styled image (left)"
  5. Nothing happened. Image holds "Styled image (right)".
  6. Double click the image to show properties. No property has been parsed (no url, alt, width, height...).

Related to #9651. Tested with latest Chrome.

Change History (7)

comment:1 Changed 7 years ago by Olek Nowodziński

Description: modified (diff)

comment:2 Changed 7 years ago by Frederico Caldeira Knabben

Component: Core : TablesCore : Styles

comment:3 Changed 7 years ago by Piotrek Koszuliński

It doesn't happen always. Frequency depends on the place where image is inserted - at the beginning of block it's very often, when at the end I wasn't able to reproduce it.

comment:4 Changed 7 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: newassigned

comment:5 Changed 7 years ago by Piotrek Koszuliński

Status: assignedreview

Various things were broken:

  1. Evaluator has been set on range, not walker.
  2. Wrong arguments were passed to isBookmark factory so evaluator was checking if node is a bookmark.
  3. Also, I got rid of duck typing in isBookmark evaluator.

comment:6 Changed 7 years ago by Piotrek Koszuliński

  1. CKEDITOR.dom.walker.bookmark with weird arguments order was introduced in git:c40b595a (2009 year).
  2. The broken part of CKEDITOR.dom.range#getEnclosedNode hasn't been touched since git:29a69527 (2009 year too). Last change was made in 2010 (git:1ecf10c4).

List of bookmark evaluator with arguments:

core/dom/range.js:			bookmarkEvaluator = CKEDITOR.dom.walker.bookmark( true ),
core/dom/range.js:			bookmark = CKEDITOR.dom.walker.bookmark( 1 );
core/dom/range.js:					bookmark = CKEDITOR.dom.walker.bookmark( false );
core/dom/range.js:				isNotBookmarks = CKEDITOR.dom.walker.bookmark( true ),
core/dom/iterator.js:		bookmarkGuard = CKEDITOR.dom.walker.bookmark( false, true ),
core/dom/iterator.js:						ignoreBookmarkTextEvaluator = CKEDITOR.dom.walker.bookmark( true, true );
core/editable.js:		isNotBookmark = CKEDITOR.dom.walker.bookmark( false, true );
core/style.js:	var notBookmark = CKEDITOR.dom.walker.bookmark( 0, 1 ),
plugins/indent/plugin.js:		isNotBookmark = CKEDITOR.dom.walker.bookmark( false, true );

Only third looks like broken (because there's only one, falsy argument) and this is the one from getEnclosedNode.

Last edited 7 years ago by Piotrek Koszuliński (previous) (diff)

comment:7 Changed 7 years ago by Piotrek Koszuliński

Resolution: fixed
Status: reviewclosed

Masterised git:502aba7.

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