Changeset 101221 in webkit
- Timestamp:
- Nov 27, 2011, 10:19:11 PM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
css/CSSStyleApplyProperty.cpp (modified) (2 diffs)
-
css/CSSStyleSelector.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r101218 r101221 1 2011-11-27 Luke Macpherson <macpherson@chromium.org> 2 3 Implement CSSPropertyTextAlign in CSSStyleApplyProperty. 4 https://bugs.webkit.org/show_bug.cgi?id=73102 5 6 Reviewed by Andreas Kling. 7 8 Covered by fast/css/text-align*.html 9 10 * css/CSSStyleApplyProperty.cpp: 11 (WebCore::ApplyPropertyTextAlign::applyValue): 12 (WebCore::ApplyPropertyTextAlign::createHandler): 13 (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty): 14 * css/CSSStyleSelector.cpp: 15 (WebCore::CSSStyleSelector::applyProperty): 16 1 17 2011-11-27 Andreas Kling <kling@webkit.org> 2 18 -
trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp
r101177 r101221 686 686 }; 687 687 688 class ApplyPropertyTextAlign { 689 public: 690 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 691 { 692 if (!value->isPrimitiveValue()) 693 return; 694 695 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 696 697 if (primitiveValue->getIdent() != CSSValueWebkitMatchParent) 698 selector->style()->setTextAlign(*primitiveValue); 699 else if (selector->parentStyle()->textAlign() == TASTART) 700 selector->style()->setTextAlign(selector->parentStyle()->isLeftToRightDirection() ? LEFT : RIGHT); 701 else if (selector->parentStyle()->textAlign() == TAEND) 702 selector->style()->setTextAlign(selector->parentStyle()->isLeftToRightDirection() ? RIGHT : LEFT); 703 else 704 selector->style()->setTextAlign(selector->parentStyle()->textAlign()); 705 } 706 static PropertyHandler createHandler() 707 { 708 PropertyHandler handler = ApplyPropertyDefaultBase<ETextAlign, &RenderStyle::textAlign, ETextAlign, &RenderStyle::setTextAlign, ETextAlign, &RenderStyle::initialTextAlign>::createHandler(); 709 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue); 710 } 711 }; 712 688 713 class ApplyPropertyTextEmphasisStyle { 689 714 public: … … 1013 1038 setPropertyHandler(CSSPropertyFontWeight, ApplyPropertyFontWeight::createHandler()); 1014 1039 1040 setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler()); 1041 1015 1042 setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler()); 1016 1043 setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler()); -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r101177 r101221 2779 2779 return; 2780 2780 m_style->setLineHeight(lineHeight); 2781 return;2782 }2783 2784 // string2785 case CSSPropertyTextAlign:2786 {2787 HANDLE_INHERIT_AND_INITIAL(textAlign, TextAlign)2788 if (!primitiveValue)2789 return;2790 if (primitiveValue->getIdent() == CSSValueWebkitMatchParent) {2791 if (m_parentStyle->textAlign() == TASTART)2792 m_style->setTextAlign(m_parentStyle->isLeftToRightDirection() ? LEFT : RIGHT);2793 else if (m_parentStyle->textAlign() == TAEND)2794 m_style->setTextAlign(m_parentStyle->isLeftToRightDirection() ? RIGHT : LEFT);2795 else2796 m_style->setTextAlign(m_parentStyle->textAlign());2797 return;2798 }2799 m_style->setTextAlign(*primitiveValue);2800 2781 return; 2801 2782 } … … 4025 4006 case CSSPropertyPaddingLeft: 4026 4007 case CSSPropertyPadding: 4008 case CSSPropertyTextAlign: 4027 4009 case CSSPropertyTextIndent: 4028 4010 case CSSPropertyMaxHeight:
Note:
See TracChangeset
for help on using the changeset viewer.