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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 ComputedStyleBase::CopyNonInheritedFromCached(other); | 331 ComputedStyleBase::CopyNonInheritedFromCached(other); |
332 box_data_ = other.box_data_; | 332 box_data_ = other.box_data_; |
333 visual_data_ = other.visual_data_; | 333 visual_data_ = other.visual_data_; |
334 rare_non_inherited_data_ = other.rare_non_inherited_data_; | 334 rare_non_inherited_data_ = other.rare_non_inherited_data_; |
335 | 335 |
336 // The flags are copied one-by-one because they contain | 336 // The flags are copied one-by-one because they contain |
337 // bunch of stuff other than real style data. | 337 // bunch of stuff other than real style data. |
338 // See comments for each skipped flag below. | 338 // See comments for each skipped flag below. |
339 | 339 |
340 // These are not generated in ComputedStyleBase | 340 // These are not generated in ComputedStyleBase |
341 SetVerticalAlign(other.VerticalAlign()); | |
342 SetHasViewportUnits(other.HasViewportUnits()); | 341 SetHasViewportUnits(other.HasViewportUnits()); |
343 SetHasRemUnitsInternal(other.HasRemUnits()); | 342 SetHasRemUnitsInternal(other.HasRemUnits()); |
344 | 343 |
345 // Correctly set during selector matching: | 344 // Correctly set during selector matching: |
346 // m_styleType | 345 // m_styleType |
347 // m_pseudoBits | 346 // m_pseudoBits |
348 | 347 |
349 // Set correctly while computing style for children: | 348 // Set correctly while computing style for children: |
350 // m_explicitInheritance | 349 // m_explicitInheritance |
351 | 350 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 rare_inherited_data_ == other.rare_inherited_data_; | 463 rare_inherited_data_ == other.rare_inherited_data_; |
465 } | 464 } |
466 | 465 |
467 bool ComputedStyle::LoadingCustomFontsEqual(const ComputedStyle& other) const { | 466 bool ComputedStyle::LoadingCustomFontsEqual(const ComputedStyle& other) const { |
468 return GetFont().LoadingCustomFonts() == other.GetFont().LoadingCustomFonts(); | 467 return GetFont().LoadingCustomFonts() == other.GetFont().LoadingCustomFonts(); |
469 } | 468 } |
470 | 469 |
471 bool ComputedStyle::NonInheritedEqual(const ComputedStyle& other) const { | 470 bool ComputedStyle::NonInheritedEqual(const ComputedStyle& other) const { |
472 // compare everything except the pseudoStyle pointer | 471 // compare everything except the pseudoStyle pointer |
473 return ComputedStyleBase::NonInheritedEqual(other) && | 472 return ComputedStyleBase::NonInheritedEqual(other) && |
474 VerticalAlign() == other.VerticalAlign() && // Not generated in | |
475 // ComputedStyleBase | |
476 box_data_ == other.box_data_ && | 473 box_data_ == other.box_data_ && |
477 visual_data_ == other.visual_data_ && | 474 visual_data_ == other.visual_data_ && |
478 rare_non_inherited_data_ == other.rare_non_inherited_data_ && | 475 rare_non_inherited_data_ == other.rare_non_inherited_data_ && |
479 svg_style_->NonInheritedEqual(*other.svg_style_); | 476 svg_style_->NonInheritedEqual(*other.svg_style_); |
480 } | 477 } |
481 | 478 |
482 bool ComputedStyle::InheritedDataShared(const ComputedStyle& other) const { | 479 bool ComputedStyle::InheritedDataShared(const ComputedStyle& other) const { |
483 // This is a fast check that only looks if the data structures are shared. | 480 // This is a fast check that only looks if the data structures are shared. |
484 // TODO(sashab): Should ComputedStyleBase have an inheritedDataShared method? | 481 // TODO(sashab): Should ComputedStyleBase have an inheritedDataShared method? |
485 return ComputedStyleBase::InheritedEqual(other) && | 482 return ComputedStyleBase::InheritedEqual(other) && |
(...skipping 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2493 if (value < 0) | 2490 if (value < 0) |
2494 fvalue -= 0.5f; | 2491 fvalue -= 0.5f; |
2495 else | 2492 else |
2496 fvalue += 0.5f; | 2493 fvalue += 0.5f; |
2497 } | 2494 } |
2498 | 2495 |
2499 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); | 2496 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); |
2500 } | 2497 } |
2501 | 2498 |
2502 } // namespace blink | 2499 } // namespace blink |
OLD | NEW |