Opened 10 years ago

Closed 6 years ago

#2788 closed Bug (fixed)

img-tag: height/width-values are inside the style-tag after resizing

Reported by: Thilo Schwarz Owned by:
Priority: Normal Milestone:
Component: Core : Output Data Version:
Keywords: Cc:

Description

I've found a strange behavior how the editor builds an img-tag. You can reproduce it by doing the following steps:

1: Insert an image by clicking the image-button.

2: Pressing the Source-button you will see the code as expected:

<img width="310" height="158" alt="" src="/_userfiles/image/FCKeditor.png" />

3: Press the Source-button again to go back to the preview.

4: Mark the image to get the little squares for resizing and resize it.

5: Take a look at the source again, you will get an img-tag like this:

<img src="/_userfiles/image/FCKeditor.png" alt="" style="width: 216px; height: 110px;" />

As you see, height and width are inside the style-attribute now.

Tested with fckeditor 2.6.3 and 2.6.4beta.

I'll hope this behavior is bug. If not I'll run into big problems, because I have to analyze height and with of the img-tags of the html-source. And the normal behavior is much easier to analyze!

Change History (4)

comment:1 Changed 10 years ago by Artur Formella

Keywords: Confirmed added

It is similar to #1810

comment:2 Changed 10 years ago by Artur Formella

I'm not sure we can fix it.

The same bug occurs in V3 (changeset 3667).

comment:3 Changed 10 years ago by Garry Yao

Confirmed with whatwg contentEditable specification draft:

Treatment of elements

The img element

img elements inside an editable region can be selected, resized (with respect to their containing block) and copied. The first time you resize the img element its height and width attribute must be set. If you later resize the img again the height and width attribute must remain unchanged and the style attribute must be used instead to set the height and width properties from CSS. If the height and width attributes were already set they must not be changed by the UA.

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

Resolution: fixed
Status: confirmedclosed

It is now possible to set Allowed Content Rules that will allow only styles or attributes and ACF will transform img accordingly. This issue can be fixed more precisely only by custom image resize plugin, which is a subject of different ticket.

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