Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp |
| diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp |
| index 0597e24793a61ef3e690f80333d49b759555ce0d..1bfffb6022a6c256dcd3b75700c283895d5e0027 100644 |
| --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp |
| +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp |
| @@ -974,4 +974,27 @@ PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat |
| return nullptr; |
| } |
| +StyleNavigationValue StyleBuilderConverter::convertStyleNavigationValue(StyleResolverState&, const CSSValue& value) |
| +{ |
| + if (!value.isValueList()) |
| + return ComputedStyle::initialStyleNavigation(); |
| + |
| + const CSSValueList& list = toCSSValueList(value); |
| + ASSERT(list->length() == 1 || list->length() == 2); |
|
fs
2016/05/18 15:55:05
list.length()
|
| + |
| + ASSERT(value.isStringValue()); |
|
fs
2016/05/18 15:55:05
|value| will be a CSSValueList here, so you probab
|
| + String idSelector = toCSSStringValue(list.item(0))->value(); |
| + if (idSelector.startsWith('#')) |
|
fs
2016/05/18 15:55:05
The CSS parser should be providing a canonical eno
|
| + idSelector.remove(0); |
| + |
| + if (list.length() == 1) |
| + return StyleNavigationValue(idSelector); |
| + |
| + if (value.isStringValue()) |
|
fs
2016/05/18 15:55:05
Like above, presumably this should be list.item(1)
|
| + return StyleNavigationValue(idSelector, toCSSStringValue(list.item(1))->value()); |
| + |
| + 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).
|
| + return StyleNavigationValue(idSelector, toCSSPrimitiveValue(list.item(1))->getValueID() == CSSValueRoot ? Root : Current); |
| +} |
| + |
| } // namespace blink |