66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/applitools/selenium/region_provider.rb', line 66
def frame_window(frame_chain)
chain = Applitools::Selenium::FrameChain.new other: frame_chain
window = nil
frames_offset = Applitools::Location.new(0, 0)
chain.map(&:dup).each do |frame|
frames_offset = frame.location.offset(frames_offset).offset_negative(frame.parent_scroll_position)
if window.nil?
window = Applitools::Region.from_location_size(frame.location, frame.size)
else
window.intersect(Applitools::Region.from_location_size(frame.location, frame.size))
end
end
window
end
|