Changeset 82942 in webkit
- Timestamp:
- Apr 5, 2011 8:36:16 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r82940 r82942 1 2011-04-05 Luke Macpherson <macpherson@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 Implement CSSPropertyDirection in CSSStyleApplyProperty 6 https://bugs.webkit.org/show_bug.cgi?id=57608 7 8 No new tests required as no new functionality introduced. 9 10 * css/CSSStyleApplyProperty.cpp: 11 Add implementation class for CSSPropertyDirection 12 * css/CSSStyleSelector.cpp: 13 Remove existing implementation for CSSPropertyDirection 14 * css/CSSStyleSelector.h: 15 Add getter for element 16 1 17 2011-04-05 Leandro Gracia Gil <leandrogracia@chromium.org> 2 18 -
trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp
r80893 r82942 28 28 #include "CSSPrimitiveValueMappings.h" 29 29 #include "CSSStyleSelector.h" 30 #include "Document.h" 31 #include "Element.h" 30 32 #include "RenderStyle.h" 31 33 #include <wtf/StdLibExtras.h> … … 135 137 }; 136 138 139 // CSSPropertyDirection 140 class ApplyPropertyDirection : public ApplyPropertyDefault<TextDirection> { 141 public: 142 ApplyPropertyDirection(TextDirection (RenderStyle::*getter)() const, void (RenderStyle::*setter)(TextDirection), TextDirection (*initial)()) 143 : ApplyPropertyDefault<TextDirection>(getter, setter, initial) 144 { 145 } 146 147 virtual void value(CSSStyleSelector* selector, CSSValue* value) const 148 { 149 ApplyPropertyDefault<TextDirection>::value(selector, value); 150 Element* element = selector->element(); 151 if (element && selector->element() == element->document()->documentElement()) 152 element->document()->setDirectionSetOnDocumentElement(true); 153 } 154 }; 155 137 156 const CSSStyleApplyProperty& CSSStyleApplyProperty::sharedCSSStyleApplyProperty() 138 157 { … … 148 167 149 168 setPropertyValue(CSSPropertyColor, new ApplyPropertyColor(&RenderStyle::color, &RenderStyle::setColor, RenderStyle::initialColor)); 169 setPropertyValue(CSSPropertyDirection, new ApplyPropertyDirection(&RenderStyle::direction, &RenderStyle::setDirection, RenderStyle::initialDirection)); 150 170 setPropertyValue(CSSPropertyBackgroundColor, new ApplyPropertyColorBase(&RenderStyle::backgroundColor, 0, &RenderStyle::setBackgroundColor)); 151 171 setPropertyValue(CSSPropertyBorderBottomColor, new ApplyPropertyColorBase(&RenderStyle::borderBottomColor, &RenderStyle::color, &RenderStyle::setBorderBottomColor)); -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r82799 r82942 3723 3723 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(clear, Clear) 3724 3724 return; 3725 case CSSPropertyDirection:3726 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(direction, Direction)3727 if (!isInherit && !isInitial && m_element && m_element == m_element->document()->documentElement())3728 m_element->document()->setDirectionSetOnDocumentElement(true);3729 return;3730 3725 case CSSPropertyDisplay: 3731 3726 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(display, Display) … … 6198 6193 // These properties are implemented in the CSSStyleApplyProperty lookup table. 6199 6194 case CSSPropertyColor: 6195 case CSSPropertyDirection: 6200 6196 case CSSPropertyBackgroundColor: 6201 6197 case CSSPropertyBorderBottomColor: -
trunk/Source/WebCore/css/CSSStyleSelector.h
r82183 r82942 116 116 RenderStyle* style() const { return m_style.get(); } 117 117 RenderStyle* parentStyle() const { return m_parentStyle; } 118 Element* element() const { return m_element; } 118 119 119 120 private:
Note: See TracChangeset
for help on using the changeset viewer.