internal static FrameState GetCurrentFrameState(EyesWebDriver driver, IWebElement scrolledElement)
        {
            IJavaScriptExecutor jsExecutor = driver;
            Logger    logger    = driver.Eyes.Logger;
            UserAgent userAgent = UserAgent.ParseUserAgentString(driver.GetUserAgent());

            IPositionProvider cssPositionProvider    = SeleniumPositionProviderFactory.GetPositionProvider(logger, StitchModes.CSS, driver, scrolledElement, userAgent);
            IPositionProvider scrollPositionProvider = SeleniumPositionProviderFactory.GetPositionProvider(logger, StitchModes.Scroll, driver, scrolledElement, userAgent);
            string            overflow   = (string)jsExecutor.ExecuteScript("return arguments[0].style.overflow", scrolledElement);
            FrameChain        frameChain = driver.GetFrameChain().Clone();
            FrameState        frameState = new FrameState(driver, scrolledElement, cssPositionProvider, scrollPositionProvider, overflow, frameChain);

            return(frameState);
        }
        private static void SaveCurrentFrameState_(List <FrameState> frameStates, EyesWebDriver driver, IWebElement rootElement)
        {
            FrameState frameState = FrameState.GetCurrentFrameState(driver, rootElement);

            frameStates.Add(frameState);
        }