Web Devout tidings


Archive for the 'Web Devout' Category

Safari displays 1×1 alphatransparent PNGs too dark

Friday, April 20th, 2007

I finally figured out why Safari was displaying the heading backgrounds on the main Web Devout site too dark: In general, Safari 2.0 seems to screw up the brightness or gamma correction on 1-pixel by 1-pixel alphatransparent PNGs. This is even true for PNGs which don’t have any gamma correction information included. Interestingly, if you change the image size to anything else, the brightness problem goes away. Why does Safari decide to darken 1×1 PNGs? Your guess is as good as mine.

I was using a repeating 1×1 alphatransparent PNG as the background in order to simulate an RGBA value in a CSS 2.x-compatible way. To fix the problem in Safari, I simply changed the image size to 2×1.

I just wanted to point this out in case anyone else runs into it and becomes stumped like I was for a while. The problem seems unique to Safari/WebKit; Konqueror doesn’t seem to have this problem.

Frankly, this is just one of a seemingly endless list of bang-your-head-on-the-desk bugs I regularly find in Safari in quite basic areas. Another one that bothered me for a while was that background images in Safari will repeat if the box is shorter or thinner than the background image even if you have background-repeat: no-repeat;, which you’ll notice if you also use a background-position. This just shows that passing something like Acid2 first doesn’t necessarily mean you’re the cream of the crop. Please exterminate these weird bugs.

Webpage Test tool updates

Sunday, March 4th, 2007

The Webpage Test tool has been updated with a new look and a few new features.

The biggest improvement is the ability to temporarily save test pages, similar to services like pastebin. The saved pages will remain on the server for at least two days before being deleted to save space. The saved page URL is also a short identifier rather than the entire source like the (now removed) “Link” feature used.

You may also specify a base URL outside the HTML. This is useful if you’re trying to offer someone corrected webpage source with URLs relative to the original URL but don’t want to confuse the person by including a base element in the HTML.

Basic HTML templates for HTML 4.01 Strict, XHTML 1.0, and XHTML 1.1 are available via links at the top of the page. Note that the XHTML templates come with the correct content-type (application/xhtml+xml) so browsers handle it like real XHTML. Because Internet Explorer doesn’t support true XHTML, IE will give you the usual download dialog instead of the webpage.

Finally, the system has been updated with a snazzier look. The new look is supported by Firefox, Opera, Safari, Konqueror, and other modern browsers. Internet Explorer currently falls back to a simpler look.

I have recently resumed work on a PHP-based SGML parser and syntax highlighter I’ve been developing, which I will try to eventually incorporate into this system. It aims to support much more of the SGML standard than the common alternatives and also provides indication of some common errors like invalidly placed elements and unrecognized character entities, elements, and attributes. It will not, however, attempt to be a complete validator.

Validity and well-formedness

Tuesday, February 20th, 2007

I’ve just published a new web development article called Validity and Well-Formedness, which explains the distinctions between valid and well-formed XHTML.

If the W3C HTML Validator says your XHTML page is valid, that means it’s also well-formed, right? Wrong! This article has several examples of XHTML documents which are perfectly valid but are malformed and won’t even load in an XML parser.

Web Devout infrastructure changes

Saturday, February 3rd, 2007

Web Devout has adopted a somewhat more user- and search engine-friendly format for its URLs. For example, instead of /browser_support.php it’s now /browser-support. The old URLs should automatically redirect to the new ones, but it’s possible that something was overlooked. If you experience an unexpected 404 or other error, please let me know as soon as possible.

General Meta Data Profile 1.5 published

Friday, January 19th, 2007

The General Meta Data Profile 1.5 has been published. This update incorporates a number of proposed additions to XHTML 2 and Web Applications 1.0 as well as some other commonly used properties. Some errors have been corrected and the page has been adapted to the typical Web Devout style.