Let's get one thing straight. Don't EVER think for one second, commenting on a co-workers appearance (even if you consider them a "workplace friend") is ever ok. Within Human Resource guidelines, any unwelcome comment on someone's appearance could be filed as sexual harassment. I have witnessed this one to many times, and myself been a victim of unwelcome comments.
Most workplaces have VERY strict guidelines on acceptable clothing, and if an employee wears something questionable, let HR confront that person. Never, and I repeat NEVER, take that into your own hands to confront the employee and state your opinion on how her dress may be too short. If it truly offends you? GROW UP! I can't think of any person on this planter, that puts their outfit on with the intention of offending anyone. I also don't think they grab a tape measure to see if it is "3 inches above the knee", it's called guess-timating. I can see if the shorts or dress are showing something extremely revealing, but if not, LET IT GO!
This seems to be a BIG problem during the summer. Most offices don't have that comfortable temperature, so when it's tipping 90 degrees outside and your employer allows shorts or a dress, we don't second think "Is my dress ONLY 3 inches above my knee and not an inch shorter?". No. So again, let your HR department take control over that. Never should an employee. And if you're a man? NEVER, confront a woman over her appearance or be ready to handle some serious sexual harassment complaints. Even though an employee may not go to HR, just stop and think how YOU would feel.