Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#9486 closed enhancement (fixed)

Scripts and stylesheets should not have an ID

Reported by: denis-de-bernardy's profile Denis-de-Bernardy Owned by: azaozz's profile azaozz
Milestone: 2.8 Priority: low
Severity: minor Version: 2.8
Component: JavaScript Keywords: has-patch tested commit
Focuses: Cc:

Description

Just noticed on my dev site (2.8), things like this in the page's head section:

<link rel='stylesheet' id='myscript' ....

It was inserted using wp_print_styles().

Some browsers (and validators) will complain if the same ID is used further down in the actual content, and this can cause scripts to ultimately fail. Are there any good reasons for these IDs to be set?

Attachments (2)

9486.2.diff (1.3 KB) - added by Denis-de-Bernardy 17 years ago.
with -css added
9486.diff (1.3 KB) - added by Denis-de-Bernardy 17 years ago.
without id

Download all attachments as: .zip

Change History (6)

#1 @azaozz
17 years ago

  • Priority changed from high to low
  • Severity changed from major to minor
  • Type changed from defect (bug) to enhancement

You mean the IDs on the <link> elements in the head? No, they aren't used currently by default but would allow for some nice "css tricks" by dynamically switching stylesheets on and off, like changing the typeface, font size, or even the whole color scheme. They will probably be used in the future, better to have them in place.

Don't think there are any HTML ID conflicts in the admin. Can probably change these IDs to include "-css" at the end just in case.

@Denis-de-Bernardy
17 years ago

with -css added

@Denis-de-Bernardy
17 years ago

without id

#2 @Denis-de-Bernardy
17 years ago

  • Keywords has-patch tested commit added

have it whichever way you prefer, both patches are attached

#3 @azaozz
17 years ago

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

(In [10899]) Append "-css" to the IDs for <link rel="stylesheet"> tags in the head, props Denis-de-Bernardy, fixes #9486

#4 @Viper007Bond
17 years ago

  • Summary changed from Scripts and tylesheets should not have an ID to Scripts and stylesheets should not have an ID
Note: See TracTickets for help on using tickets.