Re: [gutvol-d] More than you ever wanted to know about XHTML and CSS

----- Original Message ----- From: "Lee Passey" <lee@novomail.net>
On a related note, let me say that I view internal style declarations as just plain rude. Style sheets are indeed A Good Thing, but someone imposing their quirky notions of style on me is not. By placing style definitions in an external style sheet and simply linking that style sheet into the main document with a <link> element, it makes it easy for me to strip away the suggested styles, and return to browser defaults, by simply deleting or renaming the style sheet. And if the suggested styles are mostly good, and need only a slight tweaking, it is safer and easier to edit an external style sheet than the main document. I would strongly encourage all PG volunteers who are creating HTML documents to consider putting suggested style definitions in an external style sheet rather than embedding those styles in the main document.
Let me say that I agree. But right now, the ww'ers have indicated that they want all styles inline. I think this practice should be changed, but it isn't my call. Josh

Let me say that I agree. But right now, the ww'ers have indicated that they want all styles inline. I think this practice should be changed, but it isn't my call.
This isn't a boolean decision and there are reasons for and against inline styles vs. external styles. If you have an extremely heavy hit site (like I do), inline styles makes sense... _except_ when your stylesheet itself is overly large (hundreds of lines or more). The balance has to be consired: Is it worth it to incur another socket connection and round trip from the client (more server hits to retrieve resources) or is it better to have a larger byte-per-hit (but less socket connections) per-client? Every site has their own requirements, and for some you'll want to use both approaches. Its not an all-or-nothing decision. David A. Desrosiers desrod@gnu-designs.com http://gnu-designs.com

David A. Desrosiers wrote:
This isn't a boolean decision and there are reasons for and against inline styles vs. external styles. If you have an extremely heavy hit site (like I do), inline styles makes sense... _except_ when your stylesheet itself is overly large (hundreds of lines or more).
The balance has to be consired: Is it worth it to incur another socket connection and round trip from the client (more server hits to retrieve resources) or is it better to have a larger byte-per-hit (but less socket connections) per-client?
If connections are your concern why dont you use keep-alive connections on your site? Modern UAs and webservers can download an HTML page with CSS and all images in one connection: $ wget -S --mirror http://www.gutenberg.org/files/15701/15701-h/15701-h.htm --00:23:03-- http://www.gutenberg.org/files/15701/15701-h/15701-h.htm => `www.gutenberg.org/files/15701/15701-h/15701-h.htm' Resolving www.gutenberg.org... 152.2.210.81 Connecting to www.gutenberg.org[152.2.210.81]:80... connected. HTTP request sent, awaiting response... 1 HTTP/1.1 200 OK 2 Date: Tue, 26 Apr 2005 22:23:04 GMT 3 Server: Apache/1.3.33 (Unix) PHP/4.3.10 4 Last-Modified: Sun, 24 Apr 2005 19:59:32 GMT 5 ETag: "5de5d6-f4c14-426bfaa4" 6 Accept-Ranges: bytes 7 Content-Length: 1002516 8 Keep-Alive: timeout=5, max=20 9 Connection: Keep-Alive 10 Content-Type: text/html --00:23:28-- http://www.gutenberg.org/robots.txt => `www.gutenberg.org/robots.txt' Reusing connection to www.gutenberg.org:80. HTTP request sent, awaiting response... 1 HTTP/1.1 200 OK 2 Date: Tue, 26 Apr 2005 22:23:28 GMT 3 Server: Apache/1.3.33 (Unix) PHP/4.3.10 4 Last-Modified: Tue, 19 Apr 2005 12:46:20 GMT 5 ETag: "3e587-161-4264fd9c" 6 Accept-Ranges: bytes 7 Content-Length: 353 8 Keep-Alive: timeout=5, max=19 9 Connection: Keep-Alive 10 Content-Type: text/plain --00:23:28-- http://www.gutenberg.org/files/15701/15701-h/images/001.png => `www.gutenberg.org/files/15701/15701-h/images/001.png' Reusing connection to www.gutenberg.org:80. HTTP request sent, awaiting response... 1 HTTP/1.1 200 OK 2 Date: Tue, 26 Apr 2005 22:23:28 GMT 3 Server: Apache/1.3.33 (Unix) PHP/4.3.10 4 Cache-Control: max-age=86400 5 Expires: Wed, 27 Apr 2005 22:23:28 GMT 6 Last-Modified: Sun, 24 Apr 2005 19:59:32 GMT 7 ETag: "5de5d8-3575-426bfaa4" 8 Accept-Ranges: bytes 9 Content-Length: 13685 10 Keep-Alive: timeout=5, max=18 11 Connection: Keep-Alive 12 Content-Type: image/png -- Marcello Perathoner webmaster@gutenberg.org

If connections are your concern why dont you use keep-alive connections on your site? Modern UAs and webservers can download an HTML page with CSS and all images in one connection:
Because KeepAlive hurts performance on heavily-loaded servers, and because there are lots of exploits running about specifically used to tie up webservers that use KeepAlive by leaving each socket in a TIME_WAIT state. I've had to use the TARPIT module in iptables to work around some of it over the last two weeks myself (works great!). With Apache Benchmark pounding various pages on the same physical box, with KeepAlive enabled, performance drops by about 80% (we're behind Squid as an http accellerator anyway, so KeepAlive on the Apache side is moot). David A. Desrosiers desrod@gnu-designs.com http://gnu-designs.com

