Updated: Comment #0

Problem/Motivation

#2170085: Caption filter may not wrap images that are only aligned, not captioned fixed a major problem. But it kind of introduced a minor new one: we introduced generic alignment classes for non-textual content. That's fine, or great even.

The problem we subtly introduced, was that we didn't remove the caption alignment classes. So now we not only have align-(left|center|right), but we also still have caption-(left|center|right).

This is problematic when you take into account that the CKEditor widget that provides a great authoring UX for aligning/captioning images also has to know about these different classes: if the image is captioned, it must set caption-(left|center|right), if it's not captioned, it must set align-(left|center|right). That's unnecessary complexity. Therefor it complicates #2039163: Update CKEditor library to 4.4.

Proposed resolution

Get rid of the caption-(left|center|right) classes.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers’s picture

Status: Active » Needs review
FileSize
5.89 KB
jessebeach’s picture

I think we can get away with removing this modification:

/**
 * Caption alignment: center alignment needs special care.
 */
.caption.align-center {
  margin-left: auto;
  margin-right: auto;
  clear: both;
}

If we remove the margin: 0 from the .caption class. I read through the referenced article http://stackoverflow.com/a/13363408 and I don't believe the margin: 0 is strictly necessary.

jessebeach’s picture

FileSize
575 bytes

Here's the correct interdiff for #2

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

You're right, the margin: 0 is non-essential, if it's necessary, it should be done at the theme level.

Now filter.caption.css finally is as clean as it should be :)

Manually tested. Still working correctly.

jessebeach’s picture

Here are issues to style .caption elements in Bartik and Seven

Bartik: #2183005: Style inlined .caption elements (figure) - Bartik
Seven: #2182997: Style inlined .caption elements (figure)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: remove_caption_alignment_classes-2180627-2.patch, failed testing.

jessebeach’s picture

Status: Needs work » Needs review
FileSize
2.02 KB
6.63 KB

I have no idea what changed in Drupal to make that patch no longer apply. I pulled out the rejected bits so you can see them.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

This was broken by #1913510: Core Javascript Files Not Using Standard Indentation. Patch is functionally the same. Back to RTBC.

webchick’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -quickfix +Quick fix

Committed and pushed to 8.x. Thanks!

nod_’s picture

Issue tags: +JavaScript

Change to a JS file. Tagging.

Wim Leers’s picture

Issue tags: -sprint

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.