本文整理汇总了C++中LayoutBlock::container方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutBlock::container方法的具体用法?C++ LayoutBlock::container怎么用?C++ LayoutBlock::container使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutBlock
的用法示例。
在下文中一共展示了LayoutBlock::container方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enableCompositing
TEST_F(VisualRectMappingTest,
DifferentPaintInvalidaitionContainerForAbsolutePosition) {
enableCompositing();
document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true);
setBodyInnerHTML(
"<div id='stacking-context' style='opacity: 0.9; background: blue; "
"will-change: transform'>"
" <div id='scroller' style='overflow: scroll; width: 80px; height: "
"80px'>"
" <div id='absolute' style='position: absolute; top: 111px; left: "
"222px; width: 50px; height: 50px; background: green'></div>"
" <div id='normal-flow' style='width: 2000px; height: 2000px; "
"background: yellow'></div>"
" </div>"
"</div>");
LayoutBlock* scroller = toLayoutBlock(getLayoutObjectByElementId("scroller"));
scroller->setScrollTop(LayoutUnit(77));
scroller->setScrollLeft(LayoutUnit(88));
document().view()->updateAllLifecyclePhases();
LayoutBlock* normalFlow =
toLayoutBlock(getLayoutObjectByElementId("normal-flow"));
EXPECT_EQ(scroller, &normalFlow->containerForPaintInvalidation());
LayoutRect normalFlowVisualRect = normalFlow->localVisualRect();
EXPECT_EQ(LayoutRect(0, 0, 2000, 2000), normalFlowVisualRect);
LayoutRect rect = normalFlowVisualRect;
EXPECT_TRUE(normalFlow->mapToVisualRectInAncestorSpace(scroller, rect));
EXPECT_EQ(LayoutRect(0, 0, 2000, 2000), rect);
checkPaintInvalidationStateRectMapping(rect, normalFlowVisualRect,
*normalFlow, layoutView(), *scroller);
LayoutBlock* stackingContext =
toLayoutBlock(getLayoutObjectByElementId("stacking-context"));
LayoutBlock* absolute = toLayoutBlock(getLayoutObjectByElementId("absolute"));
EXPECT_EQ(stackingContext, &absolute->containerForPaintInvalidation());
EXPECT_EQ(stackingContext, absolute->container());
LayoutRect absoluteVisualRect = absolute->localVisualRect();
EXPECT_EQ(LayoutRect(0, 0, 50, 50), absoluteVisualRect);
rect = absoluteVisualRect;
EXPECT_TRUE(absolute->mapToVisualRectInAncestorSpace(stackingContext, rect));
EXPECT_EQ(LayoutRect(222, 111, 50, 50), rect);
checkPaintInvalidationStateRectMapping(rect, absoluteVisualRect, *absolute,
layoutView(), *stackingContext);
}