Index: Source/core/css/resolver/StyleBuilderConverter.cpp |
diff --git a/Source/core/css/resolver/StyleBuilderConverter.cpp b/Source/core/css/resolver/StyleBuilderConverter.cpp |
index cd935a52559baae565c428bfc3efad42c49703ca..edefcb36ca5652fa61a29da9e92e6d05d24828ef 100644 |
--- a/Source/core/css/resolver/StyleBuilderConverter.cpp |
+++ b/Source/core/css/resolver/StyleBuilderConverter.cpp |
@@ -33,6 +33,7 @@ |
#include "core/css/CSSPrimitiveValueMappings.h" |
#include "core/css/CSSReflectValue.h" |
#include "core/css/CSSShadowValue.h" |
+#include "core/css/CSSValuePool.h" |
fs
2014/10/01 10:52:14
This include looks odd here - I don't see anything
|
#include "core/css/Pair.h" |
#include "core/css/Rect.h" |
#include "core/svg/SVGURIReference.h" |
@@ -611,6 +612,29 @@ PassRefPtr<SVGLength> StyleBuilderConverter::convertSVGLength(StyleResolverState |
return SVGLength::fromCSSPrimitiveValue(toCSSPrimitiveValue(value)); |
} |
+StyleNavigationValue StyleBuilderConverter::convertStyleNavigationValue(StyleResolverState&, CSSValue* value) |
+{ |
+ if (!value->isValueList()) |
Timothy Loh
2014/10/01 13:14:54
I like asserting that the value is what we expect
|
+ return RenderStyle::initialStyleNavigation(); |
+ |
+ CSSValueList* valueList = toCSSValueList(value); |
+ ASSERT(valueList->length() == 1 || valueList->length() == 2); |
Timothy Loh
2014/10/01 13:14:54
When is the length ever 1?
|
+ |
+ String idSelector = toCSSPrimitiveValue(valueList->item(0))->getStringValue(); |
+ if (idSelector.startsWith('#')) |
+ idSelector.remove(0); |
+ |
+ if (valueList->length() == 1) |
+ return StyleNavigationValue(idSelector); |
Timothy Loh
2014/10/01 13:14:54
As above; this seems unreachable to me.
|
+ |
+ CSSPrimitiveValue* targetValue = toCSSPrimitiveValue(valueList->item(1)); |
+ if (targetValue->isString()) |
+ return StyleNavigationValue(idSelector, targetValue->getStringValue()); |
+ |
+ const CSSValueID targetValueID = targetValue->getValueID(); |
+ return StyleNavigationValue(idSelector, targetValueID == CSSValueRoot ? Root : Current); |
+} |
+ |
float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, CSSValue* value) |
{ |
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |