Tatham Oddie

Invalid Port Number in href Attribute Breaks DOM in IE7

with 4 comments

When writing my Local proxies with IE7 – Solved post, Windows Live Writer helpfully turned http://localhost:xyz/ into a link for me. Unfortunately, this resulted in my WordPress page throwing JS errors on every load.

It turns out that the invalid port number breaks the IE7 DOM, and the WordPress devs (who replied within about 4 hours!) haven’t been able to find a way around the condition.

I have posted a test case here:

http://tatham.oddie.com.au/files/InvalidPortNumberInHrefAttributeBreaksDom/

Annoylingly the Microsoft Connect site for IE7 is closed. I’ve emailed a link to the test case to the IE team via their blog, but if anybody knows of a better way I’d be keen to know.

UPDATE 25/4/07: Links like http://anonymous:@svn.fueladvance2.com/ seem to break it as well as demonstrated if you view my next post in IE7.

Written by Tatham Oddie

April 25, 2007 at 15:17

Posted in Uncategorized

4 Responses

Subscribe to comments with RSS.

  1. [...] wrote a post – Invalid Port Number in href Attribute Breaks DOM in IE7 and even put up a test case to demonstrate the [...]

  2. “Breaks DOM” is a bit too much as it only breaks code that tries to read the href attribute of such a link. Other DOM operations are unaffected.

    Björn

    May 29, 2007 at 05:18

  3. @Björn: I agree with you that it’s not the entire DOM broken, but I still consider it broken when calls to some DOM methods result in a non-descript crash.

    Tatham Oddie

    May 29, 2007 at 10:40

  4. Now it is a crash when the browser throws an easily catchable exception? The invalid argument is most likely thrown by the URI parser which does some strict validation of the given URI. The href is not some random string and for now I am not sure if Firefox’ stripping of invalid URI parts is better than throwing an exception.

    As for the user:password@host case: it was broadly announced that user credentials in URLs are disabled by default in Seven, I cannot remember anyone mentioning this script behavior, though :)

    Björn

    May 29, 2007 at 22:41


Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.