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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
4 * 5 *
5 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
9 * 10 *
10 * This library is distributed in the hope that it will be useful, 11 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 14 * Library General Public License for more details.
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 , m_grid(o.m_grid) 114 , m_grid(o.m_grid)
114 , m_gridItem(o.m_gridItem) 115 , m_gridItem(o.m_gridItem)
115 , m_content(o.m_content ? o.m_content->clone() : nullptr) 116 , m_content(o.m_content ? o.m_content->clone() : nullptr)
116 , m_counterDirectives(o.m_counterDirectives ? clone(*o.m_counterDirectives) : nullptr) 117 , m_counterDirectives(o.m_counterDirectives ? clone(*o.m_counterDirectives) : nullptr)
117 , m_boxShadow(o.m_boxShadow) 118 , m_boxShadow(o.m_boxShadow)
118 , m_boxReflect(o.m_boxReflect) 119 , m_boxReflect(o.m_boxReflect)
119 , m_animations(o.m_animations ? adoptPtrWillBeNoop(new CSSAnimationDataList( *o.m_animations)) : nullptr) 120 , m_animations(o.m_animations ? adoptPtrWillBeNoop(new CSSAnimationDataList( *o.m_animations)) : nullptr)
120 , m_transitions(o.m_transitions ? adoptPtrWillBeNoop(new CSSAnimationDataLis t(*o.m_transitions)) : nullptr) 121 , m_transitions(o.m_transitions ? adoptPtrWillBeNoop(new CSSAnimationDataLis t(*o.m_transitions)) : nullptr)
121 , m_mask(o.m_mask) 122 , m_mask(o.m_mask)
122 , m_maskBoxImage(o.m_maskBoxImage) 123 , m_maskBoxImage(o.m_maskBoxImage)
124 , m_navigation(o.m_navigation ? adoptPtr(new StyleNavigationData(*o.m_naviga tion)) : nullptr)
123 , m_pageSize(o.m_pageSize) 125 , m_pageSize(o.m_pageSize)
124 , m_shapeOutside(o.m_shapeOutside) 126 , m_shapeOutside(o.m_shapeOutside)
125 , m_shapeMargin(o.m_shapeMargin) 127 , m_shapeMargin(o.m_shapeMargin)
126 , m_shapeImageThreshold(o.m_shapeImageThreshold) 128 , m_shapeImageThreshold(o.m_shapeImageThreshold)
127 , m_clipPath(o.m_clipPath) 129 , m_clipPath(o.m_clipPath)
128 , m_textDecorationColor(o.m_textDecorationColor) 130 , m_textDecorationColor(o.m_textDecorationColor)
129 , m_visitedLinkTextDecorationColor(o.m_visitedLinkTextDecorationColor) 131 , m_visitedLinkTextDecorationColor(o.m_visitedLinkTextDecorationColor)
130 , m_visitedLinkBackgroundColor(o.m_visitedLinkBackgroundColor) 132 , m_visitedLinkBackgroundColor(o.m_visitedLinkBackgroundColor)
131 , m_visitedLinkOutlineColor(o.m_visitedLinkOutlineColor) 133 , m_visitedLinkOutlineColor(o.m_visitedLinkOutlineColor)
132 , m_visitedLinkBorderLeftColor(o.m_visitedLinkBorderLeftColor) 134 , m_visitedLinkBorderLeftColor(o.m_visitedLinkBorderLeftColor)
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 && m_willChange == o.m_willChange 198 && m_willChange == o.m_willChange
197 && m_filter == o.m_filter 199 && m_filter == o.m_filter
198 && m_grid == o.m_grid 200 && m_grid == o.m_grid
199 && m_gridItem == o.m_gridItem 201 && m_gridItem == o.m_gridItem
200 && contentDataEquivalent(o) 202 && contentDataEquivalent(o)
201 && counterDataEquivalent(o) 203 && counterDataEquivalent(o)
202 && shadowDataEquivalent(o) 204 && shadowDataEquivalent(o)
203 && reflectionDataEquivalent(o) 205 && reflectionDataEquivalent(o)
204 && animationDataEquivalent(o) 206 && animationDataEquivalent(o)
205 && transitionDataEquivalent(o) 207 && transitionDataEquivalent(o)
208 && navigationDataEquivalent(o)
206 && m_mask == o.m_mask 209 && m_mask == o.m_mask
207 && m_maskBoxImage == o.m_maskBoxImage 210 && m_maskBoxImage == o.m_maskBoxImage
208 && m_pageSize == o.m_pageSize 211 && m_pageSize == o.m_pageSize
209 && m_shapeOutside == o.m_shapeOutside 212 && m_shapeOutside == o.m_shapeOutside
210 && m_shapeMargin == o.m_shapeMargin 213 && m_shapeMargin == o.m_shapeMargin
211 && m_shapeImageThreshold == o.m_shapeImageThreshold 214 && m_shapeImageThreshold == o.m_shapeImageThreshold
212 && m_clipPath == o.m_clipPath 215 && m_clipPath == o.m_clipPath
213 && m_textDecorationColor == o.m_textDecorationColor 216 && m_textDecorationColor == o.m_textDecorationColor
214 && m_visitedLinkTextDecorationColor == o.m_visitedLinkTextDecorationColo r 217 && m_visitedLinkTextDecorationColor == o.m_visitedLinkTextDecorationColo r
215 && m_visitedLinkBackgroundColor == o.m_visitedLinkBackgroundColor 218 && m_visitedLinkBackgroundColor == o.m_visitedLinkBackgroundColor
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 ContentData* b = o.m_content.get(); 262 ContentData* b = o.m_content.get();
260 263
261 while (a && b && *a == *b) { 264 while (a && b && *a == *b) {
262 a = a->next(); 265 a = a->next();
263 b = b->next(); 266 b = b->next();
264 } 267 }
265 268
266 return !a && !b; 269 return !a && !b;
267 } 270 }
268 271
272 bool StyleRareNonInheritedData::navigationDataEquivalent(const StyleRareNonInher itedData& o) const
273 {
274 StyleNavigationData* a = m_navigation.get();
275 StyleNavigationData* b = o.m_navigation.get();
276
277 return a && b && *a == *b;
278 }
279
269 bool StyleRareNonInheritedData::counterDataEquivalent(const StyleRareNonInherite dData& o) const 280 bool StyleRareNonInheritedData::counterDataEquivalent(const StyleRareNonInherite dData& o) const
270 { 281 {
271 if (m_counterDirectives.get() == o.m_counterDirectives.get()) 282 if (m_counterDirectives.get() == o.m_counterDirectives.get())
272 return true; 283 return true;
273 284
274 if (m_counterDirectives && o.m_counterDirectives && *m_counterDirectives == *o.m_counterDirectives) 285 if (m_counterDirectives && o.m_counterDirectives && *m_counterDirectives == *o.m_counterDirectives)
275 return true; 286 return true;
276 287
277 return false; 288 return false;
278 } 289 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 if (m_transitions && o.m_transitions && (*m_transitions != *o.m_transitions) ) 323 if (m_transitions && o.m_transitions && (*m_transitions != *o.m_transitions) )
313 return false; 324 return false;
314 return true; 325 return true;
315 } 326 }
316 327
317 bool StyleRareNonInheritedData::hasFilters() const 328 bool StyleRareNonInheritedData::hasFilters() const
318 { 329 {
319 return m_filter.get() && !m_filter->m_operations.isEmpty(); 330 return m_filter.get() && !m_filter->m_operations.isEmpty();
320 } 331 }
321 332
333 void StyleRareNonInheritedData::setNavigation(StyleNavigationData::NavigationDir ection direction, const StyleNavigationValue& value)
334 {
335 if (!m_navigation)
336 m_navigation = adoptPtr(new StyleNavigationData());
337
338 m_navigation->setProperty(direction, value);
339 }
340
341 StyleNavigationValue StyleRareNonInheritedData::navDown() const
342 {
343 if (!m_navigation)
344 return StyleNavigationValue();
345 return m_navigation->down();
346 }
347
348 StyleNavigationValue StyleRareNonInheritedData::navLeft() const
349 {
350 if (!m_navigation)
351 return StyleNavigationValue();
352 return m_navigation->left();
353 }
354
355 StyleNavigationValue StyleRareNonInheritedData::navRight() const
356 {
357 if (!m_navigation)
358 return StyleNavigationValue();
359 return m_navigation->right();
360 }
361
362 StyleNavigationValue StyleRareNonInheritedData::navUp() const
363 {
364 if (!m_navigation)
365 return StyleNavigationValue();
366 return m_navigation->up();
367 }
368
369 void StyleRareNonInheritedData::setNavDown(const StyleNavigationValue& value)
370 {
371 setNavigation(StyleNavigationData::NavigationDown, value);
372 }
373
374 void StyleRareNonInheritedData::setNavLeft(const StyleNavigationValue& value)
375 {
376 setNavigation(StyleNavigationData::NavigationLeft, value);
377 }
378
379 void StyleRareNonInheritedData::setNavRight(const StyleNavigationValue& value)
380 {
381 setNavigation(StyleNavigationData::NavigationRight, value);
382 }
383
384 void StyleRareNonInheritedData::setNavUp(const StyleNavigationValue& value)
385 {
386 setNavigation(StyleNavigationData::NavigationUp, value);
387 }
388
322 } // namespace WebCore 389 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698