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

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

Issue 2858863002: Add macro to diff the groups (and their members) in ComputedStyleBase (Closed)
Patch Set: use results from diff functions generated in ComputedStyleBase.cpp in ComputedStyle.cpp 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
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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 if (box_data_.Get() != other.box_data_.Get()) { 572 if (box_data_.Get() != other.box_data_.Get()) {
573 if (box_data_->width_ != other.box_data_->width_ || 573 if (box_data_->width_ != other.box_data_->width_ ||
574 box_data_->min_width_ != other.box_data_->min_width_ || 574 box_data_->min_width_ != other.box_data_->min_width_ ||
575 box_data_->max_width_ != other.box_data_->max_width_ || 575 box_data_->max_width_ != other.box_data_->max_width_ ||
576 box_data_->height_ != other.box_data_->height_ || 576 box_data_->height_ != other.box_data_->height_ ||
577 box_data_->min_height_ != other.box_data_->min_height_ || 577 box_data_->min_height_ != other.box_data_->min_height_ ||
578 box_data_->max_height_ != other.box_data_->max_height_) 578 box_data_->max_height_ != other.box_data_->max_height_)
579 return true; 579 return true;
580 } 580 }
581 581
582 if (surround_data_.Get() != other.surround_data_.Get()) { 582 if (ComputedStyleBase::ScrollAnchorDisablingPropertyChanged(other, diff))
583 if (!MarginEqual(other) || !OffsetEqual(other) || !PaddingEqual(other)) 583 return true;
584 return true;
585 }
586 584
587 if (diff.TransformChanged()) 585 if (diff.TransformChanged())
588 return true; 586 return true;
589 587
590 return false; 588 return false;
591 } 589 }
592 590
593 bool ComputedStyle::DiffNeedsFullLayoutAndPaintInvalidation( 591 bool ComputedStyle::DiffNeedsFullLayoutAndPaintInvalidation(
594 const ComputedStyle& other) const { 592 const ComputedStyle& other) const {
595 // FIXME: Not all cases in this method need both full layout and paint 593 // FIXME: Not all cases in this method need both full layout and paint
596 // invalidation. 594 // invalidation.
597 // Should move cases into DiffNeedsFullLayout() if 595 // Should move cases into DiffNeedsFullLayout() if
598 // - don't need paint invalidation at all; 596 // - don't need paint invalidation at all;
599 // - or the layoutObject knows how to exactly invalidate paints caused by the 597 // - or the layoutObject knows how to exactly invalidate paints caused by the
600 // layout change instead of forced full paint invalidation. 598 // layout change instead of forced full paint invalidation.
601 599
602 if (surround_data_.Get() != other.surround_data_.Get()) { 600 if (surround_data_.Get() != other.surround_data_.Get()) {
603 // If our border widths change, then we need to layout. Other changes to 601 // If our border widths change, then we need to layout. Other changes to
604 // borders only necessitate a paint invalidation. 602 // borders only necessitate a paint invalidation.
605 if (BorderLeftWidth() != other.BorderLeftWidth() || 603 if (BorderLeftWidth() != other.BorderLeftWidth() ||
606 BorderTopWidth() != other.BorderTopWidth() || 604 BorderTopWidth() != other.BorderTopWidth() ||
607 BorderBottomWidth() != other.BorderBottomWidth() || 605 BorderBottomWidth() != other.BorderBottomWidth() ||
608 BorderRightWidth() != other.BorderRightWidth()) 606 BorderRightWidth() != other.BorderRightWidth())
609 return true; 607 return true;
608 }
610 609
611 if (!PaddingEqual(other)) 610 if (ComputedStyleBase::DiffNeedsFullLayoutAndPaintInvalidation(other))
612 return true; 611 return true;
613 }
614 612
615 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { 613 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) {
616 if (rare_non_inherited_data_->appearance_ != 614 if (rare_non_inherited_data_->appearance_ !=
617 other.rare_non_inherited_data_->appearance_ || 615 other.rare_non_inherited_data_->appearance_ ||
618 rare_non_inherited_data_->margin_before_collapse != 616 rare_non_inherited_data_->margin_before_collapse !=
619 other.rare_non_inherited_data_->margin_before_collapse || 617 other.rare_non_inherited_data_->margin_before_collapse ||
620 rare_non_inherited_data_->margin_after_collapse != 618 rare_non_inherited_data_->margin_after_collapse !=
621 other.rare_non_inherited_data_->margin_after_collapse || 619 other.rare_non_inherited_data_->margin_after_collapse ||
622 rare_non_inherited_data_->line_clamp != 620 rare_non_inherited_data_->line_clamp !=
623 other.rare_non_inherited_data_->line_clamp || 621 other.rare_non_inherited_data_->line_clamp ||
(...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after
2494 if (value < 0) 2492 if (value < 0)
2495 fvalue -= 0.5f; 2493 fvalue -= 0.5f;
2496 else 2494 else
2497 fvalue += 0.5f; 2495 fvalue += 0.5f;
2498 } 2496 }
2499 2497
2500 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); 2498 return RoundForImpreciseConversion<int>(fvalue / zoom_factor);
2501 } 2499 }
2502 2500
2503 } // namespace blink 2501 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698