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

Unified Diff: Source/core/rendering/style/StyleNavigationData.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: Review fixes, rebase, added more tests, made Style Navigation Data refcounted. 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/rendering/style/StyleNavigationData.cpp
diff --git a/Source/core/rendering/style/StyleNavigationData.cpp b/Source/core/rendering/style/StyleNavigationData.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..78fb2e5c18d5b223d9c1c1ca8b83c177e955c890
--- /dev/null
+++ b/Source/core/rendering/style/StyleNavigationData.cpp
@@ -0,0 +1,61 @@
+/*
+ * 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 Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+
+#include "core/rendering/style/StyleNavigationData.h"
+
+#include "wtf/Assertions.h"
+
+namespace blink {
+
+StyleNavigationData::StyleNavigationData()
+{
+}
+
+StyleNavigationData::StyleNavigationData(const StyleNavigationData &o)
+ : m_up(o.m_up)
+ , m_down(o.m_down)
+ , m_left(o.m_left)
+ , m_right(o.m_right)
+{
+}
+
+void StyleNavigationData::setProperty(StyleNavigationData::NavigationDirection direction, const StyleNavigationValue& value)
+{
+ switch (direction) {
+ case NavigationDown:
+ setDown(value);
+ return;
+ case NavigationLeft:
+ setLeft(value);
+ return;
+ case NavigationRight:
+ setRight(value);
+ return;
+ case NavigationUp:
+ setUp(value);
+ return;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698