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 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 { | 496 { |
497 inherited.access()->cursorData = other; | 497 inherited.access()->cursorData = other; |
498 } | 498 } |
499 | 499 |
500 void RenderStyle::clearCursorList() | 500 void RenderStyle::clearCursorList() |
501 { | 501 { |
502 if (inherited->cursorData) | 502 if (inherited->cursorData) |
503 inherited.access()->cursorData = 0; | 503 inherited.access()->cursorData = 0; |
504 } | 504 } |
505 | 505 |
506 bool RenderStyle::contentDataEquivalent(const RenderStyle* otherStyle) const | |
507 { | |
508 ContentData* c1 = rareNonInheritedData->m_content.get(); | |
509 ContentData* c2 = otherStyle->rareNonInheritedData->m_content.get(); | |
510 | |
511 while (c1 && c2) { | |
512 if (c1->m_type != c2->m_type) | |
513 return false; | |
514 | |
515 switch (c1->m_type) { | |
516 case CONTENT_NONE: | |
517 break; | |
518 case CONTENT_TEXT: | |
519 if (!equal(c1->m_content.m_text, c2->m_content.m_text)) | |
520 return false; | |
521 break; | |
522 case CONTENT_OBJECT: | |
523 if (!StyleImage::imagesEquivalent(c1->m_content.m_image, c2->m_c
ontent.m_image)) | |
524 return false; | |
525 break; | |
526 case CONTENT_COUNTER: | |
527 if (*c1->m_content.m_counter != *c2->m_content.m_counter) | |
528 return false; | |
529 break; | |
530 } | |
531 | |
532 c1 = c1->m_next; | |
533 c2 = c2->m_next; | |
534 } | |
535 | |
536 return !c1 && !c2; | |
537 } | |
538 | |
539 void RenderStyle::clearContent() | 506 void RenderStyle::clearContent() |
540 { | 507 { |
541 if (rareNonInheritedData->m_content) | 508 if (rareNonInheritedData->m_content) |
542 rareNonInheritedData->m_content->clear(); | 509 rareNonInheritedData->m_content->clear(); |
543 } | 510 } |
544 | 511 |
545 void RenderStyle::setContent(PassRefPtr<StyleImage> image, bool add) | 512 void RenderStyle::setContent(PassRefPtr<StyleImage> image, bool add) |
546 { | 513 { |
547 if (!image) | 514 if (!image) |
548 return; // The object is null. Nothing to do. Just bail. | 515 return; // The object is null. Nothing to do. Just bail. |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 return rareNonInheritedData->m_animations.get(); | 778 return rareNonInheritedData->m_animations.get(); |
812 } | 779 } |
813 | 780 |
814 AnimationList* RenderStyle::accessTransitions() | 781 AnimationList* RenderStyle::accessTransitions() |
815 { | 782 { |
816 if (!rareNonInheritedData.access()->m_transitions) | 783 if (!rareNonInheritedData.access()->m_transitions) |
817 rareNonInheritedData.access()->m_transitions.set(new AnimationList()); | 784 rareNonInheritedData.access()->m_transitions.set(new AnimationList()); |
818 return rareNonInheritedData->m_transitions.get(); | 785 return rareNonInheritedData->m_transitions.get(); |
819 } | 786 } |
820 | 787 |
821 const Animation* RenderStyle::transitionForProperty(int property) | 788 const Animation* RenderStyle::transitionForProperty(int property) const |
822 { | 789 { |
823 if (transitions()) { | 790 if (transitions()) { |
824 for (size_t i = 0; i < transitions()->size(); ++i) { | 791 for (size_t i = 0; i < transitions()->size(); ++i) { |
825 const Animation* p = transitions()->animation(i); | 792 const Animation* p = transitions()->animation(i); |
826 if (p->property() == cAnimateAll || p->property() == property) { | 793 if (p->property() == cAnimateAll || p->property() == property) { |
827 return p; | 794 return p; |
828 } | 795 } |
829 } | 796 } |
830 } | 797 } |
831 return 0; | 798 return 0; |
832 } | 799 } |
833 | 800 |
834 void RenderStyle::setBlendedFontSize(int size) | 801 void RenderStyle::setBlendedFontSize(int size) |
835 { | 802 { |
836 FontDescription desc(fontDescription()); | 803 FontDescription desc(fontDescription()); |
837 desc.setSpecifiedSize(size); | 804 desc.setSpecifiedSize(size); |
838 desc.setComputedSize(size); | 805 desc.setComputedSize(size); |
839 setFontDescription(desc); | 806 setFontDescription(desc); |
840 font().update(font().fontSelector()); | 807 font().update(font().fontSelector()); |
841 } | 808 } |
842 | 809 |
843 } // namespace WebCore | 810 } // namespace WebCore |
844 | 811 |
OLD | NEW |