| 461 | } |
| 462 | |
| 463 | bool Element::HasShadowRoot() { |
| 464 | std::wstring script_source(ANONYMOUS_FUNCTION_START); |
| 465 | script_source += L"return (function() { if (arguments[0].shadowRoot && arguments[0].shadowRoot !== null) { return true; } return false; })"; |
| 466 | script_source += ANONYMOUS_FUNCTION_END; |
| 467 | |
| 468 | CComPtr<IHTMLDocument2> doc; |
| 469 | this->GetContainingDocument(false, &doc); |
| 470 | Script script_wrapper(doc, script_source, 1); |
| 471 | script_wrapper.AddArgument(this->element_); |
| 472 | int status_code = script_wrapper.Execute(); |
| 473 | if (status_code == WD_SUCCESS) { |
| 474 | if (script_wrapper.ResultIsBoolean()) { |
| 475 | return script_wrapper.result().boolVal == VARIANT_TRUE; |
| 476 | } |
| 477 | } |
| 478 | return false; |
| 479 | } |
| 480 | |
| 481 | bool Element::GetComputedStyle(IHTMLCSSStyleDeclaration** computed_style) { |
| 482 | HRESULT hr = S_OK; |
no test coverage detected