OLD | NEW |
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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 if (box_->Width() != other.box_->Width() || | 582 if (box_->Width() != other.box_->Width() || |
583 box_->MinWidth() != other.box_->MinWidth() || | 583 box_->MinWidth() != other.box_->MinWidth() || |
584 box_->MaxWidth() != other.box_->MaxWidth() || | 584 box_->MaxWidth() != other.box_->MaxWidth() || |
585 box_->Height() != other.box_->Height() || | 585 box_->Height() != other.box_->Height() || |
586 box_->MinHeight() != other.box_->MinHeight() || | 586 box_->MinHeight() != other.box_->MinHeight() || |
587 box_->MaxHeight() != other.box_->MaxHeight()) | 587 box_->MaxHeight() != other.box_->MaxHeight()) |
588 return true; | 588 return true; |
589 } | 589 } |
590 | 590 |
591 if (surround_.Get() != other.surround_.Get()) { | 591 if (surround_.Get() != other.surround_.Get()) { |
592 if (!MarginEqual(other) || !OffsetEqual(other) || | 592 if (!MarginEqual(other) || !OffsetEqual(other) || !PaddingEqual(other)) |
593 Padding() != other.Padding()) | |
594 return true; | 593 return true; |
595 } | 594 } |
596 | 595 |
597 if (diff.TransformChanged()) | 596 if (diff.TransformChanged()) |
598 return true; | 597 return true; |
599 | 598 |
600 return false; | 599 return false; |
601 } | 600 } |
602 | 601 |
603 bool ComputedStyle::DiffNeedsFullLayoutAndPaintInvalidation( | 602 bool ComputedStyle::DiffNeedsFullLayoutAndPaintInvalidation( |
604 const ComputedStyle& other) const { | 603 const ComputedStyle& other) const { |
605 // FIXME: Not all cases in this method need both full layout and paint | 604 // FIXME: Not all cases in this method need both full layout and paint |
606 // invalidation. | 605 // invalidation. |
607 // Should move cases into DiffNeedsFullLayout() if | 606 // Should move cases into DiffNeedsFullLayout() if |
608 // - don't need paint invalidation at all; | 607 // - don't need paint invalidation at all; |
609 // - or the layoutObject knows how to exactly invalidate paints caused by the | 608 // - or the layoutObject knows how to exactly invalidate paints caused by the |
610 // layout change instead of forced full paint invalidation. | 609 // layout change instead of forced full paint invalidation. |
611 | 610 |
612 if (surround_.Get() != other.surround_.Get()) { | 611 if (surround_.Get() != other.surround_.Get()) { |
613 // If our border widths change, then we need to layout. Other changes to | 612 // If our border widths change, then we need to layout. Other changes to |
614 // borders only necessitate a paint invalidation. | 613 // borders only necessitate a paint invalidation. |
615 if (BorderLeftWidth() != other.BorderLeftWidth() || | 614 if (BorderLeftWidth() != other.BorderLeftWidth() || |
616 BorderTopWidth() != other.BorderTopWidth() || | 615 BorderTopWidth() != other.BorderTopWidth() || |
617 BorderBottomWidth() != other.BorderBottomWidth() || | 616 BorderBottomWidth() != other.BorderBottomWidth() || |
618 BorderRightWidth() != other.BorderRightWidth()) | 617 BorderRightWidth() != other.BorderRightWidth()) |
619 return true; | 618 return true; |
620 | 619 |
621 if (Padding() != other.Padding()) | 620 if (!PaddingEqual(other)) |
622 return true; | 621 return true; |
623 } | 622 } |
624 | 623 |
625 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { | 624 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { |
626 if (rare_non_inherited_data_->appearance_ != | 625 if (rare_non_inherited_data_->appearance_ != |
627 other.rare_non_inherited_data_->appearance_ || | 626 other.rare_non_inherited_data_->appearance_ || |
628 rare_non_inherited_data_->margin_before_collapse != | 627 rare_non_inherited_data_->margin_before_collapse != |
629 other.rare_non_inherited_data_->margin_before_collapse || | 628 other.rare_non_inherited_data_->margin_before_collapse || |
630 rare_non_inherited_data_->margin_after_collapse != | 629 rare_non_inherited_data_->margin_after_collapse != |
631 other.rare_non_inherited_data_->margin_after_collapse || | 630 other.rare_non_inherited_data_->margin_after_collapse || |
(...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |