| 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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // FIXME: Not all cases in this method need both full layout and paint | 589 // FIXME: Not all cases in this method need both full layout and paint |
| 590 // invalidation. | 590 // invalidation. |
| 591 // Should move cases into DiffNeedsFullLayout() if | 591 // Should move cases into DiffNeedsFullLayout() if |
| 592 // - don't need paint invalidation at all; | 592 // - don't need paint invalidation at all; |
| 593 // - or the layoutObject knows how to exactly invalidate paints caused by the | 593 // - or the layoutObject knows how to exactly invalidate paints caused by the |
| 594 // layout change instead of forced full paint invalidation. | 594 // layout change instead of forced full paint invalidation. |
| 595 | 595 |
| 596 if (surround_data_.Get() != other.surround_data_.Get()) { | 596 if (surround_data_.Get() != other.surround_data_.Get()) { |
| 597 // If our border widths change, then we need to layout. Other changes to | 597 // If our border widths change, then we need to layout. Other changes to |
| 598 // borders only necessitate a paint invalidation. | 598 // borders only necessitate a paint invalidation. |
| 599 if (BorderLeftWidth() != other.BorderLeftWidth() || | 599 if (!(BorderWidthEquals(BorderLeftWidth(), other.BorderLeftWidth())) || |
| 600 BorderTopWidth() != other.BorderTopWidth() || | 600 !(BorderWidthEquals(BorderTopWidth(), other.BorderTopWidth())) || |
| 601 BorderBottomWidth() != other.BorderBottomWidth() || | 601 !(BorderWidthEquals(BorderBottomWidth(), other.BorderBottomWidth())) || |
| 602 BorderRightWidth() != other.BorderRightWidth()) | 602 !(BorderWidthEquals(BorderRightWidth(), other.BorderRightWidth()))) |
| 603 return true; | 603 return true; |
| 604 } | 604 } |
| 605 | 605 |
| 606 if (ComputedStyleBase::DiffNeedsFullLayoutAndPaintInvalidation(other)) | 606 if (ComputedStyleBase::DiffNeedsFullLayoutAndPaintInvalidation(other)) |
| 607 return true; | 607 return true; |
| 608 | 608 |
| 609 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { | 609 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { |
| 610 if (rare_non_inherited_data_->appearance_ != | 610 if (rare_non_inherited_data_->appearance_ != |
| 611 other.rare_non_inherited_data_->appearance_ || | 611 other.rare_non_inherited_data_->appearance_ || |
| 612 rare_non_inherited_data_->margin_before_collapse != | 612 rare_non_inherited_data_->margin_before_collapse != |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 | 883 |
| 884 return false; | 884 return false; |
| 885 } | 885 } |
| 886 | 886 |
| 887 bool ComputedStyle::DiffNeedsPaintInvalidationObject( | 887 bool ComputedStyle::DiffNeedsPaintInvalidationObject( |
| 888 const ComputedStyle& other) const { | 888 const ComputedStyle& other) const { |
| 889 if (Visibility() != other.Visibility() || | 889 if (Visibility() != other.Visibility() || |
| 890 PrintColorAdjust() != other.PrintColorAdjust() || | 890 PrintColorAdjust() != other.PrintColorAdjust() || |
| 891 InsideLink() != other.InsideLink() || | 891 InsideLink() != other.InsideLink() || |
| 892 !Border().VisuallyEqual(other.Border()) || !RadiiEqual(other) || | 892 !Border().VisuallyEqual(other.Border()) || !RadiiEqual(other) || |
| 893 *background_data_ != *other.background_data_) | 893 !BorderSizeEquals(other) || *background_data_ != *other.background_data_) |
| 894 return true; | 894 return true; |
| 895 | 895 |
| 896 if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get()) { | 896 if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get()) { |
| 897 if (rare_inherited_data_->user_modify != | 897 if (rare_inherited_data_->user_modify != |
| 898 other.rare_inherited_data_->user_modify || | 898 other.rare_inherited_data_->user_modify || |
| 899 rare_inherited_data_->user_select != | 899 rare_inherited_data_->user_select != |
| 900 other.rare_inherited_data_->user_select || | 900 other.rare_inherited_data_->user_select || |
| 901 rare_inherited_data_->image_rendering_ != | 901 rare_inherited_data_->image_rendering_ != |
| 902 other.rare_inherited_data_->image_rendering_) | 902 other.rare_inherited_data_->image_rendering_) |
| 903 return true; | 903 return true; |
| (...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2202 if (color_property == CSSPropertyBackgroundColor && | 2202 if (color_property == CSSPropertyBackgroundColor && |
| 2203 visited_color == Color::kTransparent) | 2203 visited_color == Color::kTransparent) |
| 2204 return unvisited_color; | 2204 return unvisited_color; |
| 2205 | 2205 |
| 2206 // Take the alpha from the unvisited color, but get the RGB values from the | 2206 // Take the alpha from the unvisited color, but get the RGB values from the |
| 2207 // visited color. | 2207 // visited color. |
| 2208 return Color(visited_color.Red(), visited_color.Green(), visited_color.Blue(), | 2208 return Color(visited_color.Red(), visited_color.Green(), visited_color.Blue(), |
| 2209 unvisited_color.Alpha()); | 2209 unvisited_color.Alpha()); |
| 2210 } | 2210 } |
| 2211 | 2211 |
| 2212 const BorderValue& ComputedStyle::BorderBefore() const { | 2212 const BorderValue ComputedStyle::BorderBefore() const { |
| 2213 switch (GetWritingMode()) { | 2213 switch (GetWritingMode()) { |
| 2214 case WritingMode::kHorizontalTb: | 2214 case WritingMode::kHorizontalTb: |
| 2215 return BorderTop(); | 2215 return BorderTop(); |
| 2216 case WritingMode::kVerticalLr: | 2216 case WritingMode::kVerticalLr: |
| 2217 return BorderLeft(); | 2217 return BorderLeft(); |
| 2218 case WritingMode::kVerticalRl: | 2218 case WritingMode::kVerticalRl: |
| 2219 return BorderRight(); | 2219 return BorderRight(); |
| 2220 } | 2220 } |
| 2221 NOTREACHED(); | 2221 NOTREACHED(); |
| 2222 return BorderTop(); | 2222 return BorderTop(); |
| 2223 } | 2223 } |
| 2224 | 2224 |
| 2225 const BorderValue& ComputedStyle::BorderAfter() const { | 2225 const BorderValue ComputedStyle::BorderAfter() const { |
| 2226 switch (GetWritingMode()) { | 2226 switch (GetWritingMode()) { |
| 2227 case WritingMode::kHorizontalTb: | 2227 case WritingMode::kHorizontalTb: |
| 2228 return BorderBottom(); | 2228 return BorderBottom(); |
| 2229 case WritingMode::kVerticalLr: | 2229 case WritingMode::kVerticalLr: |
| 2230 return BorderRight(); | 2230 return BorderRight(); |
| 2231 case WritingMode::kVerticalRl: | 2231 case WritingMode::kVerticalRl: |
| 2232 return BorderLeft(); | 2232 return BorderLeft(); |
| 2233 } | 2233 } |
| 2234 NOTREACHED(); | 2234 NOTREACHED(); |
| 2235 return BorderBottom(); | 2235 return BorderBottom(); |
| 2236 } | 2236 } |
| 2237 | 2237 |
| 2238 const BorderValue& ComputedStyle::BorderStart() const { | 2238 const BorderValue ComputedStyle::BorderStart() const { |
| 2239 if (IsHorizontalWritingMode()) | 2239 if (IsHorizontalWritingMode()) |
| 2240 return IsLeftToRightDirection() ? BorderLeft() : BorderRight(); | 2240 return IsLeftToRightDirection() ? BorderLeft() : BorderRight(); |
| 2241 return IsLeftToRightDirection() ? BorderTop() : BorderBottom(); | 2241 return IsLeftToRightDirection() ? BorderTop() : BorderBottom(); |
| 2242 } | 2242 } |
| 2243 | 2243 |
| 2244 const BorderValue& ComputedStyle::BorderEnd() const { | 2244 const BorderValue ComputedStyle::BorderEnd() const { |
| 2245 if (IsHorizontalWritingMode()) | 2245 if (IsHorizontalWritingMode()) |
| 2246 return IsLeftToRightDirection() ? BorderRight() : BorderLeft(); | 2246 return IsLeftToRightDirection() ? BorderRight() : BorderLeft(); |
| 2247 return IsLeftToRightDirection() ? BorderBottom() : BorderTop(); | 2247 return IsLeftToRightDirection() ? BorderBottom() : BorderTop(); |
| 2248 } | 2248 } |
| 2249 | 2249 |
| 2250 float ComputedStyle::BorderBeforeWidth() const { | 2250 float ComputedStyle::BorderBeforeWidth() const { |
| 2251 switch (GetWritingMode()) { | 2251 switch (GetWritingMode()) { |
| 2252 case WritingMode::kHorizontalTb: | 2252 case WritingMode::kHorizontalTb: |
| 2253 return BorderTopWidth(); | 2253 return BorderTopWidth(); |
| 2254 case WritingMode::kVerticalLr: | 2254 case WritingMode::kVerticalLr: |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2506 if (value < 0) | 2506 if (value < 0) |
| 2507 fvalue -= 0.5f; | 2507 fvalue -= 0.5f; |
| 2508 else | 2508 else |
| 2509 fvalue += 0.5f; | 2509 fvalue += 0.5f; |
| 2510 } | 2510 } |
| 2511 | 2511 |
| 2512 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); | 2512 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); |
| 2513 } | 2513 } |
| 2514 | 2514 |
| 2515 } // namespace blink | 2515 } // namespace blink |
| OLD | NEW |