Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#9423 closed defect (bug) (fixed)

Output Broken: Invalid XHTML within Backend Head: Noscript and Style Elements

Reported by: hakre's profile hakre Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.7.1
Component: Validation Keywords: has-patch
Focuses: Cc:

Description

The XHTML Output done by the Backend has a HEAD Element containing a NOSCRIPT and a STYLE Element that does not validate.

I attached a patch that did fix the output so that it produces valid XHTML in that section.

Tested the Patch (Presto, MSHTML, Gecko, Webkit).

Attachments (1)

qcop-r00-admin-header.patch (1.2 KB) - added by hakre 15 years ago.
Patch for wp-admin/admin-header.php

Download all attachments as: .zip

Change History (8)

@hakre
15 years ago

Patch for wp-admin/admin-header.php

#1 @azaozz
15 years ago

Does it always work in WebKit browsers. We had something similar before but had to replace it because it was failing in WebKit (it would sometimes apply and keep the style despite that it's removed).

Best solution here would have been to add external stylesheet then set it to "disabled" with js but WebKit doesn't support that either. There seems to be another way of doing it too, adding or removing a parent css class on the html element from whitin the head. Testing that now.

#2 @hakre
15 years ago

if the style element needs another parent element to be removed, that can be done with only another smaller change. I tested that patch against webkit on win32/google chrome, so maybe a mac osx test makes sense as well.

for testing I added another css rule (body {background:#f00;}) and then disabled javascript within the browser.

#3 follow-up: @hakre
15 years ago

[10869] might be related / for info.

#4 in reply to: ↑ 3 ; follow-up: @azaozz
15 years ago

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

Fixed in [10869]

Replying to hakre:
The patch here seems to work ok too, but doesn't fix the menu flicker if folded on load. Added some js that replaces a class on the body, that way it can be used in many places without needing additional selectors.

#5 in reply to: ↑ 4 @hakre
15 years ago

Replying to azaozz:

Fixed in [10869]

Replying to hakre:
The patch here seems to work ok too, but doesn't fix the menu flicker if folded on load. Added some js that replaces a class on the body, that way it can be used in many places without needing additional selectors.

i've seen that it was related. just checked against the latest SVN looks clean and solved :D. nice approach with replacing a classname by js instead of removing css blocks. really makes more sense, especially when having that class on the body element (maybe html element as well?).

#6 @azaozz
15 years ago

Yes, seems to work on the <html> element too but strictly speaking classes are invalid there and may eventually fail in some browsers.

#7 @hakre
15 years ago

for html that might be true, but because css does not validate elements it checks only for the dom nodes attributes. so this needs only valid syntax not markup validity.

Note: See TracTickets for help on using tickets.