| 504 | } |
| 505 | |
| 506 | bool Element::IsEditable() { |
| 507 | LOG(TRACE) << "Entering Element::IsEditable"; |
| 508 | |
| 509 | bool result = false; |
| 510 | |
| 511 | // The atom is just the definition of an anonymous |
| 512 | // function: "function() {...}"; Wrap it in another function so we can |
| 513 | // invoke it with our arguments without polluting the current namespace. |
| 514 | std::wstring script_source(L"(function() { return ("); |
| 515 | script_source += atoms::asString(atoms::IS_EDITABLE); |
| 516 | script_source += L")})();"; |
| 517 | |
| 518 | CComPtr<IHTMLDocument2> doc; |
| 519 | this->GetContainingDocument(false, &doc); |
| 520 | Script script_wrapper(doc, script_source, 1); |
| 521 | script_wrapper.AddArgument(this->element_); |
| 522 | int status_code = script_wrapper.Execute(); |
| 523 | |
| 524 | if (status_code == WD_SUCCESS) { |
| 525 | result = script_wrapper.result().boolVal == VARIANT_TRUE; |
| 526 | } else { |
| 527 | LOG(WARN) << "Failed to determine is element enabled"; |
| 528 | } |
| 529 | |
| 530 | return result; |
| 531 | } |
| 532 | |
| 533 | int Element::GetClickLocation(const ElementScrollBehavior scroll_behavior, |
| 534 | LocationInfo* element_location, |
no test coverage detected