WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#12429 closed defect (bug) (fixed)

onclick/onClick attribute should all be lowercase

Reported by: TobiasBg Owned by:
Priority: normal Milestone: 3.0
Component: General Version:
Severity: normal Keywords: has-patch commit
Cc:

Description

dd32 mentioned that various code editors replace "onclick" attributes with "onClick".
However, this breaks XHTML validation as all attributes need to be lowercase.
Recent commits ([13242], [13503]) commited such changes to core.

Attached patch replaces all found (grep) occurances of "onClick" in core with "onclick".

Attachments (3)

12429-onclick.patch (6.1 KB) - added by TobiasBg 3 years ago.
Patch replaces "onClick" with "onclick" throughout core
12429.diff (32.1 KB) - added by Denis-de-Bernardy 3 years ago.
12429.2.patch (3.6 KB) - added by TobiasBg 3 years ago.
Patch to replace "onClick" with "onclick", introduced in [13600]

Download all attachments as: .zip

Change History (12)

TobiasBg3 years ago

Patch replaces "onClick" with "onclick" throughout core

comment:1 nacin3 years ago

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

(In [13510]) s/onClick/onclick/. props TobiasBg fixes #12429

Denis-de-Bernardy3 years ago

comment:2 Denis-de-Bernardy3 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

attached patch catches a few more

comment:3 nacin3 years ago

Will handle, though your patch would revert [13503]. Would this otherwise apply clean? Looks like .dev.js sheets are missing.

comment:4 TobiasBg3 years ago

Oh, sht. Didn't check in JavaScript files... Thanks Denis!

Although colorpicker.dev.js will probably need more cleanup, as having all uppercase attributes around a lowercase "onclick" doesn't look to good somehow (and is probably also invalid XHTML):

<A HREF="#" onclick="cp.select(document.forms[0].color,'pick');return false;" NAME="pick" ID="pick">Pick</A>

comment:5 dd323 years ago

Sorry for those again.. I cant for the life of me work out why my code edits are insisting changing those even with that functionality disabled! (And tortoise seems to miss case changes in the preview)

comment:6 nacin3 years ago

  • Type changed from enhancement to defect (bug)

comment:7 TobiasBg3 years ago

dd32 was so kind to change a few more "onClick"s in [13600], so that I'm again able to contribute a little :-)

Attached patch changes them back to "onclick".

The only remaining "onClick"s throughout core are in the .js files as Denis mentioned.

TobiasBg3 years ago

Patch to replace "onClick" with "onclick", introduced in [13600]

comment:8 nacin3 years ago

(In [13612]) s/onClick/onclick/. props TobiasBg, see #12429

comment:9 rmccue3 years ago

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

All of these appear to be gone now.

Note: See TracTickets for help on using tickets.