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

Side by Side Diff: Source/core/rendering/style/RenderStyle.h

Issue 636993002: [CSS Grid Layout] Upgrade justify-content parsing to CSS3 Box Alignment spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 const Length& flexBasis() const { return rareNonInheritedData->m_flexibleBox ->m_flexBasis; } 761 const Length& flexBasis() const { return rareNonInheritedData->m_flexibleBox ->m_flexBasis; }
762 EAlignContent alignContent() const { return static_cast<EAlignContent>(rareN onInheritedData->m_alignContent); } 762 EAlignContent alignContent() const { return static_cast<EAlignContent>(rareN onInheritedData->m_alignContent); }
763 ItemPosition alignItems() const { return static_cast<ItemPosition>(rareNonIn heritedData->m_alignItems); } 763 ItemPosition alignItems() const { return static_cast<ItemPosition>(rareNonIn heritedData->m_alignItems); }
764 OverflowAlignment alignItemsOverflowAlignment() const { return static_cast<O verflowAlignment>(rareNonInheritedData->m_alignItemsOverflowAlignment); } 764 OverflowAlignment alignItemsOverflowAlignment() const { return static_cast<O verflowAlignment>(rareNonInheritedData->m_alignItemsOverflowAlignment); }
765 ItemPosition alignSelf() const { return static_cast<ItemPosition>(rareNonInh eritedData->m_alignSelf); } 765 ItemPosition alignSelf() const { return static_cast<ItemPosition>(rareNonInh eritedData->m_alignSelf); }
766 OverflowAlignment alignSelfOverflowAlignment() const { return static_cast<Ov erflowAlignment>(rareNonInheritedData->m_alignSelfOverflowAlignment); } 766 OverflowAlignment alignSelfOverflowAlignment() const { return static_cast<Ov erflowAlignment>(rareNonInheritedData->m_alignSelfOverflowAlignment); }
767 EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(ra reNonInheritedData->m_flexibleBox->m_flexDirection); } 767 EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(ra reNonInheritedData->m_flexibleBox->m_flexDirection); }
768 bool isColumnFlexDirection() const { return flexDirection() == FlowColumn || flexDirection() == FlowColumnReverse; } 768 bool isColumnFlexDirection() const { return flexDirection() == FlowColumn || flexDirection() == FlowColumnReverse; }
769 bool isReverseFlexDirection() const { return flexDirection() == FlowRowRever se || flexDirection() == FlowColumnReverse; } 769 bool isReverseFlexDirection() const { return flexDirection() == FlowRowRever se || flexDirection() == FlowColumnReverse; }
770 EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(rareNonInheritedD ata->m_flexibleBox->m_flexWrap); } 770 EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(rareNonInheritedD ata->m_flexibleBox->m_flexWrap); }
771 EJustifyContent justifyContent() const { return static_cast<EJustifyContent> (rareNonInheritedData->m_justifyContent); } 771 ContentPosition justifyContent() const { return static_cast<ContentPosition> (rareNonInheritedData->m_justifyContent); }
772 ContentDistributionType justifyContentDistribution() const { return static_c ast<ContentDistributionType>(rareNonInheritedData->m_justifyContentDistribution) ; }
773 OverflowAlignment justifyContentOverflowAlignment() const { return static_ca st<OverflowAlignment>(rareNonInheritedData->m_justifyContentOverflowAlignment); }
772 ItemPosition justifyItems() const { return static_cast<ItemPosition>(rareNon InheritedData->m_justifyItems); } 774 ItemPosition justifyItems() const { return static_cast<ItemPosition>(rareNon InheritedData->m_justifyItems); }
773 OverflowAlignment justifyItemsOverflowAlignment() const { return static_cast <OverflowAlignment>(rareNonInheritedData->m_justifyItemsOverflowAlignment); } 775 OverflowAlignment justifyItemsOverflowAlignment() const { return static_cast <OverflowAlignment>(rareNonInheritedData->m_justifyItemsOverflowAlignment); }
774 ItemPositionType justifyItemsPositionType() const { return static_cast<ItemP ositionType>(rareNonInheritedData->m_justifyItemsPositionType); } 776 ItemPositionType justifyItemsPositionType() const { return static_cast<ItemP ositionType>(rareNonInheritedData->m_justifyItemsPositionType); }
775 ItemPosition justifySelf() const { return static_cast<ItemPosition>(rareNonI nheritedData->m_justifySelf); } 777 ItemPosition justifySelf() const { return static_cast<ItemPosition>(rareNonI nheritedData->m_justifySelf); }
776 OverflowAlignment justifySelfOverflowAlignment() const { return static_cast< OverflowAlignment>(rareNonInheritedData->m_justifySelfOverflowAlignment); } 778 OverflowAlignment justifySelfOverflowAlignment() const { return static_cast< OverflowAlignment>(rareNonInheritedData->m_justifySelfOverflowAlignment); }
777 779
778 const Vector<GridTrackSize>& gridTemplateColumns() const { return rareNonInh eritedData->m_grid->m_gridTemplateColumns; } 780 const Vector<GridTrackSize>& gridTemplateColumns() const { return rareNonInh eritedData->m_grid->m_gridTemplateColumns; }
779 const Vector<GridTrackSize>& gridTemplateRows() const { return rareNonInheri tedData->m_grid->m_gridTemplateRows; } 781 const Vector<GridTrackSize>& gridTemplateRows() const { return rareNonInheri tedData->m_grid->m_gridTemplateRows; }
780 const NamedGridLinesMap& namedGridColumnLines() const { return rareNonInheri tedData->m_grid->m_namedGridColumnLines; } 782 const NamedGridLinesMap& namedGridColumnLines() const { return rareNonInheri tedData->m_grid->m_namedGridColumnLines; }
781 const NamedGridLinesMap& namedGridRowLines() const { return rareNonInherited Data->m_grid->m_namedGridRowLines; } 783 const NamedGridLinesMap& namedGridRowLines() const { return rareNonInherited Data->m_grid->m_namedGridRowLines; }
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 // We restrict the smallest value to int min + 2 because we use int min and int min + 1 as special values in a hash set. 1272 // We restrict the smallest value to int min + 2 because we use int min and int min + 1 as special values in a hash set.
1271 void setOrder(int o) { SET_VAR(rareNonInheritedData, m_order, max(std::numer ic_limits<int>::min() + 2, o)); } 1273 void setOrder(int o) { SET_VAR(rareNonInheritedData, m_order, max(std::numer ic_limits<int>::min() + 2, o)); }
1272 void addCallbackSelector(const String& selector); 1274 void addCallbackSelector(const String& selector);
1273 void setAlignContent(EAlignContent p) { SET_VAR(rareNonInheritedData, m_alig nContent, p); } 1275 void setAlignContent(EAlignContent p) { SET_VAR(rareNonInheritedData, m_alig nContent, p); }
1274 void setAlignItems(ItemPosition a) { SET_VAR(rareNonInheritedData, m_alignIt ems, a); } 1276 void setAlignItems(ItemPosition a) { SET_VAR(rareNonInheritedData, m_alignIt ems, a); }
1275 void setAlignItemsOverflowAlignment(OverflowAlignment overflowAlignment) { S ET_VAR(rareNonInheritedData, m_alignItemsOverflowAlignment, overflowAlignment); } 1277 void setAlignItemsOverflowAlignment(OverflowAlignment overflowAlignment) { S ET_VAR(rareNonInheritedData, m_alignItemsOverflowAlignment, overflowAlignment); }
1276 void setAlignSelf(ItemPosition a) { SET_VAR(rareNonInheritedData, m_alignSel f, a); } 1278 void setAlignSelf(ItemPosition a) { SET_VAR(rareNonInheritedData, m_alignSel f, a); }
1277 void setAlignSelfOverflowAlignment(OverflowAlignment overflowAlignment) { SE T_VAR(rareNonInheritedData, m_alignSelfOverflowAlignment, overflowAlignment); } 1279 void setAlignSelfOverflowAlignment(OverflowAlignment overflowAlignment) { SE T_VAR(rareNonInheritedData, m_alignSelfOverflowAlignment, overflowAlignment); }
1278 void setFlexDirection(EFlexDirection direction) { SET_VAR(rareNonInheritedDa ta.access()->m_flexibleBox, m_flexDirection, direction); } 1280 void setFlexDirection(EFlexDirection direction) { SET_VAR(rareNonInheritedDa ta.access()->m_flexibleBox, m_flexDirection, direction); }
1279 void setFlexWrap(EFlexWrap w) { SET_VAR(rareNonInheritedData.access()->m_fle xibleBox, m_flexWrap, w); } 1281 void setFlexWrap(EFlexWrap w) { SET_VAR(rareNonInheritedData.access()->m_fle xibleBox, m_flexWrap, w); }
1280 void setJustifyContent(EJustifyContent p) { SET_VAR(rareNonInheritedData, m_ justifyContent, p); } 1282 void setJustifyContent(ContentPosition p) { SET_VAR(rareNonInheritedData, m_ justifyContent, p); }
1283 void setJustifyContentDistribution(ContentDistributionType p) { SET_VAR(rare NonInheritedData, m_justifyContentDistribution, p); }
1284 void setJustifyContentOverflowAlignment(OverflowAlignment overflowAlignment) { SET_VAR(rareNonInheritedData, m_justifyContentOverflowAlignment, overflowAlig nment); }
1281 void setJustifyItems(ItemPosition justifyItems) { SET_VAR(rareNonInheritedDa ta, m_justifyItems, justifyItems); } 1285 void setJustifyItems(ItemPosition justifyItems) { SET_VAR(rareNonInheritedDa ta, m_justifyItems, justifyItems); }
1282 void setJustifyItemsOverflowAlignment(OverflowAlignment overflowAlignment) { SET_VAR(rareNonInheritedData, m_justifyItemsOverflowAlignment, overflowAlignmen t); } 1286 void setJustifyItemsOverflowAlignment(OverflowAlignment overflowAlignment) { SET_VAR(rareNonInheritedData, m_justifyItemsOverflowAlignment, overflowAlignmen t); }
1283 void setJustifyItemsPositionType(ItemPositionType positionType) { SET_VAR(ra reNonInheritedData, m_justifyItemsPositionType, positionType); } 1287 void setJustifyItemsPositionType(ItemPositionType positionType) { SET_VAR(ra reNonInheritedData, m_justifyItemsPositionType, positionType); }
1284 void setJustifySelf(ItemPosition justifySelf) { SET_VAR(rareNonInheritedData , m_justifySelf, justifySelf); } 1288 void setJustifySelf(ItemPosition justifySelf) { SET_VAR(rareNonInheritedData , m_justifySelf, justifySelf); }
1285 void setJustifySelfOverflowAlignment(OverflowAlignment overflowAlignment) { SET_VAR(rareNonInheritedData, m_justifySelfOverflowAlignment, overflowAlignment) ; } 1289 void setJustifySelfOverflowAlignment(OverflowAlignment overflowAlignment) { SET_VAR(rareNonInheritedData, m_justifySelfOverflowAlignment, overflowAlignment) ; }
1286 void setGridAutoColumns(const GridTrackSize& length) { SET_VAR(rareNonInheri tedData.access()->m_grid, m_gridAutoColumns, length); } 1290 void setGridAutoColumns(const GridTrackSize& length) { SET_VAR(rareNonInheri tedData.access()->m_grid, m_gridAutoColumns, length); }
1287 void setGridAutoRows(const GridTrackSize& length) { SET_VAR(rareNonInherited Data.access()->m_grid, m_gridAutoRows, length); } 1291 void setGridAutoRows(const GridTrackSize& length) { SET_VAR(rareNonInherited Data.access()->m_grid, m_gridAutoRows, length); }
1288 void setGridTemplateColumns(const Vector<GridTrackSize>& lengths) { SET_VAR( rareNonInheritedData.access()->m_grid, m_gridTemplateColumns, lengths); } 1292 void setGridTemplateColumns(const Vector<GridTrackSize>& lengths) { SET_VAR( rareNonInheritedData.access()->m_grid, m_gridTemplateColumns, lengths); }
1289 void setGridTemplateRows(const Vector<GridTrackSize>& lengths) { SET_VAR(rar eNonInheritedData.access()->m_grid, m_gridTemplateRows, lengths); } 1293 void setGridTemplateRows(const Vector<GridTrackSize>& lengths) { SET_VAR(rar eNonInheritedData.access()->m_grid, m_gridTemplateRows, lengths); }
1290 void setNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_VAR(rareNonInheritedData.access()->m_grid, m_namedGridColumnLines, namedGr idColumnLines); } 1294 void setNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_VAR(rareNonInheritedData.access()->m_grid, m_namedGridColumnLines, namedGr idColumnLines); }
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 1501
1498 const AtomicString& hyphenString() const; 1502 const AtomicString& hyphenString() const;
1499 1503
1500 bool inheritedNotEqual(const RenderStyle*) const; 1504 bool inheritedNotEqual(const RenderStyle*) const;
1501 bool inheritedDataShared(const RenderStyle*) const; 1505 bool inheritedDataShared(const RenderStyle*) const;
1502 1506
1503 bool isDisplayReplacedType() const { return isDisplayReplacedType(display()) ; } 1507 bool isDisplayReplacedType() const { return isDisplayReplacedType(display()) ; }
1504 bool isDisplayInlineType() const { return isDisplayInlineType(display()); } 1508 bool isDisplayInlineType() const { return isDisplayInlineType(display()); }
1505 bool isOriginalDisplayInlineType() const { return isDisplayInlineType(origin alDisplay()); } 1509 bool isOriginalDisplayInlineType() const { return isDisplayInlineType(origin alDisplay()); }
1506 bool isDisplayFlexibleOrGridBox() const { return isDisplayFlexibleBox(displa y()) || isDisplayGridBox(display()); } 1510 bool isDisplayFlexibleOrGridBox() const { return isDisplayFlexibleBox(displa y()) || isDisplayGridBox(display()); }
1511 bool isDisplayFlexibleBox() const { return isDisplayFlexibleBox(display()); }
1507 1512
1508 1513
1509 bool setWritingMode(WritingMode v) 1514 bool setWritingMode(WritingMode v)
1510 { 1515 {
1511 if (v == writingMode()) 1516 if (v == writingMode())
1512 return false; 1517 return false;
1513 1518
1514 inherited_flags.m_writingMode = v; 1519 inherited_flags.m_writingMode = v;
1515 return true; 1520 return true;
1516 } 1521 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 static float initialFlexShrink() { return 1; } 1620 static float initialFlexShrink() { return 1; }
1616 static Length initialFlexBasis() { return Length(Auto); } 1621 static Length initialFlexBasis() { return Length(Auto); }
1617 static int initialOrder() { return 0; } 1622 static int initialOrder() { return 0; }
1618 static EAlignContent initialAlignContent() { return AlignContentStretch; } 1623 static EAlignContent initialAlignContent() { return AlignContentStretch; }
1619 static ItemPosition initialAlignItems() { return ItemPositionAuto; } 1624 static ItemPosition initialAlignItems() { return ItemPositionAuto; }
1620 static OverflowAlignment initialAlignItemsOverflowAlignment() { return Overf lowAlignmentDefault; } 1625 static OverflowAlignment initialAlignItemsOverflowAlignment() { return Overf lowAlignmentDefault; }
1621 static ItemPosition initialAlignSelf() { return ItemPositionAuto; } 1626 static ItemPosition initialAlignSelf() { return ItemPositionAuto; }
1622 static OverflowAlignment initialAlignSelfOverflowAlignment() { return Overfl owAlignmentDefault; } 1627 static OverflowAlignment initialAlignSelfOverflowAlignment() { return Overfl owAlignmentDefault; }
1623 static EFlexDirection initialFlexDirection() { return FlowRow; } 1628 static EFlexDirection initialFlexDirection() { return FlowRow; }
1624 static EFlexWrap initialFlexWrap() { return FlexNoWrap; } 1629 static EFlexWrap initialFlexWrap() { return FlexNoWrap; }
1625 static EJustifyContent initialJustifyContent() { return JustifyFlexStart; } 1630 static ContentPosition initialJustifyContent() { return ContentPositionAuto; }
1631 static ContentDistributionType initialJustifyContentDistribution() { return ContentDistributionDefault; }
1632 static OverflowAlignment initialJustifyContentOverflowAlignment() { return O verflowAlignmentDefault; }
1626 static ItemPosition initialJustifyItems() { return ItemPositionAuto; } 1633 static ItemPosition initialJustifyItems() { return ItemPositionAuto; }
1627 static OverflowAlignment initialJustifyItemsOverflowAlignment() { return Ove rflowAlignmentDefault; } 1634 static OverflowAlignment initialJustifyItemsOverflowAlignment() { return Ove rflowAlignmentDefault; }
1628 static ItemPositionType initialJustifyItemsPositionType() { return NonLegacy Position; } 1635 static ItemPositionType initialJustifyItemsPositionType() { return NonLegacy Position; }
1629 static ItemPosition initialJustifySelf() { return ItemPositionAuto; } 1636 static ItemPosition initialJustifySelf() { return ItemPositionAuto; }
1630 static OverflowAlignment initialJustifySelfOverflowAlignment() { return Over flowAlignmentDefault; } 1637 static OverflowAlignment initialJustifySelfOverflowAlignment() { return Over flowAlignmentDefault; }
1631 static int initialMarqueeLoopCount() { return -1; } 1638 static int initialMarqueeLoopCount() { return -1; }
1632 static int initialMarqueeSpeed() { return 85; } 1639 static int initialMarqueeSpeed() { return 85; }
1633 static Length initialMarqueeIncrement() { return Length(6, Fixed); } 1640 static Length initialMarqueeIncrement() { return Length(6, Fixed); }
1634 static EMarqueeBehavior initialMarqueeBehavior() { return MSCROLL; } 1641 static EMarqueeBehavior initialMarqueeBehavior() { return MSCROLL; }
1635 static EMarqueeDirection initialMarqueeDirection() { return MAUTO; } 1642 static EMarqueeDirection initialMarqueeDirection() { return MAUTO; }
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1929 inline bool RenderStyle::hasPseudoElementStyle() const 1936 inline bool RenderStyle::hasPseudoElementStyle() const
1930 { 1937 {
1931 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK; 1938 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK;
1932 } 1939 }
1933 1940
1934 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect ::Radii&); 1941 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect ::Radii&);
1935 1942
1936 } // namespace blink 1943 } // namespace blink
1937 1944
1938 #endif // RenderStyle_h 1945 #endif // RenderStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698