Skip to content
Browse files

Use rel="stylesheet" in lowercase as prescribed by XHTML standards (c…

…loses #8910) [RSL]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7558 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 15467a4 commit 2f8146bc5e7711a6823ce095bb2be3e42012de2b @dhh dhh committed Sep 22, 2007
View
44 actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -18,7 +18,7 @@ module Helpers #:nodoc:
# image_tag("rails.png")
# => <img src="http://assets.example.com/images/rails.png" alt="Rails" />
# stylesheet_include_tag("application")
- # => <link href="http://assets.example.com/stylesheets/application.css" media="screen" rel="Stylesheet" type="text/css" />
+ # => <link href="http://assets.example.com/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
#
# This is useful since browsers typically open at most two connections to a single host,
# which means your assets often wait in single file for their turn to load. You can
@@ -29,7 +29,7 @@ module Helpers #:nodoc:
# image_tag("rails.png")
# => <img src="http://assets0.example.com/images/rails.png" alt="Rails" />
# stylesheet_include_tag("application")
- # => <link href="http://assets3.example.com/stylesheets/application.css" media="screen" rel="Stylesheet" type="text/css" />
+ # => <link href="http://assets3.example.com/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
#
# To do this, you can either setup four actual hosts, or you can use wildcard DNS to CNAME
# the wildcard to a single asset host. You can read more about setting up your DNS CNAME records from
@@ -232,30 +232,30 @@ def stylesheet_path(source)
#
# ==== Examples
# stylesheet_link_tag "style" # =>
- # <link href="/stylesheets/style.css" media="screen" rel="Stylesheet" type="text/css" />
+ # <link href="/stylesheets/style.css" media="screen" rel="stylesheet" type="text/css" />
#
# stylesheet_link_tag "style.css" # =>
- # <link href="/stylesheets/style.css" media="screen" rel="Stylesheet" type="text/css" />
+ # <link href="/stylesheets/style.css" media="screen" rel="stylesheet" type="text/css" />
#
# stylesheet_link_tag "http://www.railsapplication.com/style.css" # =>
- # <link href="http://www.railsapplication.com/style.css" media="screen" rel="Stylesheet" type="text/css" />
+ # <link href="http://www.railsapplication.com/style.css" media="screen" rel="stylesheet" type="text/css" />
#
# stylesheet_link_tag "style", :media => "all" # =>
- # <link href="/stylesheets/style.css" media="all" rel="Stylesheet" type="text/css" />
+ # <link href="/stylesheets/style.css" media="all" rel="stylesheet" type="text/css" />
#
# stylesheet_link_tag "style", :media => "print" # =>
- # <link href="/stylesheets/style.css" media="print" rel="Stylesheet" type="text/css" />
+ # <link href="/stylesheets/style.css" media="print" rel="stylesheet" type="text/css" />
#
# stylesheet_link_tag "random.styles", "/css/stylish" # =>
- # <link href="/stylesheets/random.styles" media="screen" rel="Stylesheet" type="text/css" />
- # <link href="/css/stylish.css" media="screen" rel="Stylesheet" type="text/css" />
+ # <link href="/stylesheets/random.styles" media="screen" rel="stylesheet" type="text/css" />
+ # <link href="/css/stylish.css" media="screen" rel="stylesheet" type="text/css" />
#
# You can also include all styles in the stylesheet directory using :all as the source:
#
# stylesheet_link_tag :all # =>
- # <link href="/stylesheets/style1.css" media="screen" rel="Stylesheet" type="text/css" />
- # <link href="/stylesheets/styleB.css" media="screen" rel="Stylesheet" type="text/css" />
- # <link href="/stylesheets/styleX2.css" media="screen" rel="Stylesheet" type="text/css" />
+ # <link href="/stylesheets/style1.css" media="screen" rel="stylesheet" type="text/css" />
+ # <link href="/stylesheets/styleB.css" media="screen" rel="stylesheet" type="text/css" />
+ # <link href="/stylesheets/styleX2.css" media="screen" rel="stylesheet" type="text/css" />
#
# == Caching multiple stylesheets into one
#
@@ -266,20 +266,20 @@ def stylesheet_path(source)
#
# ==== Examples
# stylesheet_link_tag :all, :cache => true # when ActionController::Base.perform_caching is false =>
- # <link href="/stylesheets/style1.css" media="screen" rel="Stylesheet" type="text/css" />
- # <link href="/stylesheets/styleB.css" media="screen" rel="Stylesheet" type="text/css" />
- # <link href="/stylesheets/styleX2.css" media="screen" rel="Stylesheet" type="text/css" />
+ # <link href="/stylesheets/style1.css" media="screen" rel="stylesheet" type="text/css" />
+ # <link href="/stylesheets/styleB.css" media="screen" rel="stylesheet" type="text/css" />
+ # <link href="/stylesheets/styleX2.css" media="screen" rel="stylesheet" type="text/css" />
#
# stylesheet_link_tag :all, :cache => true # when ActionController::Base.perform_caching is true =>
- # <link href="/stylesheets/all.css" media="screen" rel="Stylesheet" type="text/css" />
+ # <link href="/stylesheets/all.css" media="screen" rel="stylesheet" type="text/css" />
#
# stylesheet_link_tag "shop", "cart", "checkout", :cache => "payment" # when ActionController::Base.perform_caching is false =>
- # <link href="/stylesheets/shop.css" media="screen" rel="Stylesheet" type="text/css" />
- # <link href="/stylesheets/cart.css" media="screen" rel="Stylesheet" type="text/css" />
- # <link href="/stylesheets/checkout.css" media="screen" rel="Stylesheet" type="text/css" />
+ # <link href="/stylesheets/shop.css" media="screen" rel="stylesheet" type="text/css" />
+ # <link href="/stylesheets/cart.css" media="screen" rel="stylesheet" type="text/css" />
+ # <link href="/stylesheets/checkout.css" media="screen" rel="stylesheet" type="text/css" />
#
# stylesheet_link_tag "shop", "cart", "checkout", :cache => "payment" # when ActionController::Base.perform_caching is true =>
- # <link href="/stylesheets/payment.css" media="screen" rel="Stylesheet" type="text/css" />
+ # <link href="/stylesheets/payment.css" media="screen" rel="stylesheet" type="text/css" />
def stylesheet_link_tag(*sources)
options = sources.extract_options!.stringify_keys
cache = options.delete("cache")
@@ -299,15 +299,15 @@ def stylesheet_link_tag(*sources)
end
tag("link", {
- "rel" => "Stylesheet", "type" => Mime::CSS, "media" => "screen",
+ "rel" => "stylesheet", "type" => Mime::CSS, "media" => "screen",
"href" => stylesheet_path(joined_stylesheet_name)
}.merge(options))
else
options.delete("cache")
expand_stylesheet_sources(sources).collect do |source|
tag("link", {
- "rel" => "Stylesheet", "type" => Mime::CSS, "media" => "screen", "href" => stylesheet_path(source)
+ "rel" => "stylesheet", "type" => Mime::CSS, "media" => "screen", "href" => stylesheet_path(source)
}.merge(options))
end.join("\n")
end
View
28 actionpack/test/template/asset_tag_helper_test.rb
@@ -86,15 +86,15 @@ def teardown
}
StyleLinkToTag = {
- %(stylesheet_link_tag("style")) => %(<link href="/stylesheets/style.css" media="screen" rel="Stylesheet" type="text/css" />),
- %(stylesheet_link_tag("style.css")) => %(<link href="/stylesheets/style.css" media="screen" rel="Stylesheet" type="text/css" />),
- %(stylesheet_link_tag("/dir/file")) => %(<link href="/dir/file.css" media="screen" rel="Stylesheet" type="text/css" />),
- %(stylesheet_link_tag("dir/file")) => %(<link href="/stylesheets/dir/file.css" media="screen" rel="Stylesheet" type="text/css" />),
- %(stylesheet_link_tag("style", :media => "all")) => %(<link href="/stylesheets/style.css" media="all" rel="Stylesheet" type="text/css" />),
- %(stylesheet_link_tag(:all)) => %(<link href="/stylesheets/bank.css" media="screen" rel="Stylesheet" type="text/css" />\n<link href="/stylesheets/robber.css" media="screen" rel="Stylesheet" type="text/css" />),
- %(stylesheet_link_tag(:all, :media => "all")) => %(<link href="/stylesheets/bank.css" media="all" rel="Stylesheet" type="text/css" />\n<link href="/stylesheets/robber.css" media="all" rel="Stylesheet" type="text/css" />),
- %(stylesheet_link_tag("random.styles", "/css/stylish")) => %(<link href="/stylesheets/random.styles" media="screen" rel="Stylesheet" type="text/css" />\n<link href="/css/stylish.css" media="screen" rel="Stylesheet" type="text/css" />),
- %(stylesheet_link_tag("http://www.example.com/styles/style")) => %(<link href="http://www.example.com/styles/style.css" media="screen" rel="Stylesheet" type="text/css" />)
+ %(stylesheet_link_tag("style")) => %(<link href="/stylesheets/style.css" media="screen" rel="stylesheet" type="text/css" />),
+ %(stylesheet_link_tag("style.css")) => %(<link href="/stylesheets/style.css" media="screen" rel="stylesheet" type="text/css" />),
+ %(stylesheet_link_tag("/dir/file")) => %(<link href="/dir/file.css" media="screen" rel="stylesheet" type="text/css" />),
+ %(stylesheet_link_tag("dir/file")) => %(<link href="/stylesheets/dir/file.css" media="screen" rel="stylesheet" type="text/css" />),
+ %(stylesheet_link_tag("style", :media => "all")) => %(<link href="/stylesheets/style.css" media="all" rel="stylesheet" type="text/css" />),
+ %(stylesheet_link_tag(:all)) => %(<link href="/stylesheets/bank.css" media="screen" rel="stylesheet" type="text/css" />\n<link href="/stylesheets/robber.css" media="screen" rel="stylesheet" type="text/css" />),
+ %(stylesheet_link_tag(:all, :media => "all")) => %(<link href="/stylesheets/bank.css" media="all" rel="stylesheet" type="text/css" />\n<link href="/stylesheets/robber.css" media="all" rel="stylesheet" type="text/css" />),
+ %(stylesheet_link_tag("random.styles", "/css/stylish")) => %(<link href="/stylesheets/random.styles" media="screen" rel="stylesheet" type="text/css" />\n<link href="/css/stylish.css" media="screen" rel="stylesheet" type="text/css" />),
+ %(stylesheet_link_tag("http://www.example.com/styles/style")) => %(<link href="http://www.example.com/styles/style.css" media="screen" rel="stylesheet" type="text/css" />)
}
ImagePathToTag = {
@@ -248,14 +248,14 @@ def test_caching_stylesheet_link_tag_when_caching_on
ActionController::Base.perform_caching = true
assert_dom_equal(
- %(<link href="http://a3.example.com/stylesheets/all.css" media="screen" rel="Stylesheet" type="text/css" />),
+ %(<link href="http://a3.example.com/stylesheets/all.css" media="screen" rel="stylesheet" type="text/css" />),
stylesheet_link_tag(:all, :cache => true)
)
assert File.exists?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
assert_dom_equal(
- %(<link href="http://a3.example.com/stylesheets/money.css" media="screen" rel="Stylesheet" type="text/css" />),
+ %(<link href="http://a3.example.com/stylesheets/money.css" media="screen" rel="stylesheet" type="text/css" />),
stylesheet_link_tag(:all, :cache => "money")
)
@@ -270,14 +270,14 @@ def test_caching_stylesheet_include_tag_when_caching_off
ActionController::Base.perform_caching = false
assert_dom_equal(
- %(<link href="/stylesheets/bank.css" media="screen" rel="Stylesheet" type="text/css" />\n<link href="/stylesheets/robber.css" media="screen" rel="Stylesheet" type="text/css" />),
+ %(<link href="/stylesheets/bank.css" media="screen" rel="stylesheet" type="text/css" />\n<link href="/stylesheets/robber.css" media="screen" rel="stylesheet" type="text/css" />),
stylesheet_link_tag(:all, :cache => true)
)
assert !File.exists?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
assert_dom_equal(
- %(<link href="/stylesheets/bank.css" media="screen" rel="Stylesheet" type="text/css" />\n<link href="/stylesheets/robber.css" media="screen" rel="Stylesheet" type="text/css" />),
+ %(<link href="/stylesheets/bank.css" media="screen" rel="stylesheet" type="text/css" />\n<link href="/stylesheets/robber.css" media="screen" rel="stylesheet" type="text/css" />),
stylesheet_link_tag(:all, :cache => "money")
)
@@ -337,7 +337,7 @@ def test_should_compute_proper_path_with_asset_host
def test_should_ignore_asset_host_on_complete_url
ActionController::Base.asset_host = "http://assets.example.com"
- assert_dom_equal(%(<link href="http://bar.example.com/stylesheets/style.css" media="screen" rel="Stylesheet" type="text/css" />), stylesheet_link_tag("http://bar.example.com/stylesheets/style.css"))
+ assert_dom_equal(%(<link href="http://bar.example.com/stylesheets/style.css" media="screen" rel="stylesheet" type="text/css" />), stylesheet_link_tag("http://bar.example.com/stylesheets/style.css"))
ensure
ActionController::Base.asset_host = ""
end

0 comments on commit 2f8146b

Please sign in to comment.
Something went wrong with that request. Please try again.