本文整理汇总了C++中RenderObject::dirtyLinesFromChangedChild方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderObject::dirtyLinesFromChangedChild方法的具体用法?C++ RenderObject::dirtyLinesFromChangedChild怎么用?C++ RenderObject::dirtyLinesFromChangedChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderObject
的用法示例。
在下文中一共展示了RenderObject::dirtyLinesFromChangedChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateMarkerLocation
bool RenderListItem::updateMarkerLocation()
{
ASSERT(m_marker);
RenderObject* markerParent = m_marker->parent();
RenderObject* lineBoxParent = getParentOfFirstLineBox(this, m_marker);
if (!lineBoxParent) {
// If the marker is currently contained inside an anonymous box, then we
// are the only item in that anonymous box (since no line box parent was
// found). It's ok to just leave the marker where it is in this case.
if (markerParent && markerParent->isAnonymousBlock())
lineBoxParent = markerParent;
else
lineBoxParent = this;
}
if (markerParent != lineBoxParent) {
updateFirstLetter();
m_marker->remove();
// FIXME(crbug.com/391009): Investigate whether this call is needed.
if (markerParent)
markerParent->dirtyLinesFromChangedChild(m_marker);
lineBoxParent->addChild(m_marker, firstNonMarkerChild(lineBoxParent));
m_marker->updateMarginsAndContent();
// If markerParent is an anonymous block with no children, destroy it.
if (markerParent && markerParent->isAnonymousBlock() && !toRenderBlock(markerParent)->firstChild() && !toRenderBlock(markerParent)->continuation())
markerParent->destroy();
return true;
}
return false;
}
示例2: updateMarkerLocation
void RenderListItem::updateMarkerLocation()
{
// Sanity check the location of our marker.
if (m_marker) {
RenderObject* markerParent = m_marker->parent();
RenderObject* lineBoxParent = getParentOfFirstLineBox(this, m_marker);
if (!lineBoxParent) {
// If the marker is currently contained inside an anonymous box,
// then we are the only item in that anonymous box (since no line box
// parent was found). It's ok to just leave the marker where it is
// in this case.
if (markerParent && markerParent->isAnonymousBlock())
lineBoxParent = markerParent;
else
lineBoxParent = this;
}
if (markerParent != lineBoxParent || m_marker->preferredLogicalWidthsDirty()) {
// Removing and adding the marker can trigger repainting in
// containers other than ourselves, so we need to disable LayoutState.
LayoutStateDisabler layoutStateDisabler(view());
updateFirstLetter();
m_marker->remove();
if (markerParent)
markerParent->dirtyLinesFromChangedChild(m_marker);
if (!lineBoxParent)
lineBoxParent = this;
lineBoxParent->addChild(m_marker, firstNonMarkerChild(lineBoxParent));
m_marker->updateMarginsAndContent();
// If markerParent is an anonymous block that has lost all its children, destroy it.
if (markerParent && markerParent->isAnonymousBlock() && !markerParent->firstChild() && !toRenderBlock(markerParent)->continuation())
markerParent->destroy();
// If the marker is inside we need to redo the preferred width calculations
// as the size of the item now includes the size of the list marker.
if (m_marker->isInside())
containingBlock()->updateLogicalWidth();
}
}
}