WordPress.org

Make WordPress Core

Opened 19 months ago

Closed 18 months ago

Last modified 18 months ago

#22095 closed defect (bug) (fixed)

Twenty Twelve: markup fails HTML validation

Reported by: 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)

comment:1 SergeyBiryukov19 months ago

  • Component changed from General to Bundled Theme

comment:2 follow-up: lancewillett19 months 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.

comment:3 in reply to: ↑ 2 alexvorn219 months ago

Replying to lancewillett:

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

Version 0, edited 19 months ago by alexvorn2 (next)

comment:4 follow-up: lancewillett19 months 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.

comment:5 in reply to: ↑ 4 ; follow-ups: alexvorn219 months 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." ?

comment:6 in reply to: ↑ 5 SergeyBiryukov19 months ago

Replying to alexvorn2:

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

Related: #17632, #20333

comment:7 in reply to: ↑ 5 lancewillett18 months 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.

comment:8 lancewillett18 months 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 18 months ago by lancewillett (previous) (diff)

comment:9 lancewillett18 months ago

In [22206]:

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

comment:10 lancewillett18 months ago

In [22207]:

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

comment:11 lancewillett18 months ago

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

comment:12 lancewillett18 months ago

In [22213]:

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

comment:13 lancewillett18 months 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.