Skip to content

[3.0] Theme split (wave 8, part 1) — remove rtl.css rules that match nothing - #9568

Open
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-rtl-dead-rules
Open

[3.0] Theme split (wave 8, part 1) — remove rtl.css rules that match nothing#9568
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-rtl-dead-rules

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Part 1 of wave 8 of the #7933 split. Wave 8 is the right-to-left work: converting the
theme to CSS logical properties so that rtl.css stops being needed. This first part
does not convert anything — it removes the rules in rtl.css that already override
nothing, so the conversion that follows starts from a file where every remaining rule
has a job.

rtl.css only ever flips physical properties, so every rule in it is an override of
something another stylesheet draws. Sixteen of them name markup the theme no longer
emits.

The largest single group is the edit-event section. The event editor was rewritten at
some point and now draws no ul at all, so #post_event ul.event_options,
#post_event ul.event_main li and their siblings cannot match. The two #event_main
rules go with them: nothing emits that id either.

The rest name ids and classes that appear nowhere in Themes/ or Sources/:
#postbuttons_upper, .reportlinks, #personal_messages h3 span#author and
span#topic_title, h3.search_hd, #popularposts, #popularactivity,
.topic .mod_icons, .stats_icon, .search_results_posts .buttons and
#helpmain h3.section.

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

One that looked dead and is not. .bbc_standard_quote and .bbc_alternate_quote
appear in no template, because those class names are assembled at runtime in
Sources/Parsers/BBCodeParser.php:1906 as 'bbc_' . ($quote_alt ? 'alternate' : 'standard') . '_quote'. Their rules are kept. Any similar sweep needs to check for
constructed class names rather than trusting a grep.

How this was checked

Loaded 24 pages as an administrator with a right-to-left language active — the event
editor, statistics centre, help, search results, personal messages, profile tracking,
board index, topic display, posting form, admin and moderation centres among them —
and counted matches for every removed selector.

  • 24 pages, all returning 200 with no error page
  • 7086 elements
  • 0 matches, for all 18 removed selectors

The same sweep counts #post_event fieldset and #post_event .roundframe as present,
which is what shows the event editor really rendered and the zero is not vacuous.

rtl.css goes from 624 lines to 555.

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>
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