#28065 closed defect (bug) (duplicate)
<style type='text/css'> should be <style scoped> in wp-includes/media.php
Reported by: | La Geek | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.9 |
Component: | Gallery | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
You can't see it in theme "twenty fourteen". But if you activate e.g. genesis, you'll get a valdiation error -> "Element style is missing required attribute scoped."
This error is a result of line 1015 in wp-includes/media.php of WP 3.9 final version
if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) { $gallery_style = " <style type='text/css'> #{$selector} { margin: auto; }
Change <style type='text/css'>
to <style scoped>
and the validation error is fixed. More informations -> http://html5doctor.com/the-scoped-attribute/
I would apply a patch, if I would know, how to do this here. This here is not github. And on github I pulled wp 4.0, for this I could do a patch. But I guess here is another tracking and subversion system so I am lost. However it is only one line, that must be changed, so no big deal also without a patch of mine :)
Change History (7)
#1
in reply to:
↑ description
@
11 years ago
#2
@
11 years ago
<style scoped> is currently Firefox only, with 13% browser support. Suggest holding off on this until it becomes clear that other browsers will be supporting it.
#3
@
11 years ago
Sorry for my typo, it's named scoped and not scope.
Sabreuse, you are totally right, therefore I wrote the link of html5doctor, where you can read the same. More then this the article contains a workaround/link "jQuery Scoped CSS plugin". Something like a polyfill.
It's no good practise to get W3C errors. The best way would be, to avoid inline styles. But I don't know, why they exist at all in media.php - so I can't judge it.
#4
@
11 years ago
- Component changed from Media to Gallery
- Description modified (diff)
- Summary changed from <style type='text/css'> should be <style scope> in wp-includes media.php to <style type='text/css'> should be <style scoped> in wp-includes/media.php
Replying to La Geek:
Sorry, I forgot to mention, that this error appears with inserted gallery.