David A. Desrosiers wrote:
If connections are your concern why dont you use keep-alive connections on your site? Modern UAs and webservers can download an HTML page with CSS and all images in one connection:
Because KeepAlive hurts performance on heavily-loaded servers, and because there are lots of exploits running about specifically used to tie up webservers that use KeepAlive by leaving each socket in a TIME_WAIT state.
Why write such a complicated exploit when just opening the connection and sending nothing is much simpler? This will leave the connection in an ESTABLISHED state, but will tie up one apache child all the same (until TimeOut). And it will need much less bandwidth than your exploit: The default value of TimeOut is 300 while the default value of KeepAliveTimeout is 15.
With Apache Benchmark pounding various pages on the same physical box, with KeepAlive enabled, performance drops by about 80% (we're behind Squid as an http accellerator anyway, so KeepAlive on the Apache side is moot).
But how is your exploit going to work if you have a squid in front? Doesn't the squid close the connection? -- Marcello Perathoner webmaster@gutenberg.org

Joshua wrote:
Lee Passey wrote:
On a related note, let me say that I view internal style declarations as just plain rude. Style sheets are indeed A Good Thing, but someone imposing their quirky notions of style on me is not. By placing style definitions in an external style sheet and simply linking that style sheet into the main document with a <link> element, it makes it easy for me to strip away the suggested styles, and return to browser defaults, by simply deleting or renaming the style sheet. And if the suggested styles are mostly good, and need only a slight tweaking, it is safer and easier to edit an external style sheet than the main document. I would strongly encourage all PG volunteers who are creating HTML documents to consider putting suggested style definitions in an external style sheet rather than embedding those styles in the main document.
Let me say that I agree. But right now, the ww'ers have indicated that they want all styles inline. I think this practice should be changed, but it isn't my call.
I'm a little puzzled by this because it implies there is no "standardization" of the HTML markup. I think the XHTML markup should be standardized enough around a structural/ semantic basis (not a presentational basis) so that a standardized style sheet can be used for most of the books in the proofing process. In XHTML this can be a standardized "class" library mapped from TEI tags (for a possible flavor of TEI to use, see Marcello's lastest draft of PGTEI at http://www.gutenberg.org/tei/marcello/0.3/doc/20000-h/20000-h.html ) Jon Noring

Jon Noring wrote:
I'm a little puzzled by this because it implies there is no "standardization" of the HTML markup.
I think the XHTML markup should be standardized enough around a structural/ semantic basis (not a presentational basis) so that a standardized style sheet can be used for most of the books in the proofing process.
In XHTML this can be a standardized "class" library mapped from TEI tags (for a possible flavor of TEI to use, see Marcello's lastest draft of PGTEI at
http://www.gutenberg.org/tei/marcello/0.3/doc/20000-h/20000-h.html )
The "standardization" is there ... it just doesn't go as far as to specify a standard style sheet. Now, the TEI has a "working" standard style sheet, but there have already been some changes identified in testing. Once, we have the final transforms worked out, I plan on having an open call for style sheets on DP. Josh

Josh replied:
Jon Noring wrote:
I'm a little puzzled by this because it implies there is no "standardization" of the HTML markup.
I think the XHTML markup should be standardized enough around a structural/ semantic basis (not a presentational basis) so that a standardized style sheet can be used for most of the books in the proofing process.
In XHTML this can be a standardized "class" library mapped from TEI tags (for a possible flavor of TEI to use, see Marcello's lastest draft of PGTEI at
http://www.gutenberg.org/tei/marcello/0.3/doc/20000-h/20000-h.html )
The "standardization" is there ... it just doesn't go as far as to specify a standard style sheet.
Ah, ok, so I was probably preaching to the choir.
Now, the TEI has a "working" standard style sheet, but there have already been some changes identified in testing.
Once, we have the final transforms worked out, I plan on having an open call for style sheets on DP.
Good to hear! I suggest, when that time comes, to post a request to the YahooGroup "CSS-Style". There's a number of CSS experts there who may consider helping PG/DP out with alternative CSS style sheets. One can't have too many different ways to view the same content. (This is the next thing I plan with the "My Antonia" proof-of-concept project -- to ask for alternative style sheets for the document. Let the end-user try different layouts and choose the one they prefer.) Jon Noring

The "standardization" is there ... it just doesn't go as far as to specify a standard style sheet.
Now, the TEI has a "working" standard style sheet, but there have already been some changes identified in testing.
Once, we have the final transforms worked out, I plan on having an open call for style sheets on DP.
I've worked on enough 'quirky' projects to think this a bad idea. The typesetters of the past did things that often make it a complete judgment call where the content stops and the presentation begins, and many projects will not fit on someone else's Procrustean notions of how a PG project 'should' be styled. -- RS
participants (5)
-
David A. Desrosiers
-
Jon Noring
-
Joshua Hutchinson
-
Marcello Perathoner
-
Robert Shimmin