本文整理汇总了C++中HitTestRequest::allowsShadowContent方法的典型用法代码示例。如果您正苦于以下问题:C++ HitTestRequest::allowsShadowContent方法的具体用法?C++ HitTestRequest::allowsShadowContent怎么用?C++ HitTestRequest::allowsShadowContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HitTestRequest
的用法示例。
在下文中一共展示了HitTestRequest::allowsShadowContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addNodeToRectBasedTestResult
bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestRequest& request, const HitTestLocation& locationInContainer, const FloatRect& rect)
{
// If it is not a rect-based hit test, this method has to be no-op.
// Return false, so the hit test stops.
if (!isRectBasedTest())
return false;
// If node is null, return true so the hit test can continue.
if (!node)
return true;
if (!request.allowsShadowContent())
node = node->shadowAncestorNode();
mutableRectBasedTestResult().add(node);
bool regionFilled = rect.contains(locationInContainer.boundingBox());
// FIXME: This code (incorrectly) attempts to correct for culled inline nodes. See https://bugs.webkit.org/show_bug.cgi?id=85849.
if (node->renderer()->isInline() && !regionFilled) {
for (RenderObject* curr = node->renderer()->parent(); curr; curr = curr->parent()) {
if (!curr->isRenderInline())
break;
// We need to make sure the nodes for culled inlines get included.
RenderInline* currInline = toRenderInline(curr);
if (currInline->alwaysCreateLineBoxes())
break;
if (currInline->visibleToHitTesting() && currInline->node())
mutableRectBasedTestResult().add(currInline->node()->shadowAncestorNode());
}
}
return !regionFilled;
}
示例2: addNodeToRectBasedTestResult
bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestRequest& request, const HitTestLocation& locationInContainer, const FloatRect& rect)
{
// If it is not a rect-based hit test, this method has to be no-op.
// Return false, so the hit test stops.
if (!isRectBasedTest())
return false;
// If node is null, return true so the hit test can continue.
if (!node)
return true;
if (!request.allowsShadowContent())
node = node->deprecatedShadowAncestorNode();
mutableRectBasedTestResult().add(node);
bool regionFilled = rect.contains(locationInContainer.boundingBox());
return !regionFilled;
}