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

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: 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 ComputedStyleBase::ScrollAnchorDisablingPropertyChanged(other, diff);
583 if (!MarginEqual(other) || !OffsetEqual(other) || !PaddingEqual(other))
584 return true;
585 }
586 583
587 if (diff.TransformChanged()) 584 if (diff.TransformChanged())
588 return true; 585 return true;
589 586
590 return false; 587 return false;
591 } 588 }
592 589
593 bool ComputedStyle::DiffNeedsFullLayoutAndPaintInvalidation( 590 bool ComputedStyle::DiffNeedsFullLayoutAndPaintInvalidation(
594 const ComputedStyle& other) const { 591 const ComputedStyle& other) const {
595 // FIXME: Not all cases in this method need both full layout and paint 592 // FIXME: Not all cases in this method need both full layout and paint
596 // invalidation. 593 // invalidation.
597 // Should move cases into DiffNeedsFullLayout() if 594 // Should move cases into DiffNeedsFullLayout() if
598 // - don't need paint invalidation at all; 595 // - don't need paint invalidation at all;
599 // - or the layoutObject knows how to exactly invalidate paints caused by the 596 // - or the layoutObject knows how to exactly invalidate paints caused by the
600 // layout change instead of forced full paint invalidation. 597 // layout change instead of forced full paint invalidation.
601 598
602 if (surround_data_.Get() != other.surround_data_.Get()) { 599 if (surround_data_.Get() != other.surround_data_.Get()) {
603 // If our border widths change, then we need to layout. Other changes to 600 // If our border widths change, then we need to layout. Other changes to
604 // borders only necessitate a paint invalidation. 601 // borders only necessitate a paint invalidation.
605 if (BorderLeftWidth() != other.BorderLeftWidth() || 602 if (BorderLeftWidth() != other.BorderLeftWidth() ||
606 BorderTopWidth() != other.BorderTopWidth() || 603 BorderTopWidth() != other.BorderTopWidth() ||
607 BorderBottomWidth() != other.BorderBottomWidth() || 604 BorderBottomWidth() != other.BorderBottomWidth() ||
608 BorderRightWidth() != other.BorderRightWidth()) 605 BorderRightWidth() != other.BorderRightWidth())
609 return true; 606 return true;
607 }
610 608
611 if (!PaddingEqual(other)) 609 ComputedStyleBase::DiffNeedsFullLayoutAndPaintInvalidation(other);
shend 2017/05/03 05:18:12 Note that this generates an extra if check on the
nainar 2017/05/03 06:49:57 Yup.
612 return true;
613 }
614 610
615 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { 611 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) {
616 if (rare_non_inherited_data_->appearance_ != 612 if (rare_non_inherited_data_->appearance_ !=
617 other.rare_non_inherited_data_->appearance_ || 613 other.rare_non_inherited_data_->appearance_ ||
618 rare_non_inherited_data_->margin_before_collapse != 614 rare_non_inherited_data_->margin_before_collapse !=
619 other.rare_non_inherited_data_->margin_before_collapse || 615 other.rare_non_inherited_data_->margin_before_collapse ||
620 rare_non_inherited_data_->margin_after_collapse != 616 rare_non_inherited_data_->margin_after_collapse !=
621 other.rare_non_inherited_data_->margin_after_collapse || 617 other.rare_non_inherited_data_->margin_after_collapse ||
622 rare_non_inherited_data_->line_clamp != 618 rare_non_inherited_data_->line_clamp !=
623 other.rare_non_inherited_data_->line_clamp || 619 other.rare_non_inherited_data_->line_clamp ||
(...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after
2494 if (value < 0) 2490 if (value < 0)
2495 fvalue -= 0.5f; 2491 fvalue -= 0.5f;
2496 else 2492 else
2497 fvalue += 0.5f; 2493 fvalue += 0.5f;
2498 } 2494 }
2499 2495
2500 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); 2496 return RoundForImpreciseConversion<int>(fvalue / zoom_factor);
2501 } 2497 }
2502 2498
2503 } // namespace blink 2499 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698