Skip to content

Commit 1e07e0f

Browse files
committedFeb 4, 2014
dom/element/attributes: some fixes for name polyfills
1 parent 0dfd47b commit 1e07e0f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎opal/browser/dom/element/attributes.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
module Browser; module DOM; class Element < Node
22

33
class Attributes
4-
@@normalize = {}
4+
@@normalize = `{}`
Has conversations. Original line has conversations.
55

66
if Browser.supports? 'Element.className'
7-
@@normalize[:class] = :className
7+
`#@@normalize['class'] = 'className'`
88
end
99

1010
if Browser.supports? 'Element.htmlFor'
11-
@@normalize[:for] = :htmlFor
11+
`#@@normalize['for'] = 'htmlFor'`
1212
end
1313

1414
attr_reader :namespace
@@ -20,7 +20,7 @@ def initialize(element, options)
2020
end
2121

2222
def [](name, options = {})
23-
name = @@normalize[name] || name
23+
name = `#@@normalize[name] || name`
2424

2525
if namespace = options[:namespace] || @namespace
2626
`#@native.getAttributeNS(#{namespace.to_s}, #{name.to_s}) || nil`
@@ -30,7 +30,7 @@ def [](name, options = {})
3030
end
3131

3232
def []=(name, value, options = {})
33-
name = @@normalize[name] || name
33+
name = `#@@normalize[name] || name`
3434

3535
if namespace = options[:namespace] || @namespace
3636
`#@native.setAttributeNS(#{namespace.to_s}, #{name.to_s}, #{value})`

‎opal/browser/support.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ def self.supports?(feature)
122122

123123
when 'Element.for'
124124
%x{
125-
var div = document.createElement("div");
125+
var div = document.createElement("label");
126126
div.setAttribute('for', 'x');
127127
128128
return div.htmlFor === 'x';
129129
}
130130

131131
when 'Element.htmlFor'
132132
%x{
133-
var div = document.createElement("div");
133+
var div = document.createElement("label");
134134
div.setAttribute('htmlFor', 'x');
135135
136136
return div.htmlFor === 'x';

0 commit comments

Comments
 (0)
Please sign in to comment.