A christmas present from Microsoft

Browser, CSS No Comments »

The Acid2 test rendered in IE8

After the last "update" of IE 7 and the questionable communication policy in the IEBlog I am very happy to see that things can change. :-)
Thanks, Mr. Gates for bringing light into the darkness.

Anyway, how can IE 8 render the test correctly? At this moment the test is broken...
Ok, I have just seen their video and I guess they were working with the correct Acid2 test.

ClearType influences CSS filters in Internet Explorer 6

Browser, CSS 2 Comments »

A few weeks ago I had one of the seldom moments in which I had to use Internet Explorer 6. I examined some memory usage oddities in connection with the AlphaImageLoader object when I noticed a strange rendering behavior regarding the proprietary CSS attribute filter. I just added a simple filter like

<span style="filter:Alpha(opacity=100, style=0)"></span>

and my text just looked blurry.


The text appears blurry only if ClearType is enabled.

Did your noticed this behavior by yourself? If you have any experiences with the attribute filter in connection with ClearType, please let me know!

Optimization Monday — Part VI: expression order

Optimization Monday No Comments »

JavaScript has the nice ability to stop evaluating expressions in a condition as soon as the condition result is final.

function test(){
  alert("this message will never be shown!");
  return true;
}
 
if( true || test() ){
  // ..
}
 
if( false && test() ){
 // ..
}

Since expressions are evaluated from left to right we have the following possibilities to optimize the expression order:

  1. align less complex expressions left
  2. for disjunctions: put the expression which will most likely be true to the left
  3. for conjunctions: put the expression which will most likely be false to the left
  4. group depending expressions

Of course the rules also apply to nested expressions.

This example

if(
  (
    (complexCalculation() < 42) &&
    (
      (userAgentVersion < 7) &&
      activexDisabled() &&
      (getUserAgent() == "Internet Explorer")
    )
  ) || (
    (value > 0)
  )
){
 // ..
}

can be optimized to

if(
  (value > 0) || (
    (
      (getUserAgent() == "Internet Explorer") &&
      (userAgentVersion < 7) &&
      activexDisabled()
    ) &&
    (complexCalculation() < 42)
  )
){
 // ..
}

WordPress Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in