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

Unified Diff: Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 17450016: Implementation of CSS3 nav-up/down/left/right properties from CSS3 UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed compilation error in mac and crash in linux/window that were reported by trybots. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698