本文整理汇总了C++中webcore::Element类的典型用法代码示例。如果您正苦于以下问题:C++ Element类的具体用法?C++ Element怎么用?C++ Element使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Element类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setValueForUser
void DumpRenderTreeSupportEfl::setValueForUser(JSContextRef context, JSValueRef nodeObject, const String& value)
{
JSC::ExecState* exec = toJS(context);
WebCore::Element* element = WebCore::toElement(toJS(exec, nodeObject));
if (!element)
return;
WebCore::HTMLInputElement* inputElement = element->toInputElement();
if (!inputElement)
return;
inputElement->setValueForUser(value);
}
示例2: setAutofilled
void DumpRenderTreeSupportEfl::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
{
JSC::ExecState* exec = toJS(context);
WebCore::Element* element = WebCore::toElement(toJS(exec, nodeObject));
if (!element)
return;
WebCore::HTMLInputElement* inputElement = element->toInputElement();
if (!inputElement)
return;
inputElement->setAutofilled(autofilled);
}
示例3: shadowRoot
QVariant DumpRenderTreeSupportQt::shadowRoot(const QWebElement& element)
{
WebCore::Element* webElement = element.m_element;
if (!webElement)
return QVariant();
ShadowRoot* webShadowRoot = webElement->shadowRoot();
if (!webShadowRoot)
return QVariant();
return QVariant::fromValue(QDRTNode(webShadowRoot));
}
示例4: getCoreDocumentFromVariantMap
WebCore::Document* DumpRenderTreeSupportQt::getCoreDocumentFromVariantMap(const QVariantMap& document)
{
QVariant v = document.value(QLatin1String("documentElement"));
ASSERT(v.isValid());
QWebElement documentElement = qvariant_cast<QWebElement>(v);
WebCore::Element* element = documentElement.m_element;
if (!element)
return 0;
return element->document();
}
示例5: pauseTransition
bool DumpRenderTreeSupportEfl::pauseTransition(Evas_Object* ewkFrame, const char* name, const char* elementId, double time)
{
WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame);
if (!frame)
return false;
WebCore::Element* element = frame->document()->getElementById(elementId);
if (!element || !element->renderer())
return false;
return frame->animation()->pauseTransitionAtTime(element->renderer(), name, time);
}
示例6: nodesFromRect
QVariantList DumpRenderTreeSupportQt::nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
{
QVariantList res;
WebCore::Element* webElement = document.m_element;
if (!webElement)
return res;
Document* doc = webElement->document();
if (!doc)
return res;
RefPtr<NodeList> nodes = doc->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping);
for (int i = 0; i < nodes->length(); i++) {
QVariant v;
// QWebElement will be null if the Node is not an HTML Element
v.setValue(QWebElement(nodes->item(i)));
res << v;
}
return res;
}
示例7: dumpFramesAsText
String DumpRenderTree::dumpFramesAsText(WebCore::Frame* frame)
{
String s;
WebCore::Element* documentElement = frame->document()->documentElement();
if (!documentElement)
return s.utf8().data();
if (frame->tree()->parent())
s = String::format("\n--------\nFrame: '%s'\n--------\n", frame->tree()->uniqueName().string().utf8().data());
s = s + documentElement->innerText() + "\n";
if (gTestRunner->dumpChildFramesAsText()) {
WebCore::FrameTree* tree = frame->tree();
for (WebCore::Frame* child = tree->firstChild(); child; child = child->tree()->nextSibling())
s = s + dumpFramesAsText(child);
}
return s;
}
示例8: ClickElementById
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;
}
示例9: selectedRange
bool DumpRenderTreeSupportEfl::selectedRange(Evas_Object* ewkView, int* start, int* length)
{
if (!(start && length))
return false;
DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, false);
WebCore::Frame& frame = page->focusController().focusedOrMainFrame();
RefPtr<WebCore::Range> range = frame.selection().toNormalizedRange().get();
if (!range)
return false;
WebCore::Element* selectionRoot = frame.selection().rootEditableElement();
WebCore::Element* scope = selectionRoot ? selectionRoot : frame.document()->documentElement();
RefPtr<WebCore::Range> testRange = WebCore::Range::create(scope->document(), scope, 0, range->startContainer(), range->startOffset());
*start = WebCore::TextIterator::rangeLength(testRange.get());
WebCore::ExceptionCode ec;
testRange->setEnd(range->endContainer(), range->endOffset(), ec);
*length = WebCore::TextIterator::rangeLength(testRange.get());
return true;
}
示例10: isType
static bool isType(const WebCore::Element& element) { return element.isUploadButton(); }