bool ViewNavigationDelegate::ClickElementById(const char* id) { EAW_ASSERT(id); if(!id || !id[0]) return false; IOverlayInputClient* pOverlayInputClient = mView->GetOverlayInputClient(); if(pOverlayInputClient) pOverlayInputClient->OnFocusChangeEvent(false); bool elementClicked = false; WebCore::Frame* pFrame = mView->GetFrame(); while(pFrame) { WebCore::Document* document = pFrame->document(); EAW_ASSERT(document); if (document) { WebCore::Element* element = document->getElementById(id); if (element && element->isHTMLElement()) { WebCore::HTMLElement* htmlElement = (WebCore::HTMLElement*)element; htmlElement->click(); elementClicked = true; } } if(elementClicked) break; pFrame = pFrame->tree()->traverseNext(); } return elementClicked; }
bool DumpRenderTreeSupportEfl::pauseSVGAnimation(Evas_Object* ewkFrame, const char* animationId, const char* elementId, double time) { #if ENABLE(SVG) WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame); if (!frame) return false; WebCore::Document* document = frame->document(); if (!document || !document->svgExtensions()) return false; WebCore::Element* element = document->getElementById(animationId); if (!element || !WebCore::SVGSMILElement::isSMILElement(element)) return false; return document->accessSVGExtensions()->sampleAnimationAtTime(elementId, static_cast<WebCore::SVGSMILElement*>(element), time); #else return false; #endif }
bool DumpRenderTreeSupportEfl::elementDoesAutoCompleteForElementWithId(const Evas_Object* ewkFrame, const String& elementId) { DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, false); WebCore::Document* document = frame->document(); ASSERT(document); WebCore::HTMLInputElement* inputElement = static_cast<WebCore::HTMLInputElement*>(document->getElementById(elementId)); if (!inputElement) return false; return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->shouldAutocomplete(); }
bool DumpRenderTreeSupportEfl::elementDoesAutoCompleteForElementWithId(const Evas_Object* ewkFrame, const String& elementId) { WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame); if (!frame) return false; WebCore::Document* document = frame->document(); ASSERT(document); WebCore::HTMLInputElement* inputElement = static_cast<WebCore::HTMLInputElement*>(document->getElementById(elementId)); if (!inputElement) return false; return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->shouldAutocomplete(); }