lib/unused_css/watir.rb in unused_css-0.2.0 vs lib/unused_css/watir.rb in unused_css-1.0.0
- old
+ new
@@ -13,22 +13,21 @@
alias_method :original_goto, :goto
def goto(*args)
original_goto(*args)
@stylesheets.add stylesheets_on_page
- remove_used_styles!
+ check_for_unused_styles!
end
def stylesheets_on_page
elements(tag_name: 'link').map { |stylesheet| stylesheet.attribute_value('href') }
end
- def remove_used_styles!
+ def check_for_unused_styles!
@stylesheets.each do |stylesheet|
- stylesheet.styles.delete_if { |style| self.element(css: style).exist? }
+ stylesheet.unused_styles.delete_if { |style| self.element(css: style).exist? }
stylesheet.remove_pseudo_styles!
end
end
- alias_method :check_for_unused_styles!, :remove_used_styles!
end
end
\ No newline at end of file