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

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

Issue 1226123008: CSSValue Immediates: Replace CSSPrimitiveValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_4_attempt_2
Patch Set: Rebase Created 5 years, 4 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
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | Source/core/css/StylePropertySet.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 * (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 r ights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
5 * Copyright (C) 2013 Intel Corporation. All rights reserved. 5 * Copyright (C) 2013 Intel Corporation. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 || shorthand.properties()[propertyIndex + 1] == CSSPropertyW ebkitMaskRepeatY); 651 || shorthand.properties()[propertyIndex + 1] == CSSPropertyW ebkitMaskRepeatY);
652 NullableCSSValue yValue = values[propertyIndex + 1]->isValueList () ? 652 NullableCSSValue yValue = values[propertyIndex + 1]->isValueList () ?
653 toCSSValueList(values[propertyIndex + 1])->item(layer) : val ues[propertyIndex + 1]; 653 toCSSValueList(values[propertyIndex + 1])->item(layer) : val ues[propertyIndex + 1];
654 654
655 655
656 // FIXME: At some point we need to fix this code to avoid return ing an invalid shorthand, 656 // FIXME: At some point we need to fix this code to avoid return ing an invalid shorthand,
657 // since some longhand combinations are not serializable into a single shorthand. 657 // since some longhand combinations are not serializable into a single shorthand.
658 if (!value->isPrimitiveValue() || !yValue->isPrimitiveValue()) 658 if (!value->isPrimitiveValue() || !yValue->isPrimitiveValue())
659 continue; 659 continue;
660 660
661 CSSValueID xId = toCSSPrimitiveValue(*value).getValueID(); 661 CSSValueID xId = toCSSPrimitiveValue(value).getValueID();
662 CSSValueID yId = toCSSPrimitiveValue(*yValue).getValueID(); 662 CSSValueID yId = toCSSPrimitiveValue(yValue).getValueID();
663 // Maybe advance propertyIndex to look at the next CSSValue in t he list for the checks below. 663 // Maybe advance propertyIndex to look at the next CSSValue in t he list for the checks below.
664 if (xId == yId) { 664 if (xId == yId) {
665 useSingleWordShorthand = true; 665 useSingleWordShorthand = true;
666 property = shorthand.properties()[++propertyIndex]; 666 property = shorthand.properties()[++propertyIndex];
667 } else if (xId == CSSValueRepeat && yId == CSSValueNoRepeat) { 667 } else if (xId == CSSValueRepeat && yId == CSSValueNoRepeat) {
668 useRepeatXShorthand = true; 668 useRepeatXShorthand = true;
669 property = shorthand.properties()[++propertyIndex]; 669 property = shorthand.properties()[++propertyIndex];
670 } else if (xId == CSSValueNoRepeat && yId == CSSValueRepeat) { 670 } else if (xId == CSSValueNoRepeat && yId == CSSValueRepeat) {
671 useRepeatYShorthand = true; 671 useRepeatYShorthand = true;
672 property = shorthand.properties()[++propertyIndex]; 672 property = shorthand.properties()[++propertyIndex];
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 isInitialValue = false; 961 isInitialValue = false;
962 if (!value->isInheritedValue()) 962 if (!value->isInheritedValue())
963 isInheritedValue = false; 963 isInheritedValue = false;
964 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie s()[i])) 964 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie s()[i]))
965 return false; 965 return false;
966 } 966 }
967 return isInitialValue || isInheritedValue; 967 return isInitialValue || isInheritedValue;
968 } 968 }
969 969
970 } 970 }
OLDNEW
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | Source/core/css/StylePropertySet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698