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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 m_visual = other.m_visual; | 340 m_visual = other.m_visual; |
341 m_background = other.m_background; | 341 m_background = other.m_background; |
342 m_surround = other.m_surround; | 342 m_surround = other.m_surround; |
343 m_rareNonInheritedData = other.m_rareNonInheritedData; | 343 m_rareNonInheritedData = other.m_rareNonInheritedData; |
344 | 344 |
345 // The flags are copied one-by-one because m_nonInheritedData.m_contains a | 345 // The flags are copied one-by-one because m_nonInheritedData.m_contains a |
346 // bunch of stuff other than real style data. | 346 // bunch of stuff other than real style data. |
347 // See comments for each skipped flag below. | 347 // See comments for each skipped flag below. |
348 setOriginalDisplay( | 348 setOriginalDisplay( |
349 other.originalDisplay()); // Not generated in ComputedStyleBase. | 349 other.originalDisplay()); // Not generated in ComputedStyleBase. |
350 m_nonInheritedData.m_verticalAlign = other.m_nonInheritedData.m_verticalAlign; | 350 setVerticalAlign( |
| 351 other.verticalAlign()); // Not generated in ComputedStyleBase |
351 m_nonInheritedData.m_hasViewportUnits = | 352 m_nonInheritedData.m_hasViewportUnits = |
352 other.m_nonInheritedData.m_hasViewportUnits; | 353 other.m_nonInheritedData.m_hasViewportUnits; |
353 m_nonInheritedData.m_hasRemUnits = other.m_nonInheritedData.m_hasRemUnits; | 354 m_nonInheritedData.m_hasRemUnits = other.m_nonInheritedData.m_hasRemUnits; |
354 | 355 |
355 // Correctly set during selector matching: | 356 // Correctly set during selector matching: |
356 // m_nonInheritedData.m_styleType | 357 // m_nonInheritedData.m_styleType |
357 // m_nonInheritedData.m_pseudoBits | 358 // m_nonInheritedData.m_pseudoBits |
358 | 359 |
359 // Set correctly while computing style for children: | 360 // Set correctly while computing style for children: |
360 // m_nonInheritedData.m_explicitInheritance | 361 // m_nonInheritedData.m_explicitInheritance |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 | 477 |
477 bool ComputedStyle::loadingCustomFontsEqual(const ComputedStyle& other) const { | 478 bool ComputedStyle::loadingCustomFontsEqual(const ComputedStyle& other) const { |
478 return font().loadingCustomFonts() == other.font().loadingCustomFonts(); | 479 return font().loadingCustomFonts() == other.font().loadingCustomFonts(); |
479 } | 480 } |
480 | 481 |
481 bool ComputedStyle::nonInheritedEqual(const ComputedStyle& other) const { | 482 bool ComputedStyle::nonInheritedEqual(const ComputedStyle& other) const { |
482 // compare everything except the pseudoStyle pointer | 483 // compare everything except the pseudoStyle pointer |
483 return ComputedStyleBase::nonInheritedEqual(other) && | 484 return ComputedStyleBase::nonInheritedEqual(other) && |
484 originalDisplay() == | 485 originalDisplay() == |
485 other.originalDisplay() && // Not generated in ComputedStyleBase | 486 other.originalDisplay() && // Not generated in ComputedStyleBase |
486 m_nonInheritedData == other.m_nonInheritedData && | 487 verticalAlign() == |
487 m_box == other.m_box && m_visual == other.m_visual && | 488 other.verticalAlign() && // Not generated in ComputedStyleBase |
488 m_background == other.m_background && m_surround == other.m_surround && | 489 m_box == other.m_box && |
| 490 m_visual == other.m_visual && m_background == other.m_background && |
| 491 m_surround == other.m_surround && |
489 m_rareNonInheritedData == other.m_rareNonInheritedData && | 492 m_rareNonInheritedData == other.m_rareNonInheritedData && |
490 m_svgStyle->nonInheritedEqual(*other.m_svgStyle); | 493 m_svgStyle->nonInheritedEqual(*other.m_svgStyle); |
491 } | 494 } |
492 | 495 |
493 bool ComputedStyle::inheritedDataShared(const ComputedStyle& other) const { | 496 bool ComputedStyle::inheritedDataShared(const ComputedStyle& other) const { |
494 // This is a fast check that only looks if the data structures are shared. | 497 // This is a fast check that only looks if the data structures are shared. |
495 // TODO(sashab): Should ComputedStyleBase have an inheritedDataShared method? | 498 // TODO(sashab): Should ComputedStyleBase have an inheritedDataShared method? |
496 return ComputedStyleBase::inheritedEqual(other) && | 499 return ComputedStyleBase::inheritedEqual(other) && |
497 m_styleInheritedData.get() == other.m_styleInheritedData.get() && | 500 m_styleInheritedData.get() == other.m_styleInheritedData.get() && |
498 m_svgStyle.get() == other.m_svgStyle.get() && | 501 m_svgStyle.get() == other.m_svgStyle.get() && |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 m_box->maxHeight() != other.m_box->maxHeight()) | 852 m_box->maxHeight() != other.m_box->maxHeight()) |
850 return true; | 853 return true; |
851 | 854 |
852 if (m_box->verticalAlign() != other.m_box->verticalAlign()) | 855 if (m_box->verticalAlign() != other.m_box->verticalAlign()) |
853 return true; | 856 return true; |
854 | 857 |
855 if (m_box->boxSizing() != other.m_box->boxSizing()) | 858 if (m_box->boxSizing() != other.m_box->boxSizing()) |
856 return true; | 859 return true; |
857 } | 860 } |
858 | 861 |
859 if (m_nonInheritedData.m_verticalAlign != | 862 if (verticalAlign() != other.verticalAlign() || |
860 other.m_nonInheritedData.m_verticalAlign || | |
861 position() != other.position()) | 863 position() != other.position()) |
862 return true; | 864 return true; |
863 | 865 |
864 if (m_rareNonInheritedData.get() != other.m_rareNonInheritedData.get()) { | 866 if (m_rareNonInheritedData.get() != other.m_rareNonInheritedData.get()) { |
865 if (m_rareNonInheritedData->m_alignContent != | 867 if (m_rareNonInheritedData->m_alignContent != |
866 other.m_rareNonInheritedData->m_alignContent || | 868 other.m_rareNonInheritedData->m_alignContent || |
867 m_rareNonInheritedData->m_alignItems != | 869 m_rareNonInheritedData->m_alignItems != |
868 other.m_rareNonInheritedData->m_alignItems || | 870 other.m_rareNonInheritedData->m_alignItems || |
869 m_rareNonInheritedData->m_alignSelf != | 871 m_rareNonInheritedData->m_alignSelf != |
870 other.m_rareNonInheritedData->m_alignSelf || | 872 other.m_rareNonInheritedData->m_alignSelf || |
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2490 if (value < 0) | 2492 if (value < 0) |
2491 fvalue -= 0.5f; | 2493 fvalue -= 0.5f; |
2492 else | 2494 else |
2493 fvalue += 0.5f; | 2495 fvalue += 0.5f; |
2494 } | 2496 } |
2495 | 2497 |
2496 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 2498 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
2497 } | 2499 } |
2498 | 2500 |
2499 } // namespace blink | 2501 } // namespace blink |
OLD | NEW |