subCHILD

Archive for the browsers category

The "MS Shell Dlg" Mystery (Solved)

posted by admin in browsers, CSS, design, fonts, HTML

If you haven’t noticed (and are using a PC), the headlines on this blog should now be rendered using the MS Shell Dlg font [I've since changed this and have been experimenting with custom fonts via @font-face, but all information in this post still applies otherwise.] I learned about this font just now after trying to figure out why tadalist.com‘s input fields were rendering using it instead of the fonts specified in the CSS rule. I’m still unsure why the computed style lists MS Shell Dlg as the font since its never explicitly specified nor is the the default, but it is. (If you know why this is, drop a comment below.)

Anyhow, I really like the way this font looks at 20+ pixels and bolded, so its the new style for the (H2) headers. If you’re on a Mac, you should see Helvetica and since that font carries mad clout complaints will be appropriately ignored.

OK, I’m off to read more about this, starting here: http://support.microsoft.com/kb/282187

Update #1

Just read it.  A very intriguing quote from that page: “It is not a font but a face name for a nonexistent font.”  What?  Its definitely a font and after testing all of the usual suspects, I’m still unsure which one. Bizarre.

Update #2

I found the answer on this page: http://msdn.microsoft.com/en-us/library/dd374112%28VS.85%29.aspx.  The font that MS Shell Dlg maps to on all versions of Windows since Windows 2000 is “Microsoft Sans Serif”.  But I’m guessing that using MS Shell Dlg in the CSS rule instead makes more sense since it will map properly on other versions of Windows, and since its a shorter rule.  Though, specifying “Microsoft Sans Serif” explicitly, followed by more common fonts would make for a better rule and ensure no further surprises.

All this said, I’m still not sure why tadalist.com’s input fields are rendering in this font.

Update #3

Since writing this post, I’m noticing this font substitution taking place more often.  For example, Twitter‘s login input fields behave the same way, as does the h2 tag on Dictionary.com.  What all of these have in common is that they specify the first font name in quotes (presumably since it contains multiple words) and it happens to be a font that I don’t have installed.  While quotes should be permitted in such cases and are even encouraged by some, I find that its not necessary and here appears to not have the intended effect.

Converting an XML DOM Object to a String Using JavaScript

posted by admin in browsers, JavaScript

This is actually very simple, but it took a bit to discover so I’m posting it to address that.

function getXmlAsString(xmlDomObj){
   return (typeof XMLSerializer!=="undefined") ?
      (new XMLSerializer()).serializeToString(xmlDomObj) :
      xmlDomObj.xml;
}

Firebug Console: Best (Cross-Browser) Practices

The Firebug plug-in is an essential and unparalleled tool for (web) UI development.  If you’re not using it, you should be.  But in any case, some of its features can make a lazy (or busy) programmer cause serious problems in other browsers (unless Firebug Lite is installed).

Over the past few years I’ve tried a number of approaches for ensuring that my Firebug console calls don’t cause errors on browsers which either don’t support it or don’t have Firebug installed.  A few approaches I’ve used myself are described here.

1. Checking for existence of the console before each call to it

if (typeof console!="undefined" && console.log){ console.log("blah blah"); }

or

if (typeof console!="undefined" && console.dir){ console.dir(someObject); }

While this is a safe way to avoid errors when the Firebug console is unavailable its pretty nasty since we don’t want this code repeated all over the place.

2. Creating dummy console methods when they are not available and using console freely

(function(){
   if (!window.console||!console.firebug){
      var methods = [
         "log", "debug", "info", "warn", "error", "assert",
         "dir", "dirxml", "group", "groupEnd", "time", "timeEnd",
         "count", "trace", "profile", "profileEnd"
      ];
      window.console = {};
      for (var i=0; i<methods.length; i++){
         window.console[methods[i]] = function(){};
      }
   }
})();

More

Firefox 3.5 Issues: Dark JPGs, XML parsing with JavaScript, etc.

posted by admin in Firebug, Firefox, JavaScript

I downloaded Firefox 3.5 last week and while I did notice a slight performance improvement, there are a few unexpected updates as well:

  • Photos look much darker in 3.5 since it uses the embedded ICC profile where other versions/browsers don’t.  Whether or not you think this the more correct method of displaying images, its a bug and has been acknowledged as such (https://bugzilla.mozilla.org/show_bug.cgi?id=488800).
  • Firefox 3.5 seems more forgiving when processing XML with JavaScript.  Again, I’m going to test this more but it appears that no longer interprets empty text as a separate node.
  • Firefox 3.5 compatible version of Firebug is nearly useless.  Though, it is only in Beta and appears to be getting almost daily updates.

Weird.

Internet Explorer 8 is Officially Released

I installed IE8 the other day.  No comment.

Firebug 1.3 Memory Problems

posted by admin in browsers, Firebug

I really can’t imagine doing serious JavaScript development and DOM manipulation without the help of Firebug, however since installing version 1.3 – I’m using Firefox 3.0.5 on Windows XP – I noticed that the amount of memory it causes the browser to eat up is massive and continuously increasing.

Check out this screengrab of my Task Manager showing the Firefox browser eating up 1.4 Gigs of RAM only seconds after I opened it.  All I did was go to the MLB.com’s video page and only a single tab in Firefox is open:

Task Manager - Firefox Memory Usag

I’ve seen this on multiple computers with the same versions of Firefox/Firebug, and while a few others have reported similar issues, I don’t think I’ve heard of a report of such an extreme case and even less fortunately, no report of the root cause nor a forthcoming fix.

For the time being, I’m reverting to Firebug version 1.2.1 which is much less memory-hungry.  I suggest you do the same.

 

Google Chrome by Default

posted by admin in browsers

Google Chrome has recently become my default browser.  When developing, Firefox still takes the cake due to my dependency on the Firebug plugin (though version 1.3 has been a little buggy), and various features of the handy Web Developer toolbar.

As for Chrome, I love its speed and ease of use, but I do have a few dislikes.  The (wheel) scroll amount is way too jumpy and there is no way to adjust it – I’ve been using the arrows on my keyboard a lot instead which is not ideal.  Also, it can be quite memory intensive, with each tab spawning its own process and consuming upwards of 35MBs.

Recent Posts
Recent Comments
About
Simon: Hi there, i am looking for a parameter which can change direction of mov...
CM: Hi, Alex! I know exactly what king of messages you get, like "Hi, I'm new to php a...
admin: Alive and well....
SJ: If the array size exceeded 10 then sorting will not work. any help?...
shutterstock: I've learn several excellent stuff here. Definitely price bookmarking for revisiting....

Subchild is a blog about web development. It's author is Aleksandar Kolundzija, himself a web developer for 10++ years, presently a Hacker-in-Residence at betaworks. Prior to betaworks, Alex worked at Google, Meebo, MLB Advanced Media (MLB.com), Razorfish, and elsewhere.

Some of Alex's side projects include Gallerama.com, Slideshowify, LiveXmlEdit, and other blogs like Dopevector and blog.gallerama.com. When he's not working on any of those, Alex is probably playing guitar, producing music, mixing records, taking photos, playing with his kid, or watching documentaries about particle physics, the monetary system, etc.

Let him know what's up: ak @ subchild.com