haikuwebkit/LayoutTests/fast/css-grid-layout/grid-simplified-layout-posi...

30 lines
804 B
HTML
Raw Permalink Normal View History

[css-grid] ASSERTION FAILED: !m_gridIsDirty in WebCore::RenderGrid::gridRowCount https://bugs.webkit.org/show_bug.cgi?id=163450 Reviewed by Darin Adler. Source/WebCore: The issue is that in the test case a simplifiedLayout() is performed. So in RenderGrid::layoutBlock() we early return and the grid is not populated, so the m_gridIsDirty flag is not cleared when we try to check the size of the grid in RenderGrid::layoutPositionedObject(). We should avoid to do a simplified layout if we have to layout some positioned grid items and the grid is dirty. The problem was not only the ASSERT, but the current behavior was wrong too. As we didn't do a proper layout of the grid container, the positioned item won't be placed on the expected position. Added tests verifying this. Tests: fast/css-grid-layout/grid-positioned-item-dynamic-change.html fast/css-grid-layout/grid-simplified-layout-positioned.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::canPerformSimplifiedLayout): Check if we can perform or not a simplified layout. (WebCore::RenderBlock::simplifiedLayout): Extract initial check into canPerformSimplifiedLayout(). * rendering/RenderBlock.h: Add new header for canPerformSimplifiedLayout(). * rendering/RenderGrid.cpp: Implement our own version of canPerformSimplifiedLayout() to verify that the grid is not dirty if we have to layout some positioned items. (WebCore::RenderGrid::canPerformSimplifiedLayout): * rendering/RenderGrid.h: Add canPerformSimplifiedLayout() header. LayoutTests: The tests shouldn't crash in debug to verify that the bug is fixed. On top of that the positioned grid items should appear in the right position too. * fast/css-grid-layout/grid-positioned-item-dynamic-change-expected.html: Added. * fast/css-grid-layout/grid-positioned-item-dynamic-change.html: Added. * fast/css-grid-layout/grid-simplified-layout-positioned-expected.html: Added. * fast/css-grid-layout/grid-simplified-layout-positioned.html: Added. Canonical link: https://commits.webkit.org/182309@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-11 11:08:39 +00:00
<!DOCTYPE html>
<style>
html {
display: grid;
position: absolute;
grid: 100px 400px / 100px 400px;
}
body {
position: absolute;
grid-column: 2 / 3;
grid-row: 2 / 3;
width: 100%;
}
</style>
This text and input should appear at 100x100 position.
Like if they have a left and top margin of 100px.
<input autofocus>
<script>
if (window.testRunner)
window.testRunner.waitUntilDone();
// "autofocus" is needed to force the simplified layout call.
// We are removing the focus here to match the expected file and avoid issues with the caret.
// We need a small timeout so "blur()" is run after "autofocus".
setTimeout(function() {
document.querySelector("input").blur();
if (window.testRunner)
window.testRunner.notifyDone();
}, 100);
</script>