refactor(webserver): migrate presentational HTML attributes to CSS - #95
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.main { margin: 0; background-image: ... }.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).