Opened 4 years ago

Closed 4 years ago

#12132 closed Bug (fixed)

Image is inserted with width&height styles even when they are not allowed

Reported by: Jakub Ś Owned by: Artur Delura
Priority: Normal Milestone: CKEditor 4.4.3
Component: General Version: 4.1
Keywords: Cc:

Description (last modified by Artur Delura)

  1. Use below setting:
    var editor = CKEDITOR.replace( 'editor1', {	
    	disallowedContent : 'img{width, height}[width, height]'				
    });
    
  2. try to insert a new image (plase be sure that provided url is valid and blur text input before closing dialog).

Removing width, height works great on initial content but it doesn't when you insert new image. Here is what happens:

  1. Image is inserted with width/height style (can be checked with firebug)
  2. When you switch to source mode style is still there. Method getData also returns width/height in style.
  3. Only second switch to source mode returns width/height from image. Could be applicable for other elements.

Change History (11)

comment:1 Changed 4 years ago by Jakub Ś

Status: newconfirmed

comment:2 Changed 4 years ago by Jakub Ś

This ticket was created based on #12126.

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

Summary: It is not possible to remove width height from image with disallowedContentImage is inserted with width&height styles even when they are not allowed
Version: 4.4.04.1

I rephrased title and changed version, because this issue is caused by incomplete integration of ACF and image dialog.

PS. Image2 should be checked for the same scenario.

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

Milestone: CKEditor 4.4.3

comment:5 Changed 4 years ago by Artur Delura

Description: modified (diff)

comment:6 Changed 4 years ago by Olek Nowodziński

cc

comment:7 Changed 4 years ago by Artur Delura

Owner: set to Artur Delura
Status: confirmedassigned

comment:8 Changed 4 years ago by Artur Delura

Status: assignedreview

Fixes and tests on branch:t/12132

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

Status: reviewreview_passed

I rebased branch:t/12132 and pushed additional commits. New test wasn't checking the right image (after switch to inline editors) so it wasn't checking anything actually. Additionally, it's hard to tell whether image was really downloaded and height/width read. So I added an additional test with the same scenario but width and height allowed (it was actually missing).

comment:10 Changed 4 years ago by Artur Delura

You are right, I didn't want to set real dimensions, because I wanted to make test bulletproof but I went to far. But that are test - some things can be hardcoded.

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

Resolution: fixed
Status: review_passedclosed

Fixed on master with git:731ec29.

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