WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-156793-20160420135158.patch (text/plain), 12.83 KB, created by
Manuel Rego Casasnovas
on 2016-04-20 04:51:39 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Manuel Rego Casasnovas
Created:
2016-04-20 04:51:39 PDT
Size:
12.83 KB
patch
obsolete
>Subversion Revision: 199714 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 755ff0bca62a4a5fa7bf7801d05a79a25afe24ad..aae77586fbad02cf04376a8b68406eccb8858598 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2016-04-20 Manuel Rego Casasnovas <rego@igalia.com> >+ >+ [css-grid] Fix grid-template-columns|rows computed style with content alignment >+ https://bugs.webkit.org/show_bug.cgi?id=156793 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Computed style of grid-template-columns and grid-template-rows properties >+ was including the distribution offset because of content alignment. >+ We should subtract that offset, like we do for the case of gaps, >+ when we're calculating the computed style. >+ >+ Test: fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment.html >+ >+ * css/CSSComputedStyleDeclaration.cpp: >+ (WebCore::valueForGridTrackList): >+ * rendering/RenderGrid.h: >+ > 2016-04-18 Brady Eidson <beidson@apple.com> > > Modern IDB (Blob support): When reading Blobs from the database, grant the Networking process sandbox access to the files. >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >index db73c1b986fcdf13a2168a46dae5461b4d75b5fd..a40f18c1a93d68ff6d3b1a0892166771b4c8ab1f 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >@@ -1070,18 +1070,20 @@ static Ref<CSSValue> valueForGridTrackList(GridTrackSizingDirection direction, R > auto list = CSSValueList::createSpaceSeparated(); > unsigned insertionIndex; > if (isRenderGrid) { >- const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? downcast<RenderGrid>(*renderer).columnPositions() : downcast<RenderGrid>(*renderer).rowPositions(); >+ const auto& grid = downcast<RenderGrid>(*renderer); >+ const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? grid.columnPositions() : grid.rowPositions(); > // There are at least #tracks + 1 grid lines (trackPositions). Apart from that, the grid container can generate implicit grid tracks, > // so we'll have more trackPositions than trackSizes as the latter only contain the explicit grid. > ASSERT(trackPositions.size() - 1 >= trackSizes.size()); > > unsigned i = 0; >- LayoutUnit gutterSize = downcast<RenderGrid>(*renderer).guttersSize(direction, 2); >+ LayoutUnit gutterSize = grid.guttersSize(direction, 2); >+ LayoutUnit offsetBetweenTracks = grid.offsetBetweenTracks(direction); > for (; i < trackPositions.size() - 2; ++i) { > addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, list.get()); >- list.get().append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositions[i] - gutterSize, style)); >+ list.get().append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositions[i] - gutterSize - offsetBetweenTracks, style)); > } >- // Last track line does not have any gutter. >+ // Last track line does not have any gutter or distribution offset. > addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, list.get()); > list.get().append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositions[i], style)); > insertionIndex = trackPositions.size() - 1; >diff --git a/Source/WebCore/rendering/RenderGrid.h b/Source/WebCore/rendering/RenderGrid.h >index 2032abd3afb78f5aeda99c872b7e4c2bd82a78d0..b821f0b22cac8ed84f2ddee1980ea8eefb919a94 100644 >--- a/Source/WebCore/rendering/RenderGrid.h >+++ b/Source/WebCore/rendering/RenderGrid.h >@@ -62,6 +62,11 @@ public: > > LayoutUnit guttersSize(GridTrackSizingDirection, size_t span) const; > >+ LayoutUnit offsetBetweenTracks(GridTrackSizingDirection direction) const >+ { >+ return direction == ForColumns ? m_offsetBetweenColumns : m_offsetBetweenRows; >+ } >+ > private: > const char* renderName() const override; > bool isRenderGrid() const override { return true; } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index c3591a1c23b5434de34d0c8baaee15113e9f4f71..d55b4c456d93a0452064c652bebce5dac0f0c7da 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2016-04-20 Manuel Rego Casasnovas <rego@igalia.com> >+ >+ [css-grid] Fix grid-template-columns|rows computed style with content alignment >+ https://bugs.webkit.org/show_bug.cgi?id=156793 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment-expected.txt: Added. >+ * fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment.html: Added. >+ > 2016-04-19 Carlos Garcia Campos <cgarcia@igalia.com> > > Unreviewed GTK+ gardening. Rebaseline tests after r190840. >diff --git a/LayoutTests/fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment-expected.txt b/LayoutTests/fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0a9542d083b9ec749d69ab3c8522b3d97d1548aa >--- /dev/null >+++ b/LayoutTests/fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment-expected.txt >@@ -0,0 +1,37 @@ >+Test that computed style for grid-template-columns and grid-template-rows works as expected with content alignment and gaps. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS window.getComputedStyle(gridContentStart, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridContentStart, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridContentCenter, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridContentCenter, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridContentEnd, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridContentEnd, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridContentSpaceBetween, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridContentSpaceBetween, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridContentSpaceAround, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridContentSpaceAround, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridContentSpaceEvenly, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridContentSpaceEvenly, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridContentStretch, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridContentStretch, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridGapsContentStart, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridGapsContentStart, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridGapsContentCenter, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridGapsContentCenter, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridGapsContentEnd, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridGapsContentEnd, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridGapsContentSpaceBetween, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridGapsContentSpaceBetween, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridGapsContentSpaceAround, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridGapsContentSpaceAround, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridGapsContentSpaceEvenly, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridGapsContentSpaceEvenly, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS window.getComputedStyle(gridGapsContentStretch, '').getPropertyValue('-webkit-grid-template-columns') is "300px 200px 100px" >+PASS window.getComputedStyle(gridGapsContentStretch, '').getPropertyValue('-webkit-grid-template-rows') is "150px 100px 50px" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment.html b/LayoutTests/fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7200a283267d7b3272a064b0635037cc25ef41e2 >--- /dev/null >+++ b/LayoutTests/fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment.html >@@ -0,0 +1,53 @@ >+<!DOCTYPE HTML> >+<link href="resources/grid.css" rel="stylesheet"> >+<link href="resources/grid-alignment.css" rel="stylesheet"> >+<style> >+.grid { >+ -webkit-grid-template-columns: 300px 200px 100px; >+ -webkit-grid-template-rows: 150px 100px 50px; >+ width: 800px; >+ height: 500px; >+} >+ >+.gaps { >+ -webkit-grid-gap: 10px 20px; >+} >+</style> >+ >+<div class="grid contentStart" id="gridContentStart"></div> >+<div class="grid contentCenter" id="gridContentCenter"></div> >+<div class="grid contentEnd" id="gridContentEnd"></div> >+<div class="grid contentSpaceBetween" id="gridContentSpaceBetween"></div> >+<div class="grid contentSpaceAround" id="gridContentSpaceAround"></div> >+<div class="grid contentSpaceEvenly" id="gridContentSpaceEvenly"></div> >+<div class="grid contentStretch" id="gridContentStretch"></div> >+ >+<div class="grid gaps contentStart" id="gridGapsContentStart"></div> >+<div class="grid gaps contentCenter" id="gridGapsContentCenter"></div> >+<div class="grid gaps contentEnd" id="gridGapsContentEnd"></div> >+<div class="grid gaps contentSpaceBetween" id="gridGapsContentSpaceBetween"></div> >+<div class="grid gaps contentSpaceAround" id="gridGapsContentSpaceAround"></div> >+<div class="grid gaps contentSpaceEvenly" id="gridGapsContentSpaceEvenly"></div> >+<div class="grid gaps contentStretch" id="gridGapsContentStretch"></div> >+ >+<script src="../../resources/js-test.js"></script> >+<script src="resources/grid-definitions-parsing-utils.js"></script> >+<script> >+ description("Test that computed style for grid-template-columns and grid-template-rows works as expected with content alignment and gaps."); >+ >+ testGridTemplatesValues(document.getElementById("gridContentStart"), "300px 200px 100px", "150px 100px 50px"); >+ testGridTemplatesValues(document.getElementById("gridContentCenter"), "300px 200px 100px", "150px 100px 50px"); >+ testGridTemplatesValues(document.getElementById("gridContentEnd"), "300px 200px 100px", "150px 100px 50px"); >+ testGridTemplatesValues(document.getElementById("gridContentSpaceBetween"), "300px 200px 100px", "150px 100px 50px"); >+ testGridTemplatesValues(document.getElementById("gridContentSpaceAround"), "300px 200px 100px", "150px 100px 50px"); >+ testGridTemplatesValues(document.getElementById("gridContentSpaceEvenly"), "300px 200px 100px", "150px 100px 50px"); >+ testGridTemplatesValues(document.getElementById("gridContentStretch"), "300px 200px 100px", "150px 100px 50px"); >+ >+ testGridTemplatesValues(document.getElementById("gridGapsContentStart"), "300px 200px 100px", "150px 100px 50px"); >+ testGridTemplatesValues(document.getElementById("gridGapsContentCenter"), "300px 200px 100px", "150px 100px 50px"); >+ testGridTemplatesValues(document.getElementById("gridGapsContentEnd"), "300px 200px 100px", "150px 100px 50px"); >+ testGridTemplatesValues(document.getElementById("gridGapsContentSpaceBetween"), "300px 200px 100px", "150px 100px 50px"); >+ testGridTemplatesValues(document.getElementById("gridGapsContentSpaceAround"), "300px 200px 100px", "150px 100px 50px"); >+ testGridTemplatesValues(document.getElementById("gridGapsContentSpaceEvenly"), "300px 200px 100px", "150px 100px 50px"); >+ testGridTemplatesValues(document.getElementById("gridGapsContentStretch"), "300px 200px 100px", "150px 100px 50px"); >+</script>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 156793
:
276818
|
276903
|
277235