Issue #1174756 by linclark, karschsp, amateescu, rupl: Convert <head> markup to HTML5.

8.0.x
catch 2011-11-19 00:06:47 +09:00
parent 9f25d6a592
commit b9c47a3f46
3 changed files with 3 additions and 8 deletions

View File

@ -299,8 +299,7 @@ function _drupal_default_html_head() {
'#type' => 'html_tag', '#type' => 'html_tag',
'#tag' => 'meta', '#tag' => 'meta',
'#attributes' => array( '#attributes' => array(
'http-equiv' => 'Content-Type', 'charset' => 'utf-8',
'content' => 'text/html; charset=utf-8',
), ),
// Security: This always has to be output first. // Security: This always has to be output first.
'#weight' => -1000, '#weight' => -1000,
@ -3198,16 +3197,12 @@ function drupal_pre_render_styles($elements) {
'#type' => 'html_tag', '#type' => 'html_tag',
'#tag' => 'link', '#tag' => 'link',
'#attributes' => array( '#attributes' => array(
'type' => 'text/css',
'rel' => 'stylesheet', 'rel' => 'stylesheet',
), ),
); );
$style_element_defaults = array( $style_element_defaults = array(
'#type' => 'html_tag', '#type' => 'html_tag',
'#tag' => 'style', '#tag' => 'style',
'#attributes' => array(
'type' => 'text/css',
),
); );
// Loop through each group. // Loop through each group.

View File

@ -1682,7 +1682,7 @@ class DrupalWebTestCase extends DrupalTestCase {
// DOM can load HTML soup. But, HTML soup can throw warnings, suppress // DOM can load HTML soup. But, HTML soup can throw warnings, suppress
// them. // them.
$htmlDom = new DOMDocument(); $htmlDom = new DOMDocument();
@$htmlDom->loadHTML($this->drupalGetContent()); @$htmlDom->loadHTML('<?xml encoding="UTF-8">' . $this->drupalGetContent());
if ($htmlDom) { if ($htmlDom) {
$this->pass(t('Valid HTML found on "@path"', array('@path' => $this->getUrl())), t('Browser')); $this->pass(t('Valid HTML found on "@path"', array('@path' => $this->getUrl())), t('Browser'));
// It's much easier to work with simplexml than DOM, luckily enough // It's much easier to work with simplexml than DOM, luckily enough

View File

@ -669,7 +669,7 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase {
*/ */
function testRenderInlinePreprocess() { function testRenderInlinePreprocess() {
$css = 'body { padding: 0px; }'; $css = 'body { padding: 0px; }';
$css_preprocessed = '<style type="text/css" media="all">' . "\n<!--/*--><![CDATA[/*><!--*/\n" . drupal_load_stylesheet_content($css, TRUE) . "\n/*]]>*/-->\n" . '</style>'; $css_preprocessed = '<style media="all">' . "\n<!--/*--><![CDATA[/*><!--*/\n" . drupal_load_stylesheet_content($css, TRUE) . "\n/*]]>*/-->\n" . '</style>';
drupal_add_css($css, array('type' => 'inline')); drupal_add_css($css, array('type' => 'inline'));
$styles = drupal_get_css(); $styles = drupal_get_css();
$this->assertEqual(trim($styles), $css_preprocessed, t('Rendering preprocessed inline CSS adds it to the page.')); $this->assertEqual(trim($styles), $css_preprocessed, t('Rendering preprocessed inline CSS adds it to the page.'));