Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Research how different sources of HTML interact with img height/width attributes #14313

Closed
Tracked by #14146
Witoso opened this issue Jun 1, 2023 · 1 comment
Closed
Tracked by #14146
Assignees
Labels
package:image squad:core Issue to be handled by the Core team. type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@Witoso
Copy link
Member

Witoso commented Jun 1, 2023

As we implemented the image attributes to the model (#14202) let's test it out with the content that it's out there and what would be a behavior with this implementation.

Sources to check:

Cases to check:

  • Simple image upload.
  • Image from URL.
  • Resize of image.
  • Resize of image (unlocked aspect ratio).

Let's create a doc in which we will have a summary of the scenarios and example data. Format proposal:

  • Source: CKE4 with ACF.
  • Input HTML to the source.
  • Action on the image in the source (mention if any like resize).
  • Output HTML from the source.
  • Model/View after inserting to CKE5 (with height/width attributes)
  • Is user intent preserved?
@Witoso Witoso added type:task This issue reports a chore (non-production change) and other types of "todos". package:image squad:core Issue to be handled by the Core team. labels Jun 1, 2023
@CKEditorBot CKEditorBot added the status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. label Jun 1, 2023
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Jun 6, 2023
@Witoso
Copy link
Member Author

Witoso commented Jun 9, 2023

Conclusions

  • style=height:xx, should we accept it and store in the model as resizedHeight?
    • Proposed rule of thumb if inline style then the intent is that it may be a resize and we keep it in the model.
    • GHS attribute height messes up the resize of the picture with inline styles. The inline-image will show differently in an editor and different in data output.
    • style=height:xx == model: resizedHeight (this is what we could introduce)
    • on resize should we set resizedHeight and resizedWidth?
      • % may mess it up? Rounding problems…
    • force aspect-ratio style, set an attribute on the model of aspect-ratio.
  • height:auto overwrites the non-proportional resize (in block as images are surrounded by figure). Should we accept images that are resized without keeping the aspect ratio?
    • maybe integrators should unset height:auto if they want to tweak aspect ratio images?

Follow ups:

@Witoso Witoso closed this as completed Jun 9, 2023
@Witoso Witoso added this to the iteration 64 milestone Jun 9, 2023
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:image squad:core Issue to be handled by the Core team. type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

No branches or pull requests

3 participants