Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutGrid.h

Issue 1407633003: [css-grid] Implementation of Baseline Self-Alignment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improving the skipped tesst by solving some rounding issues Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutGrid.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.h b/third_party/WebKit/Source/core/layout/LayoutGrid.h
index 84d80b814f27536fced40af0d2dd8768944ecc89..37f512e56cd805b6e85c6507541b9499e3adc692 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.h
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.h
@@ -26,12 +26,13 @@
#ifndef LayoutGrid_h
#define LayoutGrid_h
+#include <memory>
+#include "core/layout/BaselineAlignment.h"
#include "core/layout/Grid.h"
#include "core/layout/GridTrackSizingAlgorithm.h"
#include "core/layout/LayoutBlock.h"
#include "core/layout/OrderIterator.h"
#include "core/style/GridPositionsResolver.h"
-#include <memory>
namespace blink {
@@ -40,6 +41,7 @@ struct GridArea;
struct GridSpan;
enum GridAxisPosition { GridAxisStart, GridAxisEnd, GridAxisCenter };
+enum GridAxis { GridRowAxis, GridColumnAxis };
class LayoutGrid final : public LayoutBlock {
public:
@@ -95,6 +97,11 @@ class LayoutGrid final : public LayoutBlock {
SizingOperation) const;
bool cachedHasDefiniteLogicalHeight() const;
bool isOrthogonalChild(const LayoutBox&) const;
+ bool isBaselineContextComputed(GridAxis) const;
+ bool isBaselineAlignmentForChild(const LayoutBox&,
+ GridAxis = GridColumnAxis) const;
+ const BaselineGroup& getBaselineGroupForChild(const LayoutBox&,
+ GridAxis) const;
protected:
ItemPosition selfAlignmentNormalBehavior(
@@ -230,7 +237,26 @@ class LayoutGrid final : public LayoutBlock {
LinePositionMode = PositionOnContainingLine) const override;
int firstLineBoxBaseline() const override;
int inlineBlockBaseline(LineDirectionMode) const override;
- bool isInlineBaselineAlignedChild(const LayoutBox* child) const;
+
+ bool isHorizontalGridAxis(GridAxis) const;
+ bool isParallelToBlockAxisForChild(const LayoutBox&, GridAxis) const;
+ bool isDescentBaselineForChild(const LayoutBox&, GridAxis) const;
+
+ LayoutUnit marginOverForChild(const LayoutBox&, GridAxis) const;
+ LayoutUnit marginUnderForChild(const LayoutBox&, GridAxis) const;
+ LayoutUnit logicalAscentForChild(const LayoutBox&, GridAxis) const;
+ LayoutUnit ascentForChild(const LayoutBox&, GridAxis) const;
+ LayoutUnit descentForChild(const LayoutBox&,
+ LayoutUnit ascent,
+ GridAxis) const;
+
+ bool baselineMayAffectIntrinsicWidth() const;
+ bool baselineMayAffectIntrinsicHeight() const;
+ void computeBaselineAlignmentContext();
+ void updateBaselineAlignmentContextIfNeeded(LayoutBox&, GridAxis);
+
+ LayoutUnit columnAxisBaselineOffsetForChild(const LayoutBox&) const;
+ LayoutUnit rowAxisBaselineOffsetForChild(const LayoutBox&) const;
LayoutUnit gridGapForDirection(GridTrackSizingDirection,
SizingOperation) const;
@@ -243,6 +269,15 @@ class LayoutGrid final : public LayoutBlock {
size_t numTracks(GridTrackSizingDirection, const Grid&) const;
+ typedef HashMap<unsigned,
+ std::unique_ptr<BaselineContext>,
+ DefaultHash<unsigned>::Hash,
+ WTF::UnsignedWithZeroKeyHashTraits<unsigned>>
+ BaselineContextsMap;
+
+ BaselineContextsMap m_rowAxisAlignmentContext;
+ BaselineContextsMap m_colAxisAlignmentContext;
+
Grid m_grid;
GridTrackSizingAlgorithm m_trackSizingAlgorithm;
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698