本文整理汇总了C++中LayoutObject::absoluteQuads方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutObject::absoluteQuads方法的具体用法?C++ LayoutObject::absoluteQuads怎么用?C++ LayoutObject::absoluteQuads使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutObject
的用法示例。
在下文中一共展示了LayoutObject::absoluteQuads方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: appendNodeHighlight
void InspectorHighlight::appendNodeHighlight(Node* node, const InspectorHighlightConfig& highlightConfig)
{
LayoutObject* layoutObject = node->layoutObject();
if (!layoutObject)
return;
// LayoutSVGRoot should be highlighted through the isBox() code path, all other SVG elements should just dump their absoluteQuads().
if (layoutObject->node() && layoutObject->node()->isSVGElement() && !layoutObject->isSVGRoot()) {
Vector<FloatQuad> quads;
layoutObject->absoluteQuads(quads);
FrameView* containingView = layoutObject->frameView();
for (size_t i = 0; i < quads.size(); ++i) {
if (containingView)
contentsQuadToViewport(containingView, quads[i]);
appendQuad(quads[i], highlightConfig.content, highlightConfig.contentOutline);
}
return;
}
FloatQuad content, padding, border, margin;
if (!buildNodeQuads(node, &content, &padding, &border, &margin))
return;
appendQuad(content, highlightConfig.content, highlightConfig.contentOutline, "content");
appendQuad(padding, highlightConfig.padding, Color::transparent, "padding");
appendQuad(border, highlightConfig.border, Color::transparent, "border");
appendQuad(margin, highlightConfig.margin, Color::transparent, "margin");
}
示例2: computeQuads
void LinkHighlight::computeQuads(const Node& node, Vector<FloatQuad>& outQuads) const
{
if (!node.layoutObject())
return;
LayoutObject* renderer = node.layoutObject();
// For inline elements, absoluteQuads will return a line box based on the line-height
// and font metrics, which is technically incorrect as replaced elements like images
// should use their intristic height and expand the linebox as needed. To get an
// appropriately sized highlight we descend into the children and have them add their
// boxes.
if (renderer->isLayoutInline()) {
for (Node* child = NodeRenderingTraversal::firstChild(node); child; child = NodeRenderingTraversal::nextSibling(*child))
computeQuads(*child, outQuads);
} else {
// FIXME: this does not need to be absolute, just in the paint invalidation container's space.
renderer->absoluteQuads(outQuads);
}
}