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

Unified Diff: Source/core/rendering/style/StyleRareNonInheritedData.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/StyleRareNonInheritedData.cpp
diff --git a/Source/core/rendering/style/StyleRareNonInheritedData.cpp b/Source/core/rendering/style/StyleRareNonInheritedData.cpp
index 57c810a017477e440462ba1bf3e15398238d1c43..12e2fe8702ad5d509563bfe6f4436f9310d7d7f8 100644
--- a/Source/core/rendering/style/StyleRareNonInheritedData.cpp
+++ b/Source/core/rendering/style/StyleRareNonInheritedData.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
* Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple 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 Library General Public
@@ -126,6 +127,7 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
, m_transitions(o.m_transitions ? CSSTransitionData::create(*o.m_transitions) : nullptr)
, m_mask(o.m_mask)
, m_maskBoxImage(o.m_maskBoxImage)
+ , m_navigation(o.m_navigation)
, m_pageSize(o.m_pageSize)
, m_shapeOutside(o.m_shapeOutside)
, m_shapeMargin(o.m_shapeMargin)
@@ -214,6 +216,7 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
&& reflectionDataEquivalent(o)
&& animationDataEquivalent(o)
&& transitionDataEquivalent(o)
+ && m_navigation == o.m_navigation
&& m_mask == o.m_mask
&& m_maskBoxImage == o.m_maskBoxImage
&& m_pageSize == o.m_pageSize
@@ -320,4 +323,60 @@ bool StyleRareNonInheritedData::hasFilters() const
return m_filter.get() && !m_filter->m_operations.isEmpty();
}
+void StyleRareNonInheritedData::setNavigation(StyleNavigationData::NavigationDirection direction, const StyleNavigationValue& value)
+{
+ if (!m_navigation.get())
+ m_navigation.init();
+
+ m_navigation.access()->setProperty(direction, value);
+}
+
+StyleNavigationValue StyleRareNonInheritedData::navDown() const
+{
+ if (!m_navigation.get())
+ return StyleNavigationValue();
+ return m_navigation->down();
+}
+
+StyleNavigationValue StyleRareNonInheritedData::navLeft() const
+{
+ if (!m_navigation.get())
+ return StyleNavigationValue();
+ return m_navigation->left();
+}
+
+StyleNavigationValue StyleRareNonInheritedData::navRight() const
+{
+ if (!m_navigation.get())
+ return StyleNavigationValue();
+ return m_navigation->right();
+}
+
+StyleNavigationValue StyleRareNonInheritedData::navUp() const
+{
+ if (!m_navigation.get())
+ return StyleNavigationValue();
+ return m_navigation->up();
+}
+
+void StyleRareNonInheritedData::setNavDown(const StyleNavigationValue& value)
+{
+ setNavigation(StyleNavigationData::NavigationDown, value);
+}
+
+void StyleRareNonInheritedData::setNavLeft(const StyleNavigationValue& value)
+{
+ setNavigation(StyleNavigationData::NavigationLeft, value);
+}
+
+void StyleRareNonInheritedData::setNavRight(const StyleNavigationValue& value)
+{
+ setNavigation(StyleNavigationData::NavigationRight, value);
+}
+
+void StyleRareNonInheritedData::setNavUp(const StyleNavigationValue& value)
+{
+ setNavigation(StyleNavigationData::NavigationUp, value);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698