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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2879123002: Add generated InheritedDataShared in ComputedStyleBase. (Closed)
Patch Set: Rebase Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2009, 2010 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 468
469 bool ComputedStyle::NonInheritedEqual(const ComputedStyle& other) const { 469 bool ComputedStyle::NonInheritedEqual(const ComputedStyle& other) const {
470 // compare everything except the pseudoStyle pointer 470 // compare everything except the pseudoStyle pointer
471 return ComputedStyleBase::NonInheritedEqual(other) && 471 return ComputedStyleBase::NonInheritedEqual(other) &&
472 rare_non_inherited_data_ == other.rare_non_inherited_data_ && 472 rare_non_inherited_data_ == other.rare_non_inherited_data_ &&
473 svg_style_->NonInheritedEqual(*other.svg_style_); 473 svg_style_->NonInheritedEqual(*other.svg_style_);
474 } 474 }
475 475
476 bool ComputedStyle::InheritedDataShared(const ComputedStyle& other) const { 476 bool ComputedStyle::InheritedDataShared(const ComputedStyle& other) const {
477 // This is a fast check that only looks if the data structures are shared. 477 // This is a fast check that only looks if the data structures are shared.
478 // TODO(sashab): Should ComputedStyleBase have an inheritedDataShared method? 478 return ComputedStyleBase::InheritedDataShared(other) &&
479 return ComputedStyleBase::InheritedEqual(other) &&
480 inherited_data_.Get() == other.inherited_data_.Get() && 479 inherited_data_.Get() == other.inherited_data_.Get() &&
481 svg_style_.Get() == other.svg_style_.Get() && 480 svg_style_.Get() == other.svg_style_.Get() &&
482 rare_inherited_data_.Get() == other.rare_inherited_data_.Get(); 481 rare_inherited_data_.Get() == other.rare_inherited_data_.Get();
483 } 482 }
484 483
485 static bool DependenceOnContentHeightHasChanged(const ComputedStyle& a, 484 static bool DependenceOnContentHeightHasChanged(const ComputedStyle& a,
486 const ComputedStyle& b) { 485 const ComputedStyle& b) {
487 // If top or bottom become auto/non-auto then it means we either have to solve 486 // If top or bottom become auto/non-auto then it means we either have to solve
488 // height based on the content or stop doing so 487 // height based on the content or stop doing so
489 // (http://www.w3.org/TR/CSS2/visudet.html#abs-non-replaced-height) 488 // (http://www.w3.org/TR/CSS2/visudet.html#abs-non-replaced-height)
(...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after
2504 if (value < 0) 2503 if (value < 0)
2505 fvalue -= 0.5f; 2504 fvalue -= 0.5f;
2506 else 2505 else
2507 fvalue += 0.5f; 2506 fvalue += 0.5f;
2508 } 2507 }
2509 2508
2510 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); 2509 return RoundForImpreciseConversion<int>(fvalue / zoom_factor);
2511 } 2510 }
2512 2511
2513 } // namespace blink 2512 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698