aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAlex Peattie <alexpeattie@gmail.com>2013-06-14 23:47:21 +0100
committerAlex Peattie <alexpeattie@gmail.com>2013-06-14 23:47:21 +0100
commita89bdc04bae7253b9f442fc0106aeca8284e75a2 (patch)
treef915ad8e3730c724bccecfff1bd5b093cfd519fb /actionpack
parent6e34601653614ca98f632d14662b4852bc351abe (diff)
downloadrails-a89bdc04bae7253b9f442fc0106aeca8284e75a2.tar.gz
rails-a89bdc04bae7253b9f442fc0106aeca8284e75a2.tar.bz2
rails-a89bdc04bae7253b9f442fc0106aeca8284e75a2.zip
Update the HTML boolean attributes per the HTML 5.1 spec
- Add attributes `allowfullscreen`, `default`, `inert`, `sortable`, `truespeed`, `typemustmatch`. - Fix attribute `seamless` (previously misspelled `seemless`). - Use `assert_dom_equal` instead of `assert_equal` in test.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG.md7
-rw-r--r--actionpack/lib/action_view/helpers/tag_helper.rb7
-rw-r--r--actionpack/test/template/tag_helper_test.rb4
3 files changed, 14 insertions, 4 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md
index 6f5027dc23..8996c38c61 100644
--- a/actionpack/CHANGELOG.md
+++ b/actionpack/CHANGELOG.md
@@ -1,3 +1,10 @@
+* Update the HTML `BOOLEAN_ATTRIBUTES` in `ActionView::Helpers::TagHelper`
+ to conform to the latest HTML 5.1 spec. Add attributes `allowfullscreen`,
+ `default`, `inert`, `sortable`, `truespeed`, `typemustmatch`. Fix attribute
+ `seamless` (previously misspelled `seemless`).
+
+ *Alex Peattie*
+
* Fix an issue where partials with a number in the filename weren't being digested for cache dependencies.
*Bryan Ricker*
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb
index 3939e4737b..732f35643a 100644
--- a/actionpack/lib/action_view/helpers/tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/tag_helper.rb
@@ -12,8 +12,11 @@ module ActionView
BOOLEAN_ATTRIBUTES = %w(disabled readonly multiple checked autobuffer
autoplay controls loop selected hidden scoped async
- defer reversed ismap seemless muted required
- autofocus novalidate formnovalidate open pubdate itemscope).to_set
+ defer reversed ismap seamless muted required
+ autofocus novalidate formnovalidate open pubdate
+ itemscope allowfullscreen default inert sortable
+ truespeed typemustmatch).to_set
+
BOOLEAN_ATTRIBUTES.merge(BOOLEAN_ATTRIBUTES.map {|attribute| attribute.to_sym })
PRE_CONTENT_STRINGS = {
diff --git a/actionpack/test/template/tag_helper_test.rb b/actionpack/test/template/tag_helper_test.rb
index 9e711c6529..802da5d566 100644
--- a/actionpack/test/template/tag_helper_test.rb
+++ b/actionpack/test/template/tag_helper_test.rb
@@ -30,8 +30,8 @@ class TagHelperTest < ActionView::TestCase
end
def test_tag_options_converts_boolean_option
- assert_equal '<p disabled="disabled" itemscope="itemscope" multiple="multiple" readonly="readonly" />',
- tag("p", :disabled => true, :itemscope => true, :multiple => true, :readonly => true)
+ assert_dom_equal '<p disabled="disabled" itemscope="itemscope" multiple="multiple" readonly="readonly" allowfullscreen="allowfullscreen" seamless="seamless" typemustmatch="typemustmatch" sortable="sortable" default="default" inert="inert" truespeed="truespeed" />',
+ tag("p", :disabled => true, :itemscope => true, :multiple => true, :readonly => true, :allowfullscreen => true, :seamless => true, :typemustmatch => true, :sortable => true, :default => true, :inert => true, :truespeed => true)
end
def test_content_tag