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

Side by Side Diff: third_party/WebKit/Source/core/css/StylePropertySerializer.cpp

Issue 2737843003: [css-align] Implement place-items alignment shorthand (Closed)
Patch Set: Created 3 years, 9 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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
4 * rights reserved. 4 * rights reserved.
5 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 5 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
6 * Copyright (C) 2013 Intel Corporation. All rights reserved. 6 * Copyright (C) 2013 Intel Corporation. All rights reserved.
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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 return getShorthandValue(flexFlowShorthand()); 448 return getShorthandValue(flexFlowShorthand());
449 case CSSPropertyGridColumn: 449 case CSSPropertyGridColumn:
450 return getShorthandValue(gridColumnShorthand(), " / "); 450 return getShorthandValue(gridColumnShorthand(), " / ");
451 case CSSPropertyGridRow: 451 case CSSPropertyGridRow:
452 return getShorthandValue(gridRowShorthand(), " / "); 452 return getShorthandValue(gridRowShorthand(), " / ");
453 case CSSPropertyGridArea: 453 case CSSPropertyGridArea:
454 return getShorthandValue(gridAreaShorthand(), " / "); 454 return getShorthandValue(gridAreaShorthand(), " / ");
455 case CSSPropertyGridGap: 455 case CSSPropertyGridGap:
456 return getShorthandValue(gridGapShorthand()); 456 return getShorthandValue(gridGapShorthand());
457 case CSSPropertyPlaceContent: 457 case CSSPropertyPlaceContent:
458 return placeContentPropertyValue(); 458 return getAlignmentShorthandValue(placeContentShorthand());
459 case CSSPropertyPlaceItems:
460 return getAlignmentShorthandValue(placeItemsShorthand());
459 case CSSPropertyFont: 461 case CSSPropertyFont:
460 return fontValue(); 462 return fontValue();
461 case CSSPropertyFontVariant: 463 case CSSPropertyFontVariant:
462 return fontVariantValue(); 464 return fontVariantValue();
463 case CSSPropertyMargin: 465 case CSSPropertyMargin:
464 return get4Values(marginShorthand()); 466 return get4Values(marginShorthand());
465 case CSSPropertyMotion: 467 case CSSPropertyMotion:
466 return getShorthandValue(motionShorthand()); 468 return getShorthandValue(motionShorthand());
467 case CSSPropertyOffset: 469 case CSSPropertyOffset:
468 return getShorthandValue(offsetShorthand()); 470 return getShorthandValue(offsetShorthand());
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 // FIXME: CSSInitialValue::cssText should generate the right value. 845 // FIXME: CSSInitialValue::cssText should generate the right value.
844 String text = value->cssText(); 846 String text = value->cssText();
845 if (res.isNull()) 847 if (res.isNull())
846 res = text; 848 res = text;
847 else if (res != text) 849 else if (res != text)
848 return String(); 850 return String();
849 } 851 }
850 return res; 852 return res;
851 } 853 }
852 854
853 String StylePropertySerializer::placeContentPropertyValue() const { 855 String StylePropertySerializer::getAlignmentShorthandValue(
854 String value = getCommonValue(placeContentShorthand()); 856 const StylePropertyShorthand& shorthand) const {
857 String value = getCommonValue(shorthand);
855 if (value.isNull() || value.isEmpty()) 858 if (value.isNull() || value.isEmpty())
856 return getShorthandValue(placeContentShorthand()); 859 return getShorthandValue(shorthand);
857 return value; 860 return value;
858 } 861 }
859 862
860 String StylePropertySerializer::borderPropertyValue() const { 863 String StylePropertySerializer::borderPropertyValue() const {
861 const StylePropertyShorthand properties[3] = { 864 const StylePropertyShorthand properties[3] = {
862 borderWidthShorthand(), borderStyleShorthand(), borderColorShorthand()}; 865 borderWidthShorthand(), borderStyleShorthand(), borderColorShorthand()};
863 StringBuilder result; 866 StringBuilder result;
864 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { 867 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) {
865 String value = getCommonValue(properties[i]); 868 String value = getCommonValue(properties[i]);
866 if (value.isNull()) 869 if (value.isNull())
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 const CSSValue& xValue = 939 const CSSValue& xValue =
937 repeatXList ? repeatXList->item(i % repeatXList->length()) : repeatX; 940 repeatXList ? repeatXList->item(i % repeatXList->length()) : repeatX;
938 const CSSValue& yValue = 941 const CSSValue& yValue =
939 repeatYList ? repeatYList->item(i % repeatYList->length()) : repeatY; 942 repeatYList ? repeatYList->item(i % repeatYList->length()) : repeatY;
940 appendBackgroundRepeatValue(builder, xValue, yValue); 943 appendBackgroundRepeatValue(builder, xValue, yValue);
941 } 944 }
942 return builder.toString(); 945 return builder.toString();
943 } 946 }
944 947
945 } // namespace blink 948 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698