本文整理汇总了C++中RenderElement::flowThreadContainingBlock方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderElement::flowThreadContainingBlock方法的具体用法?C++ RenderElement::flowThreadContainingBlock怎么用?C++ RenderElement::flowThreadContainingBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderElement
的用法示例。
在下文中一共展示了RenderElement::flowThreadContainingBlock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setRendererStyleInRegion
void RenderNamedFlowFragment::setRendererStyleInRegion(RenderElement& renderer, std::unique_ptr<RenderStyle> styleInRegion, bool objectRegionStyleCached)
{
ASSERT(renderer.flowThreadContainingBlock());
std::unique_ptr<RenderStyle> objectOriginalStyle = RenderStyle::clonePtr(renderer.style());
renderer.setStyleInternal(WTFMove(*styleInRegion));
if (is<RenderBoxModelObject>(renderer) && !renderer.hasVisibleBoxDecorations()) {
bool hasVisibleBoxDecorations = is<RenderTableCell>(renderer)
|| renderer.style().hasBackground()
|| renderer.style().hasVisibleBorder()
|| renderer.style().hasAppearance()
|| renderer.style().boxShadow();
renderer.setHasVisibleBoxDecorations(hasVisibleBoxDecorations);
}
ObjectRegionStyleInfo styleInfo;
styleInfo.style = WTFMove(objectOriginalStyle);
styleInfo.cached = objectRegionStyleCached;
m_rendererRegionStyle.set(&renderer, WTFMove(styleInfo));
}
示例2: buildObjectForElementInfo
static PassRefPtr<InspectorObject> buildObjectForElementInfo(Node* node)
{
if (!node->isElementNode() || !node->document().frame())
return nullptr;
RefPtr<InspectorObject> elementInfo = InspectorObject::create();
Element* element = toElement(node);
bool isXHTML = element->document().isXHTMLDocument();
elementInfo->setString("tagName", isXHTML ? element->nodeName() : element->nodeName().lower());
elementInfo->setString("idValue", element->getIdAttribute());
HashSet<AtomicString> usedClassNames;
if (element->hasClass() && element->isStyledElement()) {
StringBuilder classNames;
const SpaceSplitString& classNamesString = toStyledElement(element)->classNames();
size_t classNameCount = classNamesString.size();
for (size_t i = 0; i < classNameCount; ++i) {
const AtomicString& className = classNamesString[i];
if (usedClassNames.contains(className))
continue;
usedClassNames.add(className);
classNames.append('.');
classNames.append(className);
}
elementInfo->setString("className", classNames.toString());
}
RenderElement* renderer = element->renderer();
Frame* containingFrame = node->document().frame();
FrameView* containingView = containingFrame->view();
IntRect boundingBox = pixelSnappedIntRect(containingView->contentsToRootView(renderer->absoluteBoundingBoxRect()));
RenderBoxModelObject* modelObject = renderer->isBoxModelObject() ? toRenderBoxModelObject(renderer) : nullptr;
elementInfo->setString("nodeWidth", String::number(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedOffsetWidth(), *modelObject) : boundingBox.width()));
elementInfo->setString("nodeHeight", String::number(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedOffsetHeight(), *modelObject) : boundingBox.height()));
if (renderer->isRenderNamedFlowFragmentContainer()) {
RenderNamedFlowFragment* region = toRenderBlockFlow(renderer)->renderNamedFlowFragment();
if (region->isValid()) {
RenderFlowThread* flowThread = region->flowThread();
ASSERT(flowThread && flowThread->isRenderNamedFlowThread());
RefPtr<InspectorObject> regionFlowInfo = InspectorObject::create();
regionFlowInfo->setString("name", toRenderNamedFlowThread(flowThread)->flowThreadName());
regionFlowInfo->setArray("regions", buildObjectForCSSRegionsHighlight(region, flowThread));
elementInfo->setObject("regionFlowInfo", regionFlowInfo.release());
}
}
RenderFlowThread* containingFlowThread = renderer->flowThreadContainingBlock();
if (containingFlowThread && containingFlowThread->isRenderNamedFlowThread()) {
RefPtr<InspectorObject> contentFlowInfo = InspectorObject::create();
contentFlowInfo->setString("name", toRenderNamedFlowThread(containingFlowThread)->flowThreadName());
elementInfo->setObject("contentFlowInfo", contentFlowInfo.release());
}
#if ENABLE(CSS_SHAPES)
if (renderer->isBox()) {
RenderBox* renderBox = toRenderBox(renderer);
if (RefPtr<InspectorObject> shapeObject = buildObjectForShapeOutside(containingFrame, renderBox))
elementInfo->setObject("shapeOutsideInfo", shapeObject.release());
}
#endif
// Need to enable AX to get the computed role.
if (!WebCore::AXObjectCache::accessibilityEnabled())
WebCore::AXObjectCache::enableAccessibility();
if (AXObjectCache* axObjectCache = node->document().axObjectCache()) {
if (AccessibilityObject* axObject = axObjectCache->getOrCreate(node))
elementInfo->setString("role", axObject->computedRoleString());
}
return elementInfo.release();
}