| 600 | } |
| 601 | |
| 602 | int Element::GetPropertyValue(const std::string& property_name, |
| 603 | VARIANT* property_value) { |
| 604 | LOG(TRACE) << "Entering Element::GetPropertyValue"; |
| 605 | |
| 606 | std::wstring wide_property_name = StringUtilities::ToWString(property_name); |
| 607 | int status_code = WD_SUCCESS; |
| 608 | |
| 609 | LPOLESTR property_name_pointer = reinterpret_cast<LPOLESTR>(const_cast<wchar_t*>(wide_property_name.data())); |
| 610 | DISPID dispid_property; |
| 611 | HRESULT hr = this->element_->GetIDsOfNames(IID_NULL, |
| 612 | &property_name_pointer, |
| 613 | 1, |
| 614 | LOCALE_USER_DEFAULT, |
| 615 | &dispid_property); |
| 616 | if (FAILED(hr)) { |
| 617 | LOGHR(WARN, hr) << "Unable to get dispatch ID (dispid) for property " |
| 618 | << property_name; |
| 619 | property_value->vt = VT_EMPTY; |
| 620 | return WD_SUCCESS; |
| 621 | } |
| 622 | |
| 623 | // get the value of eval result |
| 624 | DISPPARAMS no_args_dispatch_parameters = { 0 }; |
| 625 | hr = this->element_->Invoke(dispid_property, |
| 626 | IID_NULL, |
| 627 | LOCALE_USER_DEFAULT, |
| 628 | DISPATCH_PROPERTYGET, |
| 629 | &no_args_dispatch_parameters, |
| 630 | property_value, |
| 631 | NULL, |
| 632 | NULL); |
| 633 | if (FAILED(hr)) { |
| 634 | LOGHR(WARN, hr) << "Unable to get result for property " |
| 635 | << property_name; |
| 636 | property_value->vt = VT_EMPTY; |
| 637 | return WD_SUCCESS; |
| 638 | } |
| 639 | |
| 640 | return WD_SUCCESS; |
| 641 | } |
| 642 | |
| 643 | int Element::GetCssPropertyValue(const std::string& property_name, |
| 644 | std::string* property_value) { |
no test coverage detected