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

Method GetComputedStyle

cpp/iedriver/Element.cpp:481–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479}
480
481bool Element::GetComputedStyle(IHTMLCSSStyleDeclaration** computed_style) {
482 HRESULT hr = S_OK;
483 CComPtr<IHTMLDocument2> doc;
484 int status_code = this->GetContainingDocument(false, &doc);
485 if (status_code == WD_SUCCESS) {
486 CComPtr<IHTMLWindow2> window;
487 hr = doc->get_parentWindow(&window);
488 if (SUCCEEDED(hr) && window) {
489 CComPtr<IHTMLWindow7> style_window;
490 hr = window->QueryInterface<IHTMLWindow7>(&style_window);
491 if (SUCCEEDED(hr) && style_window) {
492 CComPtr<IHTMLDOMNode> node;
493 hr = this->element_->QueryInterface<IHTMLDOMNode>(&node);
494 if (SUCCEEDED(hr) && node) {
495 hr = style_window->getComputedStyle(node, NULL, computed_style);
496 if (SUCCEEDED(hr) && computed_style) {
497 return true;
498 }
499 }
500 }
501 }
502 }
503 return false;
504}
505
506bool Element::IsEditable() {
507 LOG(TRACE) << "Entering Element::IsEditable";

Callers 1

IsObscuredMethod · 0.95

Calls 1

GetContainingDocumentMethod · 0.95

Tested by

no test coverage detected