MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / IsEntirelyHiddenByOverflow

Method IsEntirelyHiddenByOverflow

cpp/iedriver/Element.cpp:806–829  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

804}
805
806bool 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
831bool Element::ScrollWithinOverflow(const LocationInfo element_location) {
832 RECT element_rect;

Callers

nothing calls this directly

Calls 6

GetContainingDocumentMethod · 0.95
asStringFunction · 0.85
LOGClass · 0.50
AddArgumentMethod · 0.45
ExecuteMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected