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

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

Issue 2737843003: [css-align] Implement place-items alignment shorthand (Closed)
Patch Set: More layout tests fixes. 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 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 return getShorthandValue(flexFlowShorthand()); 456 return getShorthandValue(flexFlowShorthand());
457 case CSSPropertyGridColumn: 457 case CSSPropertyGridColumn:
458 return getShorthandValue(gridColumnShorthand(), " / "); 458 return getShorthandValue(gridColumnShorthand(), " / ");
459 case CSSPropertyGridRow: 459 case CSSPropertyGridRow:
460 return getShorthandValue(gridRowShorthand(), " / "); 460 return getShorthandValue(gridRowShorthand(), " / ");
461 case CSSPropertyGridArea: 461 case CSSPropertyGridArea:
462 return getShorthandValue(gridAreaShorthand(), " / "); 462 return getShorthandValue(gridAreaShorthand(), " / ");
463 case CSSPropertyGridGap: 463 case CSSPropertyGridGap:
464 return getShorthandValue(gridGapShorthand()); 464 return getShorthandValue(gridGapShorthand());
465 case CSSPropertyPlaceContent: 465 case CSSPropertyPlaceContent:
466 return placeContentPropertyValue(); 466 return getAlignmentShorthandValue(placeContentShorthand());
467 case CSSPropertyPlaceItems:
468 return getAlignmentShorthandValue(placeItemsShorthand());
467 case CSSPropertyFont: 469 case CSSPropertyFont:
468 return fontValue(); 470 return fontValue();
469 case CSSPropertyFontVariant: 471 case CSSPropertyFontVariant:
470 return fontVariantValue(); 472 return fontVariantValue();
471 case CSSPropertyMargin: 473 case CSSPropertyMargin:
472 return get4Values(marginShorthand()); 474 return get4Values(marginShorthand());
473 case CSSPropertyMotion: 475 case CSSPropertyMotion:
474 return getShorthandValue(motionShorthand()); 476 return getShorthandValue(motionShorthand());
475 case CSSPropertyOffset: 477 case CSSPropertyOffset:
476 return getShorthandValue(offsetShorthand()); 478 return getShorthandValue(offsetShorthand());
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 // FIXME: CSSInitialValue::cssText should generate the right value. 853 // FIXME: CSSInitialValue::cssText should generate the right value.
852 String text = value->cssText(); 854 String text = value->cssText();
853 if (res.isNull()) 855 if (res.isNull())
854 res = text; 856 res = text;
855 else if (res != text) 857 else if (res != text)
856 return String(); 858 return String();
857 } 859 }
858 return res; 860 return res;
859 } 861 }
860 862
861 String StylePropertySerializer::placeContentPropertyValue() const { 863 String StylePropertySerializer::getAlignmentShorthandValue(
862 String value = getCommonValue(placeContentShorthand()); 864 const StylePropertyShorthand& shorthand) const {
865 String value = getCommonValue(shorthand);
863 if (value.isNull() || value.isEmpty()) 866 if (value.isNull() || value.isEmpty())
864 return getShorthandValue(placeContentShorthand()); 867 return getShorthandValue(shorthand);
865 return value; 868 return value;
866 } 869 }
867 870
868 String StylePropertySerializer::borderPropertyValue() const { 871 String StylePropertySerializer::borderPropertyValue() const {
869 const StylePropertyShorthand properties[3] = { 872 const StylePropertyShorthand properties[3] = {
870 borderWidthShorthand(), borderStyleShorthand(), borderColorShorthand()}; 873 borderWidthShorthand(), borderStyleShorthand(), borderColorShorthand()};
871 StringBuilder result; 874 StringBuilder result;
872 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { 875 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) {
873 String value = getCommonValue(properties[i]); 876 String value = getCommonValue(properties[i]);
874 if (value.isNull()) 877 if (value.isNull())
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 const CSSValue& xValue = 947 const CSSValue& xValue =
945 repeatXList ? repeatXList->item(i % repeatXList->length()) : repeatX; 948 repeatXList ? repeatXList->item(i % repeatXList->length()) : repeatX;
946 const CSSValue& yValue = 949 const CSSValue& yValue =
947 repeatYList ? repeatYList->item(i % repeatYList->length()) : repeatY; 950 repeatYList ? repeatYList->item(i % repeatYList->length()) : repeatY;
948 appendBackgroundRepeatValue(builder, xValue, yValue); 951 appendBackgroundRepeatValue(builder, xValue, yValue);
949 } 952 }
950 return builder.toString(); 953 return builder.toString();
951 } 954 }
952 955
953 } // namespace blink 956 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698