Sha256: 1a161b0dabe6aa2ac1ebc77ca47ce9f7956fbb1d91e58ebabb5456af8cfcaaa0

Contents?: true

Size: 467 Bytes

Versions: 4

Compression:

Stored size: 467 Bytes

Contents

module Watir
  class Image < HTMLElement

    #
    # Returns true if image is loaded.
    #
    # @return [Boolean]
    #

    def loaded?
      return false unless complete?

      driver.execute_script(
        'return typeof arguments[0].naturalWidth != "undefined" && arguments[0].naturalWidth > 0',
        @element
      )
    end

  end # Image

  module Container
     alias_method :image, :img
     alias_method :images, :imgs
  end # Container
end # Watir

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
watir-6.7.3 lib/watir/elements/image.rb
watir-6.7.2 lib/watir/elements/image.rb
watir-6.7.1 lib/watir/elements/image.rb
watir-6.7.0 lib/watir/elements/image.rb