Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22095 closed defect (bug) (fixed)

Twenty Twelve: markup fails HTML validation

Reported by: alexvorn2's profile alexvorn2 Owned by:
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: close
Focuses: Cc:

Description

http://validator.w3.org/ - the theme gives me 4 errors, most can be found in twentytwelve_entry_meta() function like:

	$date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a>',
		esc_url( get_permalink() ),
		esc_attr( get_the_time() ),
		esc_attr( get_the_date( 'c' ) ),
		esc_html( get_the_date() )
	);

Error example:
"Attribute pubdate not allowed on element time at this point."

There are other errors, the point of this ticket is to check all possible errors and make the theme validated.

Change History (13)

#1 @SergeyBiryukov
11 years ago

  • Component changed from General to Bundled Theme

#2 follow-up: @lancewillett
11 years ago

  • Keywords close added

We've already validated the HTML heavily during theme development and fixed broken things having to do with the theme markup.

Looking at the validator results again today all the warnings I see are for attributes that are not allowed, which appear to come from using WP core functionality -- not from markup included in the theme itself.

Suggest close as wontfix unless there are actionable items you think WP core should fix.

#3 in reply to: ↑ 2 @alexvorn2
11 years ago

Replying to lancewillett:

this is not my first ticket here!
Steps to replicate: open the source of the html code, copy, go to the site: http://validator.w3.org/ , paste and submit, you will get from 4 to 20 errors...

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

#4 follow-up: @lancewillett
11 years ago

  • Summary changed from Invalid markup of Twenty Twelve to Twenty Twelve: markup fails HTML validation

Oh, I see pubdate in the example you posted now, sorry about misreading the report.

Per http://www.w3.org/html/wg/tracker/issues/185 it's still in HTML spec, I'd like to still use it until it's officially dropped.

The key with HTML (and CSS) validation is understanding *why* something is reported as invalid and why it's OK to ignore the warning. In this case, it's safe to ignore it.

#5 in reply to: ↑ 4 ; follow-ups: @alexvorn2
11 years ago

Replying to lancewillett:

Oh, I see pubdate in the example you posted now, sorry about misreading the report.

Per http://www.w3.org/html/wg/tracker/issues/185 it's still in HTML spec, I'd like to still use it until it's officially dropped.

The key with HTML (and CSS) validation is understanding *why* something is reported as invalid and why it's OK to ignore the warning. In this case, it's safe to ignore it.

What about: "Bad value category tag for attribute rel on element a: Keyword category is not registered." ?

#6 in reply to: ↑ 5 @SergeyBiryukov
11 years ago

Replying to alexvorn2:

What about: "Bad value category tag for attribute rel on element a: Keyword category is not registered." ?

Related: #17632, #20333

#7 in reply to: ↑ 5 @lancewillett
11 years ago

Replying to alexvorn2:

What about: "Bad value category tag for attribute rel on element a: Keyword category is not registered." ?

Much discussion on those elsewhere, as noted above.

#8 @lancewillett
11 years ago

  • Milestone changed from Awaiting Review to 3.5

More clarity to this discussion:

Three basic validation failures:

  1. rel value of category not allowed — covered in #17632, and comes from WP core code
  2. rel value of generator not allowed — no longer in Microformats spec (can't find a history of it anywhere); originally came from the Sandbox theme by Scott Wallick
  3. pubdate in the time element — dropped from both living specs (WHATWG and W3C WG)

After discussion in #wordpress-dev IRC and also consulting with @iandstewart on the history of 2 and 3 — seems best to remove 2 and 3 from all the default themes at this point.

IRC log

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

#9 @lancewillett
11 years ago

In [22206]:

Twenty Twelve: remove invalid pubdate value from time elements. See #22095.

#10 @lancewillett
11 years ago

In [22207]:

Twenty Twelve: remove invalid rel attribute generator from footer markup, see #22095.

#11 @lancewillett
11 years ago

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

#12 @lancewillett
11 years ago

In [22213]:

Twenty Eleven: remove invalid pubdate value from time elements. See #22095.

#13 @lancewillett
11 years ago

In [22214]:

Twenty Ten and Eleven: remove invalid rel attribute generator from footer markup, see #22095.

Note: See TracTickets for help on using tickets.