lib/hatemile/implementation/accessible_css_implementation.rb
##
# Provide the CSS features of speaking and speech properties in element.
#
# @param element [Hatemile::Util::Html::HTMLDOMElement] The element.
# @param rule [Hatemile::Util::Css::StyleSheetRule] The stylesheet rule.
Provide the CSS features of speaking and speech properties in element.
Provide the CSS features of speaking and speech properties in element .
def provide_speak_properties_with_rule(element, rule)
        if rule.has_property?('speak')
          declarations = rule.get_declarations('speak')
          declarations.each do |declaration|
            property_value = declaration.get_value
            if property_value == 'none'
              speak_none_inherit(element)
            elsif property_value == 'normal'
              speak_normal_inherit(element)
            elsif property_value == 'spell-out'
              speak_as_spell_out_inherit(element)
            end
          end
        end
        if rule.has_property?('speak-as')
          declarations = rule.get_declarations('speak-as')
          declarations.each do |declaration|
            speak_as_values = declaration.get_values
            speak_as_normal(element)
            speak_as_values.each do |speak_as_value|
              if speak_as_value == 'spell-out'
                speak_as_spell_out_inherit(element)
              elsif speak_as_value == 'literal-punctuation'
                speak_as_literal_punctuation_inherit(element)
              elsif speak_as_value == 'no-punctuation'
                speak_as_no_punctuation_inherit(element)
              elsif speak_as_value == 'digits'
                speak_as_digits_inherit(element)
              end
            end
          end
        end
        if rule.has_property?('speak-punctuation')
          declarations = rule.get_declarations('speak-punctuation')
          declarations.each do |declaration|
            property_value = declaration.get_value
            if property_value == 'code'
              speak_as_literal_punctuation_inherit(element)
            elsif property_value == 'none'
              speak_as_no_punctuation_inherit(element)
            end
          end
        end
        if rule.has_property?('speak-numeral')
          declarations = rule.get_declarations('speak-numeral')
          declarations.each do |declaration|
            property_value = declaration.get_value
            if property_value == 'digits'
              speak_as_digits_inherit(element)
            elsif property_value == 'continuous'
              speak_as_continuous_inherit(element)
            end
          end
        end
        return unless rule.has_property?('speak-header')
        declarations = rule.get_declarations('speak-header')
        declarations.each do |declaration|
          property_value = declaration.get_value
          if property_value == 'always'
            speak_header_always_inherit(element)
          elsif property_value == 'once'
            speak_header_once_inherit(element)
          end
        end
      end
def provide_speak_properties_with_rule ( element , rule ) if rule . has_property? ( 'speak' ) declarations = rule . get_declarations ( 'speak' ) declarations . each do | declaration | property_value = declaration . get_value if property_value == 'none' speak_none_inherit ( element ) elsif property_value == 'normal' speak_normal_inherit ( element ) elsif property_value == 'spell-out' speak_as_spell_out_inherit ( element ) end end end if rule . has_property? ( 'speak-as' ) declarations = rule . get_declarations ( 'speak-as' ) declarations . each do | declaration | speak_as_values = declaration . get_values speak_as_normal ( element ) speak_as_values . each do | speak_as_value | if speak_as_value == 'spell-out' speak_as_spell_out_inherit ( element ) elsif speak_as_value == 'literal-punctuation' speak_as_literal_punctuation_inherit ( element ) elsif speak_as_value == 'no-punctuation' speak_as_no_punctuation_inherit ( element ) elsif speak_as_value == 'digits' speak_as_digits_inherit ( element ) end end end end if rule . has_property? ( 'speak-punctuation' ) declarations = rule . get_declarations ( 'speak-punctuation' ) declarations . each do | declaration | property_value = declaration . get_value if property_value == 'code' speak_as_literal_punctuation_inherit ( element ) elsif property_value == 'none' speak_as_no_punctuation_inherit ( element ) end end end if rule . has_property? ( 'speak-numeral' ) declarations = rule . get_declarations ( 'speak-numeral' ) declarations . each do | declaration | property_value = declaration . get_value if property_value == 'digits' speak_as_digits_inherit ( element ) elsif property_value == 'continuous' speak_as_continuous_inherit ( element ) end end end return unless rule . has_property? ( 'speak-header' ) declarations = rule . get_declarations ( 'speak-header' ) declarations . each do | declaration | property_value = declaration . get_value if property_value == 'always' speak_header_always_inherit ( element ) elsif property_value == 'once' speak_header_once_inherit ( element ) end end end
Provide the CSS features of speaking and speech properties in element.
Provide the CSS features of speaking and speech properties in element .
element
None
rule
The stylesheet rule.
The stylesheet rule .