OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * * Redistributions of source code must retain the above copyright | 4 * * Redistributions of source code must retain the above copyright |
5 * notice, this list of conditions and the following disclaimer. | 5 * notice, this list of conditions and the following disclaimer. |
6 * * Redistributions in binary form must reproduce the above | 6 * * Redistributions in binary form must reproduce the above |
7 * copyright notice, this list of conditions and the following disclaimer | 7 * copyright notice, this list of conditions and the following disclaimer |
8 * in the documentation and/or other materials provided with the | 8 * in the documentation and/or other materials provided with the |
9 * distribution. | 9 * distribution. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
967 } | 967 } |
968 | 968 |
969 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat e& state, const CSSValue& value) | 969 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat e& state, const CSSValue& value) |
970 { | 970 { |
971 if (value.isPathValue()) | 971 if (value.isPathValue()) |
972 return toCSSPathValue(value).stylePath(); | 972 return toCSSPathValue(value).stylePath(); |
973 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone); | 973 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone); |
974 return nullptr; | 974 return nullptr; |
975 } | 975 } |
976 | 976 |
977 StyleNavigationValue StyleBuilderConverter::convertStyleNavigationValue(StyleRes olverState&, const CSSValue& value) | |
978 { | |
979 if (!value.isValueList()) | |
980 return ComputedStyle::initialStyleNavigation(); | |
981 | |
982 const CSSValueList& list = toCSSValueList(value); | |
983 ASSERT(list->length() == 1 || list->length() == 2); | |
fs
2016/05/18 15:55:05
list.length()
| |
984 | |
985 ASSERT(value.isStringValue()); | |
fs
2016/05/18 15:55:05
|value| will be a CSSValueList here, so you probab
| |
986 String idSelector = toCSSStringValue(list.item(0))->value(); | |
987 if (idSelector.startsWith('#')) | |
fs
2016/05/18 15:55:05
The CSS parser should be providing a canonical eno
| |
988 idSelector.remove(0); | |
989 | |
990 if (list.length() == 1) | |
991 return StyleNavigationValue(idSelector); | |
992 | |
993 if (value.isStringValue()) | |
fs
2016/05/18 15:55:05
Like above, presumably this should be list.item(1)
| |
994 return StyleNavigationValue(idSelector, toCSSStringValue(list.item(1))-> value()); | |
995 | |
996 ASSERT(value.isPrimitiveValue() && (toCSSPrimitiveValue(value).getValueID() == CSSValueRoot || toCSSPrimitiveValue(value).getValueID() == CSSValueCurrent)); | |
fs
2016/05/18 15:55:05
Again, |value| is still the parameter (the list).
| |
997 return StyleNavigationValue(idSelector, toCSSPrimitiveValue(list.item(1))->g etValueID() == CSSValueRoot ? Root : Current); | |
998 } | |
999 | |
977 } // namespace blink | 1000 } // namespace blink |
OLD | NEW |