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

Side by Side Diff: Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 1070143002: [Alignment] Single class for holding the alignment data. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Using the StyleConverter. Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * Copyright (C) 2015 Google Inc. All rights reserved. 7 * Copyright (C) 2015 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1508 } 1508 }
1509 return value.release(); 1509 return value.release();
1510 } 1510 }
1511 case CSSPropertyDirection: 1511 case CSSPropertyDirection:
1512 return cssValuePool().createValue(style.direction()); 1512 return cssValuePool().createValue(style.direction());
1513 case CSSPropertyDisplay: 1513 case CSSPropertyDisplay:
1514 return cssValuePool().createValue(style.display()); 1514 return cssValuePool().createValue(style.display());
1515 case CSSPropertyEmptyCells: 1515 case CSSPropertyEmptyCells:
1516 return cssValuePool().createValue(style.emptyCells()); 1516 return cssValuePool().createValue(style.emptyCells());
1517 case CSSPropertyAlignContent: 1517 case CSSPropertyAlignContent:
1518 return valueForContentPositionAndDistributionWithOverflowAlignment(resol veContentAlignmentAuto(style.alignContent(), style.alignContentDistribution(), s tyledNode), style.alignContentOverflowAlignment(), style.alignContentDistributio n()); 1518 return valueForContentPositionAndDistributionWithOverflowAlignment(resol veContentAlignmentAuto(style.alignContentPosition(), style.alignContentDistribut ion(), styledNode), style.alignContentOverflowAlignment(), style.alignContentDis tribution());
1519 case CSSPropertyAlignItems: 1519 case CSSPropertyAlignItems:
1520 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st yle.alignItems(), styledNode), style.alignItemsOverflowAlignment(), NonLegacyPos ition); 1520 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st yle.alignItemsPosition(), styledNode), style.alignItemsOverflowAlignment(), NonL egacyPosition);
1521 case CSSPropertyAlignSelf: 1521 case CSSPropertyAlignSelf:
1522 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st yle.alignSelf(), styledNode->parentNode()), style.alignSelfOverflowAlignment(), NonLegacyPosition); 1522 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st yle.alignSelfPosition(), styledNode->parentNode()), style.alignSelfOverflowAlign ment(), NonLegacyPosition);
1523 case CSSPropertyFlex: 1523 case CSSPropertyFlex:
1524 return valuesForShorthandProperty(flexShorthand(), style, renderer, styl edNode, allowVisitedStyle); 1524 return valuesForShorthandProperty(flexShorthand(), style, renderer, styl edNode, allowVisitedStyle);
1525 case CSSPropertyFlexBasis: 1525 case CSSPropertyFlexBasis:
1526 return zoomAdjustedPixelValueForLength(style.flexBasis(), style); 1526 return zoomAdjustedPixelValueForLength(style.flexBasis(), style);
1527 case CSSPropertyFlexDirection: 1527 case CSSPropertyFlexDirection:
1528 return cssValuePool().createValue(style.flexDirection()); 1528 return cssValuePool().createValue(style.flexDirection());
1529 case CSSPropertyFlexFlow: 1529 case CSSPropertyFlexFlow:
1530 return valuesForShorthandProperty(flexFlowShorthand(), style, renderer, styledNode, allowVisitedStyle); 1530 return valuesForShorthandProperty(flexFlowShorthand(), style, renderer, styledNode, allowVisitedStyle);
1531 case CSSPropertyFlexGrow: 1531 case CSSPropertyFlexGrow:
1532 return cssValuePool().createValue(style.flexGrow()); 1532 return cssValuePool().createValue(style.flexGrow());
1533 case CSSPropertyFlexShrink: 1533 case CSSPropertyFlexShrink:
1534 return cssValuePool().createValue(style.flexShrink()); 1534 return cssValuePool().createValue(style.flexShrink());
1535 case CSSPropertyFlexWrap: 1535 case CSSPropertyFlexWrap:
1536 return cssValuePool().createValue(style.flexWrap()); 1536 return cssValuePool().createValue(style.flexWrap());
1537 case CSSPropertyJustifyContent: 1537 case CSSPropertyJustifyContent:
1538 return valueForContentPositionAndDistributionWithOverflowAlignment(resol veContentAlignmentAuto(style.justifyContent(), style.justifyContentDistribution( ), styledNode), style.justifyContentOverflowAlignment(), style.justifyContentDis tribution()); 1538 return valueForContentPositionAndDistributionWithOverflowAlignment(resol veContentAlignmentAuto(style.justifyContentPosition(), style.justifyContentDistr ibution(), styledNode), style.justifyContentOverflowAlignment(), style.justifyCo ntentDistribution());
1539 case CSSPropertyOrder: 1539 case CSSPropertyOrder:
1540 return cssValuePool().createValue(style.order(), CSSPrimitiveValue::CSS_ NUMBER); 1540 return cssValuePool().createValue(style.order(), CSSPrimitiveValue::CSS_ NUMBER);
1541 case CSSPropertyFloat: 1541 case CSSPropertyFloat:
1542 if (style.display() != NONE && style.hasOutOfFlowPosition()) 1542 if (style.display() != NONE && style.hasOutOfFlowPosition())
1543 return cssValuePool().createIdentifierValue(CSSValueNone); 1543 return cssValuePool().createIdentifierValue(CSSValueNone);
1544 return cssValuePool().createValue(style.floating()); 1544 return cssValuePool().createValue(style.floating());
1545 case CSSPropertyFont: { 1545 case CSSPropertyFont: {
1546 RefPtrWillBeRawPtr<CSSFontValue> computedFont = CSSFontValue::create(); 1546 RefPtrWillBeRawPtr<CSSFontValue> computedFont = CSSFontValue::create();
1547 computedFont->style = valueForFontStyle(style); 1547 computedFont->style = valueForFontStyle(style);
1548 computedFont->variant = valueForFontVariant(style); 1548 computedFont->variant = valueForFontVariant(style);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1664 return cssValuePool().createValue(style.highlight(), CSSPrimitiveValue:: CSS_STRING); 1664 return cssValuePool().createValue(style.highlight(), CSSPrimitiveValue:: CSS_STRING);
1665 case CSSPropertyWebkitHyphenateCharacter: 1665 case CSSPropertyWebkitHyphenateCharacter:
1666 if (style.hyphenationString().isNull()) 1666 if (style.hyphenationString().isNull())
1667 return cssValuePool().createIdentifierValue(CSSValueAuto); 1667 return cssValuePool().createIdentifierValue(CSSValueAuto);
1668 return cssValuePool().createValue(style.hyphenationString(), CSSPrimitiv eValue::CSS_STRING); 1668 return cssValuePool().createValue(style.hyphenationString(), CSSPrimitiv eValue::CSS_STRING);
1669 case CSSPropertyImageRendering: 1669 case CSSPropertyImageRendering:
1670 return CSSPrimitiveValue::create(style.imageRendering()); 1670 return CSSPrimitiveValue::create(style.imageRendering());
1671 case CSSPropertyIsolation: 1671 case CSSPropertyIsolation:
1672 return cssValuePool().createValue(style.isolation()); 1672 return cssValuePool().createValue(style.isolation());
1673 case CSSPropertyJustifyItems: 1673 case CSSPropertyJustifyItems:
1674 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st yle.justifyItems(), styledNode), style.justifyItemsOverflowAlignment(), style.ju stifyItemsPositionType()); 1674 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st yle.justifyItemsPosition(), styledNode), style.justifyItemsOverflowAlignment(), style.justifyItemsPositionType());
1675 case CSSPropertyJustifySelf: 1675 case CSSPropertyJustifySelf:
1676 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st yle.justifySelf(), styledNode->parentNode()), style.justifySelfOverflowAlignment (), NonLegacyPosition); 1676 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st yle.justifySelfPosition(), styledNode->parentNode()), style.justifySelfOverflowA lignment(), NonLegacyPosition);
1677 case CSSPropertyLeft: 1677 case CSSPropertyLeft:
1678 return valueForPositionOffset(style, CSSPropertyLeft, renderer); 1678 return valueForPositionOffset(style, CSSPropertyLeft, renderer);
1679 case CSSPropertyLetterSpacing: 1679 case CSSPropertyLetterSpacing:
1680 if (!style.letterSpacing()) 1680 if (!style.letterSpacing())
1681 return cssValuePool().createIdentifierValue(CSSValueNormal); 1681 return cssValuePool().createIdentifierValue(CSSValueNormal);
1682 return zoomAdjustedPixelValue(style.letterSpacing(), style); 1682 return zoomAdjustedPixelValue(style.letterSpacing(), style);
1683 case CSSPropertyWebkitLineClamp: 1683 case CSSPropertyWebkitLineClamp:
1684 if (style.lineClamp().isNone()) 1684 if (style.lineClamp().isNone())
1685 return cssValuePool().createIdentifierValue(CSSValueNone); 1685 return cssValuePool().createIdentifierValue(CSSValueNone);
1686 return cssValuePool().createValue(style.lineClamp().value(), style.lineC lamp().isPercentage() ? CSSPrimitiveValue::CSS_PERCENTAGE : CSSPrimitiveValue::C SS_NUMBER); 1686 return cssValuePool().createValue(style.lineClamp().value(), style.lineC lamp().isPercentage() ? CSSPrimitiveValue::CSS_PERCENTAGE : CSSPrimitiveValue::C SS_NUMBER);
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
2572 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); 2572 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style);
2573 2573
2574 case CSSPropertyAll: 2574 case CSSPropertyAll:
2575 return nullptr; 2575 return nullptr;
2576 } 2576 }
2577 ASSERT_NOT_REACHED(); 2577 ASSERT_NOT_REACHED();
2578 return nullptr; 2578 return nullptr;
2579 } 2579 }
2580 2580
2581 } 2581 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698