Skip to content

[3.0] Theme split (wave 8, part 2) — float with logical properties instead of left and right - #9569

Open
albertlast wants to merge 2 commits into
SimpleMachines:release-3.0from
albertlast:3.0/theme-rtl-float
Open

[3.0] Theme split (wave 8, part 2) — float with logical properties instead of left and right#9569
albertlast wants to merge 2 commits into
SimpleMachines:release-3.0from
albertlast:3.0/theme-rtl-float

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Part 2 of wave 8 of the #7933 split. Stacked on #9568 — review that one first; this
branch contains it.

float: inline-start and float: inline-end follow the writing direction by themselves,
so a rule written that way needs no right-to-left counterpart at all. This converts the
floats where rtl.css was doing nothing except mirroring the value, and deletes those
overrides.

This is the same move #9356 and #9357 made for the float/align utilities and for
dl.settings, applied to the rest of the theme.

What is and is not converted

Only the 26 floats whose override is an exact mirrorindex.css, profile.css or
calendar.css says left and rtl.css says right, or the reverse. Those are the ones
where one logical declaration reproduces both directions exactly.

Deliberately left alone:

  • floats whose right-to-left value is not the mirror of the left-to-right one. A
    single logical declaration cannot express two different values, so converting them
    would change how one direction renders.
  • floats that rtl.css adds where the base stylesheet has none. Same reason.

#post_header dt/dd shared a rule with #event_options dt/dd, and only the first
pair has a mirror in rtl.css. Converting them together would have started mirroring the
event editor, which is not mirrored today, so the rule is split and #event_options
keeps a physical float with a comment recording why. That the event editor is unmirrored
in right-to-left looks like a real gap, but it is a behaviour change and does not belong
in a no-op PR.

How this was checked

The criterion for this part is that nothing moves, in either direction.

For every element on 26 pages I recorded float, clear, text-align, the inline
margins and padding, and the full bounding rectangle — before and after, captured back to
back across a stash so no other forum state could shift in between.

elements differences
left-to-right 8018 82, all of them the float keyword
right-to-left 8017 81, all of them the float keyword

No geometry changed anywhere — not one x, y, width, height, margin or padding.

The keyword itself is expected to differ: getComputedStyle reports inline-start
rather than resolving it back to left or right. The geometry is the part that proves
the rendering is untouched.

Worth recording for anyone repeating this: a first attempt showed six extra differences
on the board index, all on the "Users online" line. That was the online-member count
changing between captures, not the CSS — the element's right edge and its <strong>
child were identical and only the text width moved. Capturing the pair back to back makes
it go away.

rtl.css goes from 555 lines to 480.

Issues References (Fixes|Related|Closes)

Related to #7933.

rtl.css exists to flip physical properties for right-to-left languages, so
every rule in it is an override of something another stylesheet draws. Sixteen
of them override markup the theme stopped emitting, and have been dead for
some time:

- the event editor was rewritten and now draws no ul at all, which takes out
  the whole "edit event section" block plus the two #event_main rules
- .bbc_standard_quote and .bbc_alternate_quote were checked and kept: those
  class names are built at runtime in BBCodeParser, so grepping for them finds
  nothing even though the markup does emit them
- the rest name ids and classes that appear nowhere in Themes/ or Sources/:
  #postbuttons_upper, .reportlinks, #personal_messages span#author and
  span#topic_title, h3.search_hd, #popularposts, #popularactivity,
  .topic .mod_icons, .stats_icon, .search_results_posts .buttons and
  #helpmain h3.section

Checked by loading 24 pages as an administrator with a right-to-left language
active, including the event editor, the statistics centre, help, search
results and the personal messages area: 7086 elements, and not one of the
removed selectors matches any of them.

.topic .mod_icons is the counterpart of the index.css rule removed in SimpleMachines#9547,
which left this copy behind.

Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
float: inline-start and float: inline-end follow the writing direction on
their own, so a rule that uses them needs no right-to-left counterpart. This
converts the 26 floats where rtl.css was doing nothing more than mirroring the
value, and drops those overrides.

The 26 are the ones where the override is an exact mirror: index.css and
profile.css say left and rtl.css says right, or the other way round. Floats
whose right-to-left value is not the mirror of the left-to-right one are left
alone, because a single logical declaration cannot reproduce two different
values; the same goes for the floats rtl.css adds where the base sheet has
none.

#post_header dt/dd shared a rule with #event_options dt/dd, and only the first
pair has a mirror in rtl.css. Converting the pair together would have started
mirroring the event editor, which is not mirrored today, so the rule is split
and #event_options keeps a physical float with a comment saying why.

Checked by recording float, clear, text-align, the inline margins and padding,
and the bounding rectangle of every element on 26 pages, before and after,
captured back to back so nothing else about the forum could move in between:

- left-to-right: 8018 elements, the only differences are the 82 float keywords
  themselves. No geometry changes at all.
- right-to-left: 8017 elements, 81 float keywords, and again nothing else.

The keyword is expected to differ: getComputedStyle reports inline-start
rather than resolving it to left or right. What matters is that every x, y,
width, height, margin and padding is identical in both directions.

rtl.css goes from 555 lines to 480.

Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants