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

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

Issue 1215503009: Remove an instance of isPropertyImplicit from StylePropertySerializer.cpp. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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 | « LayoutTests/fast/multicol/columns-shorthand-parsing-2-expected.txt ('k') | no next file » | 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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 return commonValue->cssText(); 725 return commonValue->cssText();
726 726
727 return result.toString(); 727 return result.toString();
728 } 728 }
729 729
730 String StylePropertySerializer::getShorthandValue(const StylePropertyShorthand& shorthand, String separator) const 730 String StylePropertySerializer::getShorthandValue(const StylePropertyShorthand& shorthand, String separator) const
731 { 731 {
732 String commonValue; 732 String commonValue;
733 StringBuilder result; 733 StringBuilder result;
734 for (unsigned i = 0; i < shorthand.length(); ++i) { 734 for (unsigned i = 0; i < shorthand.length(); ++i) {
735 if (!m_propertySet.isPropertyImplicit(shorthand.properties()[i])) { 735 const CSSValue* value = m_propertySet.getPropertyCSSValue(shorthand.prop erties()[i]);
736 const CSSValue* value = m_propertySet.getPropertyCSSValue(shorthand. properties()[i]); 736 if (!value)
737 if (!value) 737 return String();
738 return String(); 738 String valueText = value->cssText();
739 String valueText = value->cssText(); 739 if (!i)
740 if (!i) 740 commonValue = valueText;
741 commonValue = valueText; 741 else if (!commonValue.isNull() && commonValue != valueText)
742 else if (!commonValue.isNull() && commonValue != valueText)
743 commonValue = String();
744 if (value->isInitialValue())
745 continue;
746 if (!result.isEmpty())
747 result.append(separator);
748 result.append(valueText);
749 } else
750 commonValue = String(); 742 commonValue = String();
743 if (value->isInitialValue())
744 continue;
745 if (!result.isEmpty())
746 result.append(separator);
747 result.append(valueText);
751 } 748 }
752 if (isInitialOrInherit(commonValue)) 749 if (isInitialOrInherit(commonValue))
753 return commonValue; 750 return commonValue;
754 if (result.isEmpty())
755 return String();
756 return result.toString(); 751 return result.toString();
757 } 752 }
758 753
759 // only returns a non-null value if all properties have the same, non-null value 754 // only returns a non-null value if all properties have the same, non-null value
760 String StylePropertySerializer::getCommonValue(const StylePropertyShorthand& sho rthand) const 755 String StylePropertySerializer::getCommonValue(const StylePropertyShorthand& sho rthand) const
761 { 756 {
762 String res; 757 String res;
763 bool lastPropertyWasImportant = false; 758 bool lastPropertyWasImportant = false;
764 for (unsigned i = 0; i < shorthand.length(); ++i) { 759 for (unsigned i = 0; i < shorthand.length(); ++i) {
765 const CSSValue* value = m_propertySet.getPropertyCSSValue(shorthand.prop erties()[i]); 760 const CSSValue* value = m_propertySet.getPropertyCSSValue(shorthand.prop erties()[i]);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 isInitialValue = false; 964 isInitialValue = false;
970 if (!value->isInheritedValue()) 965 if (!value->isInheritedValue())
971 isInheritedValue = false; 966 isInheritedValue = false;
972 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie s()[i])) 967 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie s()[i]))
973 return false; 968 return false;
974 } 969 }
975 return isInitialValue || isInheritedValue; 970 return isInitialValue || isInheritedValue;
976 } 971 }
977 972
978 } 973 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/columns-shorthand-parsing-2-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698