Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#28151 closed defect (bug) (fixed)

IE <html> tag uses wrong conditional logic

Reported by: mikemanger's profile mikemanger Owned by: lancewillett's profile lancewillett
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.2
Component: Bundled Theme Keywords: has-patch commit
Focuses: Cc:

Description

Currently all bundled themes from twentyeleven use an OR operator ( | ) for the last <html> conditional statement:

<!--[if !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->

This means that both IE 7 and 8 parse the default <html> tag but apparently they just use the first one they are given (the last if statement is redundant).

Ref: http://msdn.microsoft.com/en-gb/library/ms537512(v=vs.85).aspx#syntax

Attachments (1)

28151.patch (1.9 KB) - added by mikemanger 11 years ago.

Download all attachments as: .zip

Change History (6)

@mikemanger
11 years ago

#1 @mikemanger
11 years ago

The patch simply replaces | with & (the AND operator) and removes an extra space from eleven, twelve and thirteen. Best way I could think of testing it was to add in some junk text inside each statement (so with the OR operator, IE8 prints the text in the default <html> block)

Last edited 11 years ago by mikemanger (previous) (diff)

#2 @SergeyBiryukov
11 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.0
  • Version changed from 3.7 to 3.2

Introduced in [17718].

#3 @SergeyBiryukov
11 years ago

  • Keywords commit added

#4 @lancewillett
11 years ago

Great find! Thanks for the report and patch.

#5 @lancewillett
11 years ago

  • Owner set to lancewillett
  • Resolution set to fixed
  • Status changed from new to closed

In 28341:

Bundled themes: use correct logic in IE conditional comments in header template. Props mikemanger, fixes #28151.

Note: See TracTickets for help on using tickets.