本文整理汇总了C++中HTMLImageElement::renderer方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLImageElement::renderer方法的具体用法?C++ HTMLImageElement::renderer怎么用?C++ HTMLImageElement::renderer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLImageElement
的用法示例。
在下文中一共展示了HTMLImageElement::renderer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: defaultEventHandler
void HTMLAnchorElement::defaultEventHandler(Event* evt)
{
// React on clicks and on keypresses.
// Don't make this KEYUP_EVENT again, it makes khtml follow links it shouldn't,
// when pressing Enter in the combo.
if (isLink() && (evt->type() == eventNames().clickEvent || (evt->type() == eventNames().keydownEvent && focused()))) {
MouseEvent* e = 0;
if (evt->type() == eventNames().clickEvent && evt->isMouseEvent())
e = static_cast<MouseEvent*>(evt);
KeyboardEvent* k = 0;
if (evt->type() == eventNames().keydownEvent && evt->isKeyboardEvent())
k = static_cast<KeyboardEvent*>(evt);
if (e && e->button() == RightButton) {
HTMLElement::defaultEventHandler(evt);
return;
}
// If the link is editable, then we need to check the settings to see whether or not to follow the link
if (isContentEditable()) {
EditableLinkBehavior editableLinkBehavior = EditableLinkDefaultBehavior;
if (Settings* settings = document()->settings())
editableLinkBehavior = settings->editableLinkBehavior();
switch (editableLinkBehavior) {
// Always follow the link (Safari 2.0 behavior)
default:
case EditableLinkDefaultBehavior:
case EditableLinkAlwaysLive:
break;
case EditableLinkNeverLive:
HTMLElement::defaultEventHandler(evt);
return;
// If the selection prior to clicking on this link resided in the same editable block as this link,
// and the shift key isn't pressed, we don't want to follow the link
case EditableLinkLiveWhenNotFocused:
if (e && !e->shiftKey() && m_rootEditableElementForSelectionOnMouseDown == rootEditableElement()) {
HTMLElement::defaultEventHandler(evt);
return;
}
break;
// Only follow the link if the shift key is down (WinIE/Firefox behavior)
case EditableLinkOnlyLiveWithShiftKey:
if (e && !e->shiftKey()) {
HTMLElement::defaultEventHandler(evt);
return;
}
break;
}
}
if (k) {
if (k->keyIdentifier() != "Enter") {
HTMLElement::defaultEventHandler(evt);
return;
}
evt->setDefaultHandled();
dispatchSimulatedClick(evt);
return;
}
String url = deprecatedParseURL(getAttribute(hrefAttr));
ASSERT(evt->target());
ASSERT(evt->target()->toNode());
if (evt->target()->toNode()->hasTagName(imgTag)) {
HTMLImageElement* img = static_cast<HTMLImageElement*>(evt->target()->toNode());
if (img && img->isServerMap()) {
RenderImage* r = toRenderImage(img->renderer());
if (r && e) {
// FIXME: broken with transforms
FloatPoint absPos = r->localToAbsolute();
int x = e->pageX() - absPos.x();
int y = e->pageY() - absPos.y();
url += "?";
url += String::number(x);
url += ",";
url += String::number(y);
} else {
evt->setDefaultHandled();
HTMLElement::defaultEventHandler(evt);
return;
}
}
}
if (!evt->defaultPrevented() && document()->frame())
document()->frame()->loader()->urlSelected(document()->completeURL(url), getAttribute(targetAttr), evt, false, false, true, hasRel(RelationNoReferrer) ? NoReferrer : SendReferrer);
evt->setDefaultHandled();
} else if (isLink() && isContentEditable()) {
// This keeps track of the editable block that the selection was in (if it was in one) just before the link was clicked
// for the LiveWhenNotFocused editable link behavior
if (evt->type() == eventNames().mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() != RightButton && document()->frame() && document()->frame()->selection()) {
MouseEvent* e = static_cast<MouseEvent*>(evt);
//.........这里部分代码省略.........