| 804 | } |
| 805 | |
| 806 | bool Element::IsEntirelyHiddenByOverflow() { |
| 807 | LOG(TRACE) << "Entering Element::IsEntirelyHiddenByOverflow"; |
| 808 | |
| 809 | bool is_overflow = false; |
| 810 | |
| 811 | std::wstring script_source(L"(function() { return ("); |
| 812 | script_source += atoms::asString(atoms::IS_ELEMENT_IN_PARENT_OVERFLOW); |
| 813 | script_source += L")})();"; |
| 814 | |
| 815 | CComPtr<IHTMLDocument2> doc; |
| 816 | this->GetContainingDocument(false, &doc); |
| 817 | Script script_wrapper(doc, script_source, 1); |
| 818 | script_wrapper.AddArgument(this->element_); |
| 819 | int status_code = script_wrapper.Execute(); |
| 820 | if (status_code == WD_SUCCESS) { |
| 821 | std::wstring raw_overflow_state(script_wrapper.result().bstrVal); |
| 822 | std::string overflow_state = StringUtilities::ToString(raw_overflow_state); |
| 823 | is_overflow = (overflow_state == "scroll"); |
| 824 | } else { |
| 825 | LOG(WARN) << "Unable to determine is element hidden by overflow"; |
| 826 | } |
| 827 | |
| 828 | return is_overflow; |
| 829 | } |
| 830 | |
| 831 | bool Element::ScrollWithinOverflow(const LocationInfo element_location) { |
| 832 | RECT element_rect; |
nothing calls this directly
no test coverage detected