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

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

Issue 144143005: Preserve shape-box order in non-computed values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updating patch to trunk Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/BasicShapeFunctions.cpp ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * 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 Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 return cssValuePool().createIdentifierValue(CSSValueBold); 1423 return cssValuePool().createIdentifierValue(CSSValueBold);
1424 case FontWeight800: 1424 case FontWeight800:
1425 return cssValuePool().createIdentifierValue(CSSValue800); 1425 return cssValuePool().createIdentifierValue(CSSValue800);
1426 case FontWeight900: 1426 case FontWeight900:
1427 return cssValuePool().createIdentifierValue(CSSValue900); 1427 return cssValuePool().createIdentifierValue(CSSValue900);
1428 } 1428 }
1429 ASSERT_NOT_REACHED(); 1429 ASSERT_NOT_REACHED();
1430 return cssValuePool().createIdentifierValue(CSSValueNormal); 1430 return cssValuePool().createIdentifierValue(CSSValueNormal);
1431 } 1431 }
1432 1432
1433 static PassRefPtrWillBeRawPtr<CSSValue> valueForShape(const RenderStyle& style, ShapeValue* shapeValue)
1434 {
1435 if (!shapeValue)
1436 return cssValuePool().createIdentifierValue(CSSValueNone);
1437 if (shapeValue->type() == ShapeValue::Outside)
1438 return cssValuePool().createIdentifierValue(CSSValueOutsideShape);
1439 if (shapeValue->type() == ShapeValue::Box)
1440 return cssValuePool().createValue(shapeValue->layoutBox());
1441 if (shapeValue->type() == ShapeValue::Image)
1442 return shapeValue->image() ? shapeValue->image()->cssValue() : cssValueP ool().createIdentifierValue(CSSValueNone);
1443
1444 ASSERT(shapeValue->type() == ShapeValue::Shape);
1445
1446 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
1447 list->append(valueForBasicShape(style, shapeValue->shape()));
1448 if (shapeValue->layoutBox() != BoxMissing)
1449 list->append(cssValuePool().createValue(shapeValue->layoutBox()));
1450 return list.release();
1451 }
1452
1433 static PassRefPtrWillBeRawPtr<CSSValue> touchActionFlagsToCSSValue(TouchAction t ouchAction) 1453 static PassRefPtrWillBeRawPtr<CSSValue> touchActionFlagsToCSSValue(TouchAction t ouchAction)
1434 { 1454 {
1435 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ; 1455 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ;
1436 if (touchAction == TouchActionAuto) 1456 if (touchAction == TouchActionAuto)
1437 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); 1457 list->append(cssValuePool().createIdentifierValue(CSSValueAuto));
1438 if (touchAction & TouchActionNone) { 1458 if (touchAction & TouchActionNone) {
1439 ASSERT(touchAction == TouchActionNone); 1459 ASSERT(touchAction == TouchActionNone);
1440 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); 1460 list->append(cssValuePool().createIdentifierValue(CSSValueNone));
1441 } 1461 }
1442 if (touchAction & TouchActionPanX) 1462 if (touchAction & TouchActionPanX)
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after
2610 return cssValuePool().createIdentifierValue(CSSValueNone); 2630 return cssValuePool().createIdentifierValue(CSSValueNone);
2611 case CSSPropertyWebkitWrapFlow: 2631 case CSSPropertyWebkitWrapFlow:
2612 return cssValuePool().createValue(style->wrapFlow()); 2632 return cssValuePool().createValue(style->wrapFlow());
2613 case CSSPropertyShapeMargin: 2633 case CSSPropertyShapeMargin:
2614 return cssValuePool().createValue(style->shapeMargin()); 2634 return cssValuePool().createValue(style->shapeMargin());
2615 case CSSPropertyShapePadding: 2635 case CSSPropertyShapePadding:
2616 return cssValuePool().createValue(style->shapePadding()); 2636 return cssValuePool().createValue(style->shapePadding());
2617 case CSSPropertyShapeImageThreshold: 2637 case CSSPropertyShapeImageThreshold:
2618 return cssValuePool().createValue(style->shapeImageThreshold(), CSSP rimitiveValue::CSS_NUMBER); 2638 return cssValuePool().createValue(style->shapeImageThreshold(), CSSP rimitiveValue::CSS_NUMBER);
2619 case CSSPropertyShapeInside: 2639 case CSSPropertyShapeInside:
2620 if (!style->shapeInside()) 2640 return valueForShape(*style, style->shapeInside());
2621 return cssValuePool().createIdentifierValue(CSSValueNone);
2622 if (style->shapeInside()->type() == ShapeValue::Box)
2623 return cssValuePool().createValue(style->shapeInside()->layoutBo x());
2624 if (style->shapeInside()->type() == ShapeValue::Outside)
2625 return cssValuePool().createIdentifierValue(CSSValueOutsideShape );
2626 if (style->shapeInside()->type() == ShapeValue::Image) {
2627 if (style->shapeInside()->image())
2628 return style->shapeInside()->image()->cssValue();
2629 return cssValuePool().createIdentifierValue(CSSValueNone);
2630 }
2631 ASSERT(style->shapeInside()->type() == ShapeValue::Shape);
2632 return valueForBasicShape(*style, style->shapeInside()->shape());
2633 case CSSPropertyShapeOutside: 2641 case CSSPropertyShapeOutside:
2634 if (!style->shapeOutside()) 2642 return valueForShape(*style, style->shapeOutside());
2635 return cssValuePool().createIdentifierValue(CSSValueNone);
2636 if (style->shapeOutside()->type() == ShapeValue::Box)
2637 return cssValuePool().createValue(style->shapeOutside()->layoutB ox());
2638 if (style->shapeOutside()->type() == ShapeValue::Image) {
2639 if (style->shapeOutside()->image())
2640 return style->shapeOutside()->image()->cssValue();
2641 return cssValuePool().createIdentifierValue(CSSValueNone);
2642 }
2643 ASSERT(style->shapeOutside()->type() == ShapeValue::Shape);
2644 return valueForBasicShape(*style, style->shapeOutside()->shape());
2645 case CSSPropertyWebkitWrapThrough: 2643 case CSSPropertyWebkitWrapThrough:
2646 return cssValuePool().createValue(style->wrapThrough()); 2644 return cssValuePool().createValue(style->wrapThrough());
2647 case CSSPropertyWebkitFilter: 2645 case CSSPropertyWebkitFilter:
2648 return valueForFilter(renderer, *style); 2646 return valueForFilter(renderer, *style);
2649 case CSSPropertyMixBlendMode: 2647 case CSSPropertyMixBlendMode:
2650 return cssValuePool().createValue(style->blendMode()); 2648 return cssValuePool().createValue(style->blendMode());
2651 2649
2652 case CSSPropertyBackgroundBlendMode: { 2650 case CSSPropertyBackgroundBlendMode: {
2653 const FillLayer* layers = style->backgroundLayers(); 2651 const FillLayer* layers = style->backgroundLayers();
2654 if (!layers->next()) 2652 if (!layers->next())
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
3034 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3032 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3035 CSSPropertyB ackgroundClip }; 3033 CSSPropertyB ackgroundClip };
3036 3034
3037 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated() ; 3035 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated() ;
3038 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3036 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3039 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3037 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3040 return list.release(); 3038 return list.release();
3041 } 3039 }
3042 3040
3043 } // namespace WebCore 3041 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/BasicShapeFunctions.cpp ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698