| 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
reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
| 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 { | 99 { |
| 100 setBitDefaults(); | 100 setBitDefaults(); |
| 101 | 101 |
| 102 m_box.init(); | 102 m_box.init(); |
| 103 visual.init(); | 103 visual.init(); |
| 104 m_background.init(); | 104 m_background.init(); |
| 105 surround.init(); | 105 surround.init(); |
| 106 rareNonInheritedData.init(); | 106 rareNonInheritedData.init(); |
| 107 rareNonInheritedData.access()->m_flexibleBox.init(); | 107 rareNonInheritedData.access()->m_flexibleBox.init(); |
| 108 rareNonInheritedData.access()->m_transform.init(); | 108 rareNonInheritedData.access()->m_transform.init(); |
| 109 rareNonInheritedData.access()->m_willChange.init(); | |
| 110 rareNonInheritedData.access()->m_filter.init(); | 109 rareNonInheritedData.access()->m_filter.init(); |
| 111 rareInheritedData.init(); | 110 rareInheritedData.init(); |
| 112 inherited.init(); | 111 inherited.init(); |
| 113 } | 112 } |
| 114 | 113 |
| 115 ALWAYS_INLINE RenderStyle::RenderStyle(const RenderStyle& o) | 114 ALWAYS_INLINE RenderStyle::RenderStyle(const RenderStyle& o) |
| 116 : RefCounted<RenderStyle>() | 115 : RefCounted<RenderStyle>() |
| 117 , m_box(o.m_box) | 116 , m_box(o.m_box) |
| 118 , visual(o.visual) | 117 , visual(o.visual) |
| 119 , m_background(o.m_background) | 118 , m_background(o.m_background) |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 diff.setNeedsPositionedMovementLayout(); | 276 diff.setNeedsPositionedMovementLayout(); |
| 278 else | 277 else |
| 279 diff.setNeedsFullLayout(); | 278 diff.setNeedsFullLayout(); |
| 280 } | 279 } |
| 281 | 280 |
| 282 updatePropertySpecificDifferences(other, diff); | 281 updatePropertySpecificDifferences(other, diff); |
| 283 | 282 |
| 284 // Cursors are not checked, since they will be set appropriately in response
to mouse events, | 283 // Cursors are not checked, since they will be set appropriately in response
to mouse events, |
| 285 // so they don't need to cause any paint invalidation or layout. | 284 // so they don't need to cause any paint invalidation or layout. |
| 286 | 285 |
| 287 // Animations don't need to be checked either. We always set the new style o
n the RenderObject, so we will get a chance to fire off | |
| 288 // the resulting transition properly. | |
| 289 | |
| 290 return diff; | 286 return diff; |
| 291 } | 287 } |
| 292 | 288 |
| 293 bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const | 289 bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const |
| 294 { | 290 { |
| 295 // FIXME: Not all cases in this method need both full layout and paint inval
idation. | 291 // FIXME: Not all cases in this method need both full layout and paint inval
idation. |
| 296 // Should move cases into diffNeedsFullLayout() if | 292 // Should move cases into diffNeedsFullLayout() if |
| 297 // - don't need paint invalidation at all; | 293 // - don't need paint invalidation at all; |
| 298 // - or the renderer knows how to exactly invalidate paints caused by the la
yout change | 294 // - or the renderer knows how to exactly invalidate paints caused by the la
yout change |
| 299 // instead of forced full paint invalidation. | 295 // instead of forced full paint invalidation. |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 } | 648 } |
| 653 case TextEmphasisMarkAuto: | 649 case TextEmphasisMarkAuto: |
| 654 ASSERT_NOT_REACHED(); | 650 ASSERT_NOT_REACHED(); |
| 655 return nullAtom; | 651 return nullAtom; |
| 656 } | 652 } |
| 657 | 653 |
| 658 ASSERT_NOT_REACHED(); | 654 ASSERT_NOT_REACHED(); |
| 659 return nullAtom; | 655 return nullAtom; |
| 660 } | 656 } |
| 661 | 657 |
| 662 CSSAnimationData& RenderStyle::accessAnimations() | |
| 663 { | |
| 664 if (!rareNonInheritedData.access()->m_animations) | |
| 665 rareNonInheritedData.access()->m_animations = CSSAnimationData::create()
; | |
| 666 return *rareNonInheritedData->m_animations; | |
| 667 } | |
| 668 | |
| 669 CSSTransitionData& RenderStyle::accessTransitions() | |
| 670 { | |
| 671 if (!rareNonInheritedData.access()->m_transitions) | |
| 672 rareNonInheritedData.access()->m_transitions = CSSTransitionData::create
(); | |
| 673 return *rareNonInheritedData->m_transitions; | |
| 674 } | |
| 675 | |
| 676 const Font& RenderStyle::font() const { return inherited->font; } | 658 const Font& RenderStyle::font() const { return inherited->font; } |
| 677 const FontMetrics& RenderStyle::fontMetrics() const { return inherited->font.fon
tMetrics(); } | 659 const FontMetrics& RenderStyle::fontMetrics() const { return inherited->font.fon
tMetrics(); } |
| 678 const FontDescription& RenderStyle::fontDescription() const { return inherited->
font.fontDescription(); } | 660 const FontDescription& RenderStyle::fontDescription() const { return inherited->
font.fontDescription(); } |
| 679 float RenderStyle::specifiedFontSize() const { return fontDescription().specifie
dSize(); } | 661 float RenderStyle::specifiedFontSize() const { return fontDescription().specifie
dSize(); } |
| 680 float RenderStyle::computedFontSize() const { return fontDescription().computedS
ize(); } | 662 float RenderStyle::computedFontSize() const { return fontDescription().computedS
ize(); } |
| 681 int RenderStyle::fontSize() const { return fontDescription().computedPixelSize()
; } | 663 int RenderStyle::fontSize() const { return fontDescription().computedPixelSize()
; } |
| 682 FontWeight RenderStyle::fontWeight() const { return fontDescription().weight();
} | 664 FontWeight RenderStyle::fontWeight() const { return fontDescription().weight();
} |
| 683 FontStretch RenderStyle::fontStretch() const { return fontDescription().stretch(
); } | 665 FontStretch RenderStyle::fontStretch() const { return fontDescription().stretch(
); } |
| 684 | 666 |
| 685 TextDecoration RenderStyle::textDecorationsInEffect() const | 667 TextDecoration RenderStyle::textDecorationsInEffect() const |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 // right | 1119 // right |
| 1138 radiiSum = radii.topRight().height() + radii.bottomRight().height(); | 1120 radiiSum = radii.topRight().height() + radii.bottomRight().height(); |
| 1139 if (radiiSum > rect.height()) | 1121 if (radiiSum > rect.height()) |
| 1140 factor = std::min(rect.height() / radiiSum, factor); | 1122 factor = std::min(rect.height() / radiiSum, factor); |
| 1141 | 1123 |
| 1142 ASSERT(factor <= 1); | 1124 ASSERT(factor <= 1); |
| 1143 return factor; | 1125 return factor; |
| 1144 } | 1126 } |
| 1145 | 1127 |
| 1146 } // namespace blink | 1128 } // namespace blink |
| OLD | NEW |