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

Unified Diff: Source/core/css/CSSComputedStyleDeclaration.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: Applied code review suggestions. Also rebased. Created 6 years, 8 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/CSSComputedStyleDeclaration.cpp
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index 4bdd78dfc0bfc5574f20f7c6d4adf79491a23424..9ad21db35fd08064954877502348a838a24b0c57 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -4,6 +4,7 @@
* Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
* Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
* Copyright (C) 2011 Sencha, Inc. All rights reserved.
+ * Copyright (C) 2014 Opera Software ASA. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -152,6 +153,10 @@ static const CSSPropertyID staticComputableProperties[] = {
CSSPropertyMaxWidth,
CSSPropertyMinHeight,
CSSPropertyMinWidth,
+ CSSPropertyNavDown,
+ CSSPropertyNavLeft,
+ CSSPropertyNavRight,
+ CSSPropertyNavUp,
CSSPropertyMixBlendMode,
CSSPropertyObjectFit,
CSSPropertyObjectPosition,
@@ -1361,6 +1366,38 @@ static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const RenderSt
return list.release();
}
+static PassRefPtrWillBeRawPtr<CSSValue> valueForNavigationDirection(const RenderStyle& style, CSSPropertyID propertyID)
+{
+ StyleNavigationValue navValue;
+
+ switch (propertyID) {
+ case CSSPropertyNavUp:
+ navValue = style.navUp();
+ break;
+ case CSSPropertyNavDown:
+ navValue = style.navDown();
+ break;
+ case CSSPropertyNavLeft:
+ navValue = style.navLeft();
+ break;
+ case CSSPropertyNavRight:
+ navValue = style.navRight();
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+
+ if (navValue.isAuto())
+ return cssValuePool().createIdentifierValue(CSSValueAuto);
+
+ RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ list->append(cssValuePool().createValue(navValue.id(), CSSPrimitiveValue::CSS_STRING));
fs 2014/04/17 15:33:48 What does this end up serializing to?
Krzysztof Olczyk 2014/09/30 15:41:46 Right, it would have been converted to string with
+ list->append(cssValuePool().createValue(navValue.target(), CSSPrimitiveValue::CSS_STRING));
+
+ return list;
+}
+
static void logUnimplementedPropertyID(CSSPropertyID propertyID)
{
DEFINE_STATIC_LOCAL(HashSet<CSSPropertyID>, propertyIDSet, ());
@@ -2075,6 +2112,11 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
return zoomAdjustedPixelValueForLength(marginLeft, *style);
return zoomAdjustedPixelValue(toRenderBox(renderer)->marginLeft(), *style);
}
+ case CSSPropertyNavDown:
+ case CSSPropertyNavLeft:
+ case CSSPropertyNavRight:
+ case CSSPropertyNavUp:
+ return valueForNavigationDirection(*style, propertyID);
case CSSPropertyWebkitUserModify:
return cssValuePool().createValue(style->userModify());
case CSSPropertyMaxHeight: {

Powered by Google App Engine
This is Rietveld 408576698