本文整理汇总了C++中LayoutObject::absoluteBoundingBoxRect方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutObject::absoluteBoundingBoxRect方法的具体用法?C++ LayoutObject::absoluteBoundingBoxRect怎么用?C++ LayoutObject::absoluteBoundingBoxRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutObject
的用法示例。
在下文中一共展示了LayoutObject::absoluteBoundingBoxRect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: String
TracedLayoutObject::TracedLayoutObject(const LayoutObject& object)
: m_address((unsigned long) &object)
, m_isAnonymous(object.isAnonymous())
, m_isPositioned(object.isOutOfFlowPositioned())
, m_isRelPositioned(object.isRelPositioned())
, m_isStickyPositioned(object.isStickyPositioned())
, m_isFloating(object.isFloating())
, m_selfNeeds(object.selfNeedsLayout())
, m_positionedMovement(object.needsPositionedMovementLayout())
, m_childNeeds(object.normalChildNeedsLayout())
, m_posChildNeeds(object.posChildNeedsLayout())
, m_isTableCell(object.isTableCell())
, m_name(String(object.name()).isolatedCopy())
, m_absRect(object.absoluteBoundingBoxRect())
{
if (Node* node = object.node()) {
m_tag = String(node->nodeName()).isolatedCopy();
if (node->isElementNode()) {
Element& element = toElement(*node);
if (element.hasID())
m_id = String(element.getIdAttribute()).isolatedCopy();
if (element.hasClass()) {
for (size_t i = 0; i < element.classNames().size(); ++i) {
m_classNames.append(
String(element.classNames()[i]).isolatedCopy());
}
}
}
}
// FIXME: When the fixmes in LayoutTreeAsText::writeLayoutObject() are
// fixed, deduplicate it with this.
if (object.isText()) {
m_rect = LayoutRect(toLayoutText(object).linesBoundingBox());
} else if (object.isLayoutInline()) {
m_rect = LayoutRect(toLayoutInline(object).linesBoundingBox());
} else if (object.isBox()) {
m_rect = toLayoutBox(&object)->frameRect();
}
if (m_isTableCell) {
const LayoutTableCell& c = toLayoutTableCell(object);
if (c.row() && c.row()->rowIndexWasSet() && c.hasCol()
&& (!c.row()->section() || !c.row()->section()->needsCellRecalc())) {
m_row = c.rowIndex();
m_col = c.col();
m_rowSpan = c.rowSpan();
m_colSpan = c.colSpan();
}
}
for (LayoutObject* child = object.slowFirstChild(); child; child = child->nextSibling()) {
m_children.append(adoptRef(new TracedLayoutObject(*child)));
}
}
示例2: isOverlapping
bool SnapToLinesLayouter::isOverlapping() const
{
IntRect cueBoxRect = m_cueBox.absoluteBoundingBoxRect();
for (LayoutObject* box = m_cueBox.previousSibling(); box; box = box->previousSibling()) {
IntRect boxRect = box->absoluteBoundingBoxRect();
if (cueBoxRect.intersects(boxRect))
return true;
}
if (cueBoxRect.intersects(m_controlsRect))
return true;
return false;
}
示例3: clipToFrameView
void IntersectionObservation::clipToFrameView(IntersectionGeometry& geometry)
{
Node* rootNode = m_observer->root();
LayoutObject* rootLayoutObject = m_observer->rootLayoutObject();
if (rootLayoutObject->isLayoutView()) {
geometry.rootRect = LayoutRect(toLayoutView(rootLayoutObject)->frameView()->visibleContentRect());
m_observer->applyRootMargin(geometry.rootRect);
geometry.intersectionRect.intersect(geometry.rootRect);
} else {
if (rootLayoutObject->isBox())
geometry.rootRect = LayoutRect(toLayoutBox(rootLayoutObject)->absoluteContentBox());
else
geometry.rootRect = LayoutRect(rootLayoutObject->absoluteBoundingBoxRect());
m_observer->applyRootMargin(geometry.rootRect);
}
LayoutPoint scrollPosition(rootNode->document().view()->scrollPosition());
geometry.targetRect.moveBy(-scrollPosition);
geometry.intersectionRect.moveBy(-scrollPosition);
geometry.rootRect.moveBy(-scrollPosition);
}
示例4: outputLinkedDestinations
void PrintContext::outputLinkedDestinations(SkCanvas* canvas, const IntRect& pageRect)
{
if (!m_linkedDestinationsValid) {
// Collect anchors in the top-level frame only because our PrintContext
// supports only one namespace for the anchors.
collectLinkedDestinations(frame()->document());
m_linkedDestinationsValid = true;
}
for (const auto& entry : m_linkedDestinations) {
LayoutObject* layoutObject = entry.value->layoutObject();
if (!layoutObject || !layoutObject->frameView())
continue;
IntRect boundingBox = layoutObject->absoluteBoundingBoxRect();
boundingBox = layoutObject->frameView()->convertToContainingWindow(boundingBox);
if (!pageRect.intersects(boundingBox))
continue;
IntPoint point = boundingBox.minXMinYCorner();
point.clampNegativeToZero();
SkAutoDataUnref nameData(SkData::NewWithCString(entry.key.utf8().data()));
SkAnnotateNamedDestination(canvas, SkPoint::Make(point.x(), point.y()), nameData);
}
}