diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-02-25 20:57:39 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-02-25 20:57:39 +0000 |
commit | 96b9d512c3e037ded1b076e18fc4b6821e3485a5 (patch) | |
tree | 36876bfc053ae5b6109648dd37a68312eee8e3cd /modules | |
parent | 6d7e7bb8a31910de2acf6b9e7dd8bb3eb2886dd2 (diff) | |
download | brdo-96b9d512c3e037ded1b076e18fc4b6821e3485a5.tar.gz brdo-96b9d512c3e037ded1b076e18fc4b6821e3485a5.tar.bz2 |
- Patch #228818 by effulgentsia, JonathanRoberts: IE stylesheets ignored after 31 link/style tags.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/simpletest/tests/common.test | 14 | ||||
-rw-r--r-- | modules/system/system.module | 8 |
2 files changed, 16 insertions, 6 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index 7b64d46c4..9a93d75c8 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -558,7 +558,9 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { $css = 'http://example.com/style.css'; drupal_add_css($css, 'external'); $styles = drupal_get_css(); - $this->assertTrue(strpos($styles, 'href="' . $css) > 0, t('Rendering an external CSS file.')); + // Stylesheet URL may be the href of a LINK tag or in an @import statement + // of a STYLE tag. + $this->assertTrue(strpos($styles, 'href="' . $css) > 0 || strpos($styles, '@import url("' . $css . '")') > 0, t('Rendering an external CSS file.')); } /** @@ -566,10 +568,10 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { */ function testRenderInlinePreprocess() { $css = 'body { padding: 0px; }'; - $css_preprocessed = '<style type="text/css">' . drupal_load_stylesheet_content($css, TRUE) . '</style>'; + $css_preprocessed = '<style type="text/css" media="all">' . drupal_load_stylesheet_content($css, TRUE) . '</style>'; drupal_add_css($css, 'inline'); $styles = drupal_get_css(); - $this->assertEqual($styles, "\n" . $css_preprocessed . "\n", 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.')); } /** @@ -631,8 +633,10 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { $styles = drupal_get_css(); - if (preg_match_all('/href="' . preg_quote($GLOBALS['base_url'] . '/', '/') . '([^?]+)\?/', $styles, $matches)) { - $result = $matches[1]; + // Stylesheet URL may be the href of a LINK tag or in an @import statement + // of a STYLE tag. + if (preg_match_all('/(href="|url\(")' . preg_quote($GLOBALS['base_url'] . '/', '/') . '([^?]+)\?/', $styles, $matches)) { + $result = $matches[2]; } else { $result = array(); diff --git a/modules/system/system.module b/modules/system/system.module index 56c63f198..5536cc757 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -311,12 +311,18 @@ function system_element_info() { $types['ajax_commands'] = array( '#ajax_commands' => array(), ); - $types['html_tag'] = array( '#theme' => 'html_tag', + '#pre_render' => array('drupal_pre_render_conditional_comments'), '#attributes' => array(), '#value' => NULL, ); + $types['styles'] = array( + '#items' => array(), + '#pre_render' => array('drupal_pre_render_styles'), + '#group_callback' => 'drupal_group_css', + '#aggregate_callback' => 'drupal_aggregate_css', + ); // Input elements. $types['submit'] = array( |