Skip to content

refactor(webserver): migrate presentational HTML attributes to CSS - #95

Merged
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:feature/issues2
Jun 11, 2026
Merged

refactor(webserver): migrate presentational HTML attributes to CSS#95
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:feature/issues2

Conversation

@ngosang

@ngosang ngosang commented Jun 11, 2026

Copy link
Copy Markdown
Member

Replace the HTML 3.2-era presentational attributes across the default template with equivalent CSS classes in style.css, keeping the quirks mode doctype untouched so the table layout renders exactly as before:

  • body background= / leftmargin= / topmargin= / marginwidth= / marginheight= become body.main { margin: 0; background-image: ... }.
  • background= on the header bar and the tab-frame cells become the navbar-cell and tab-top/left/right/bottom classes.
  • bgcolor= becomes bg-white / bg-black / sep-dark / sep-light (the 1px black and grey separator rows in the file listings).
  • align= / valign= on rows and cells become al-* / va-* classes. Tables that relied on the legacy block-alignment behaviour of align="center" / align="right" (nav bar, toolbars, prefs panes, login box) get margin-based center-table / navbar-table classes instead, since CSS text-align only moves inline content.
  • height= on td/th becomes h10..h200 utility classes.
  • border="0" is dropped everywhere; a global img { border: 0 } rule covers linked images.

login.php keeps a private inline <style> copy of the rules it uses: the webserver only serves style.css to a logged-in session (any other request gets the login page HTML instead), and login.php is precisely the page unauthenticated clients see. It previously survived this only because the legacy attributes needed no stylesheet. index.html links no stylesheet either, so its body uses an inline style.

Also fixes the malformed width="100% "height="180" attribute pair in login.php and the stray valign= on its outer table.

Verified against a running amuleweb: before/after headless-Chromium screenshots of all 9 pages are pixel-identical except for dynamic content (stats graphs, server user/file counts).

Replace the HTML 3.2-era presentational attributes across the default
template with equivalent CSS classes in style.css, keeping the quirks
mode doctype untouched so the table layout renders exactly as before:

- body background= / leftmargin= / topmargin= / marginwidth= /
  marginheight= become `body.main { margin: 0; background-image: ... }`.
- background= on the header bar and the tab-frame cells become the
  navbar-cell and tab-top/left/right/bottom classes.
- bgcolor= becomes bg-white / bg-black / sep-dark / sep-light (the
  1px black and grey separator rows in the file listings).
- align= / valign= on rows and cells become al-* / va-* classes.
  Tables that relied on the legacy block-alignment behaviour of
  align="center" / align="right" (nav bar, toolbars, prefs panes,
  login box) get margin-based center-table / navbar-table classes
  instead, since CSS text-align only moves inline content.
- height= on td/th becomes h10..h200 utility classes.
- border="0" is dropped everywhere; a global `img { border: 0 }`
  rule covers linked images.

login.php keeps a private inline <style> copy of the rules it uses:
the webserver only serves style.css to a logged-in session (any other
request gets the login page HTML instead), and login.php is precisely
the page unauthenticated clients see. It previously survived this
only because the legacy attributes needed no stylesheet. index.html
links no stylesheet either, so its body uses an inline style.

Also fixes the malformed `width="100% "height="180"` attribute pair
in login.php and the stray valign= on its outer table.

Verified against a running amuleweb: before/after headless-Chromium
screenshots of all 9 pages are pixel-identical except for dynamic
content (stats graphs, server user/file counts).
@ngosang
ngosang merged commit 7e9cebd into amule-org:master Jun 11, 2026
9 checks passed
@ngosang
ngosang deleted the feature/issues2 branch June 11, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant