IE Hacks detected

For technical support for all editions of CSS HTML Validator. Includes bug reports.
User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 573
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

IE Hacks detected

Post by RSteinwand » Fri Jun 17, 2016 11:00 am

Hi Albert,

I'm seeing this error on a couple of large style sheets:
"IE hacks" for CSS property names (like names beginning with '_', '*', or '#') detected in 4 CSS property names. Due to unusual and/or incorrect parsing methods, IE6 and below don't fail on property names beginning with '_', while IE7 and below don't fail on property names beginning with '*' or '#'. Newer versions of IE and other browsers like Chrome, Firefox, and Safari will fail on these "IE hacks" causing the properties to be ignored. Please note that these types of hacks use invalid CSS and should be avoided whenever possible. Do a 'standards-compliant check' to detect these hacks as errors.
Considering the variety of naming conventions used in these hacks, I'm wondering if the warning could be more specific as to where it found them?

Since less hacks are needed these days compared to when IE6/7 were more popular, I'm hoping I can get rid of them, provided I can find them quickly.

Could clicking the message bring up the first incidence OR list the line numbers at the end of the message OR give a range of where the lines are... anything? :D

With the popularity of html5-boileplate, I'm hoping to get rid of them and replace any that I absolutely need to keep, with by placing them in a block like this:

Code: Select all

.lt-ie10 #header{background:#000f37 url(/images/cssimages/horz_gradients_oldIE.png) 0 -100px repeat-x;opacity:.95}
Thanks.
Rick

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3242
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: IE Hacks detected

Post by Albert Wiersch » Fri Jun 17, 2016 11:46 am

Hi Rick,

The message suggests doing a 'standards-compliant check' to find them. Have you tried that, and, if so, then does that work?

To do this select 'Validate->Standards-compliant check'. The Alt+7 shortcut should work as well.

I'll look into making the message point to the first occurrence of an "IE Hack" in a future update.
Image
Albert Wiersch

User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 573
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: IE Hacks detected

Post by RSteinwand » Fri Jun 17, 2016 12:12 pm

Sorry, I didn't read it all. :?

I DID play with the standards check last week, but that's all new to me.

Since that'll show everything I need you can forget adding linking to the first occurrence.

Now, how about an easy way of implementing standards check.... Could there be a button somewhere to do that? Maybe a quick toggle between standards and a few popular modes?

That has to really burn your butt to put all this time into something that no-one knows exists....
Rick

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3242
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: IE Hacks detected

Post by Albert Wiersch » Fri Jun 17, 2016 4:04 pm

Hi Rick,

There is a "Validate" menu in the main menu and a "Validate" menu on the main toolbar with an arrow to show more validation options. I suppose it would be more obvious if a combo box was added to the toolbar showing what validation mode was used or is currently selected. Do you keep the main toolbar visible? I'll look into adding a combo box to the main toolbar for a future version to make it more obvious.

But if you want to do a quick 'Standards-compliant check' then you should be able to use the Alt+7 shortcut. You can then use Alt+1 to do a 'Full' validation which is the default validation mode because it will keep doing a standards compliant validation as the default validation for that document until you change back.
Image
Albert Wiersch

User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 573
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: IE Hacks detected

Post by RSteinwand » Mon Jun 20, 2016 8:16 am

Hi Albert,

Yes, that works well. I DO keep all of the toolbars visible, just none of the "inserters".

Is there a way to change all the open tabs to "Standards" to re-validate (and back)? With 54 style sheets open, it's a little clunky to Alt-7, F7, Ctrl-W... Alt-7, F7, Ctrl-W.

I often validate an entire folder at a time and my default is "Full" (Alt-1)
Rick

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3242
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: IE Hacks detected

Post by Albert Wiersch » Mon Jun 20, 2016 9:44 am

Hi Rick,

Sorry, there is no way to easily change default validation modes. I'll consider this for the next major release. It seems like something that should definitely be easy to do, although I think you're the first person that's mentioned it.
Image
Albert Wiersch

User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 573
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: IE Hacks detected

Post by RSteinwand » Mon Jun 20, 2016 10:04 am

Don't knock yourself out if it's a lot of work. I think I only have hacks on 2 style sheets and I got rid of the underscore ones (IE6 I believe) now, so might not have many left.

How does this work if I open docs AFTER changing the current document with Alt-7? Do all documents after that default to Standards?
Rick

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3242
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: IE Hacks detected

Post by Albert Wiersch » Mon Jun 20, 2016 10:12 am

RSteinwand wrote:How does this work if I open docs AFTER changing the current document with Alt-7? Do all documents after that default to Standards?
No, all documents default to 'Full', even if opened after changing the validation mode on a previous document.
Image
Albert Wiersch

User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 573
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: IE Hacks detected

Post by RSteinwand » Mon Jun 20, 2016 10:25 am

I don't see anywhere to change the default to "Standards" (or am I missing something)? (wouldn't be the first time....)
Rick

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3242
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: IE Hacks detected

Post by Albert Wiersch » Mon Jun 20, 2016 11:06 am

RSteinwand wrote:I don't see anywhere to change the default to "Standards" (or am I missing something)? (wouldn't be the first time....)
No, I don't think you are missing anything. The default validation mode for all documents is "Full". If you change it for a document by selecting it (like to "Standards-compliant check") then it becomes the new default validation mode only for that document so when you hit F6 it uses the same validation mode. Other documents will still use 'Full' when you press F6 (unless you have used another validation mode for that document).
Image
Albert Wiersch

User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 573
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: IE Hacks detected

Post by RSteinwand » Mon Jun 20, 2016 2:22 pm

So maybe SHIFT+ALT+7 could change all open documents to "Standards" mode and SHIFT+ALT+1 would change them all back to "Full"? Without knowing what coding is required, I would assume that'd be the easiest way to fix this.

That would be consistent with many of your "File" menu items for "All".
Rick

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3242
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: IE Hacks detected

Post by Albert Wiersch » Mon Jun 20, 2016 4:12 pm

Hi Rick,

That's a good idea but those shortcuts are already assigned to inserting heading tags. The other issue I can think of is that it isn't that obvious. I was thinking of adding a submenu to the 'Validate' menu named 'Default' so people could select a default validation mode.

Another option would be to use a shortcut like Shift+Ctrl+Alt+(number) but that's a lot of keys and I only reserve that for infrequently used items.

Or I could change or remove the current heading shortcuts and reassign them.

Which do you think would be better? I think I'm leaning toward a new 'Default' submenu because it's more obvious.
Image
Albert Wiersch

User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 573
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: IE Hacks detected

Post by RSteinwand » Mon Jun 20, 2016 4:40 pm

If the "shift" versions are gone, then the new menu or a control on a toolbar would probably be best.

I do like promoting "Standards" mode....
Rick

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3242
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: IE Hacks detected

Post by Albert Wiersch » Wed Jun 22, 2016 12:55 pm

Hi Rick,

For the upcoming v17 release, I've added a submenu (Validate->Default Validation Mode) that lets you select a default validation mode. You could set this to 'Standards-compliant check'.

Would you like to test this out? If so then I will send you a BETA to test after I do some more work on some other updates and new features... it might be a week or two though.
Image
Albert Wiersch

User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 573
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: IE Hacks detected

Post by RSteinwand » Wed Jun 22, 2016 5:18 pm

Hi Albert,

I'm always available for you for testing.

Thanks.
Rick

Post Reply