1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25 #include "config.h"
26 #include "CSSStyleApplyProperty.h"
27
28 #include "CSSPrimitiveValueMappings.h"
29 #include "CSSStyleSelector.h"
30 #include "CSSValueList.h"
31 #include "Document.h"
32 #include "Element.h"
33 #include "RenderStyle.h"
34 #include <wtf/StdLibExtras.h>
35 #include <wtf/UnusedParam.h>
36
37 using namespace std;
38
39 namespace WebCore {
40
41 class ApplyPropertyExpanding : public ApplyPropertyBase {
42 public:
ApplyPropertyExpanding(ApplyPropertyBase * one=0,ApplyPropertyBase * two=0,ApplyPropertyBase * three=0,ApplyPropertyBase * four=0)43 ApplyPropertyExpanding(ApplyPropertyBase* one = 0, ApplyPropertyBase* two = 0, ApplyPropertyBase *three = 0, ApplyPropertyBase* four = 0)
44 {
45 m_propertyMap[0] = one;
46 m_propertyMap[1] = two;
47 m_propertyMap[2] = three;
48 m_propertyMap[3] = four;
49 m_propertyMap[4] = 0; // always null terminated
50 }
51
applyInheritValue(CSSStyleSelector * selector) const52 virtual void applyInheritValue(CSSStyleSelector* selector) const
53 {
54 for (ApplyPropertyBase* const* e = m_propertyMap; *e; e++)
55 (*e)->applyInheritValue(selector);
56 }
57
applyInitialValue(CSSStyleSelector * selector) const58 virtual void applyInitialValue(CSSStyleSelector* selector) const
59 {
60 for (ApplyPropertyBase* const* e = m_propertyMap; *e; e++)
61 (*e)->applyInitialValue(selector);
62 }
63
applyValue(CSSStyleSelector * selector,CSSValue * value) const64 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const
65 {
66 for (ApplyPropertyBase* const* e = m_propertyMap; *e; e++)
67 (*e)->applyValue(selector, value);
68 }
69 private:
70 ApplyPropertyBase* m_propertyMap[5];
71 };
72
73 class ApplyPropertyExpandingSuppressValue : public ApplyPropertyExpanding {
74 public:
ApplyPropertyExpandingSuppressValue(ApplyPropertyBase * one=0,ApplyPropertyBase * two=0,ApplyPropertyBase * three=0,ApplyPropertyBase * four=0)75 ApplyPropertyExpandingSuppressValue(ApplyPropertyBase* one = 0, ApplyPropertyBase* two = 0, ApplyPropertyBase *three = 0, ApplyPropertyBase* four = 0)
76 : ApplyPropertyExpanding(one, two, three, four) {}
77
applyValue(CSSStyleSelector *,CSSValue *) const78 virtual void applyValue(CSSStyleSelector*, CSSValue*) const
79 {
80 ASSERT_NOT_REACHED();
81 }
82 };
83
84 template <typename T>
85 class ApplyPropertyDefault : public ApplyPropertyBase {
86 public:
ApplyPropertyDefault(T (RenderStyle::* getter)()const,void (RenderStyle::* setter)(T),T (* initial)())87 ApplyPropertyDefault(T (RenderStyle::*getter)() const, void (RenderStyle::*setter)(T), T (*initial)())
88 : m_getter(getter)
89 , m_setter(setter)
90 , m_initial(initial)
91 {
92 }
93
applyInheritValue(CSSStyleSelector * selector) const94 virtual void applyInheritValue(CSSStyleSelector* selector) const
95 {
96 (selector->style()->*m_setter)((selector->parentStyle()->*m_getter)());
97 }
98
applyInitialValue(CSSStyleSelector * selector) const99 virtual void applyInitialValue(CSSStyleSelector* selector) const
100 {
101 (selector->style()->*m_setter)((*m_initial)());
102 }
103
applyValue(CSSStyleSelector * selector,CSSValue * value) const104 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const
105 {
106 if (value->isPrimitiveValue())
107 (selector->style()->*m_setter)(*(static_cast<CSSPrimitiveValue*>(value)));
108 }
109
110 protected:
111 T (RenderStyle::*m_getter)() const;
112 void (RenderStyle::*m_setter)(T);
113 T (*m_initial)();
114 };
115
116 // CSSPropertyColor
117 class ApplyPropertyColorBase : public ApplyPropertyBase {
118 public:
ApplyPropertyColorBase(const Color & (RenderStyle::* getter)()const,const Color & (RenderStyle::* defaultValue)()const,void (RenderStyle::* setter)(const Color &))119 ApplyPropertyColorBase(const Color& (RenderStyle::*getter)() const, const Color& (RenderStyle::*defaultValue)() const, void (RenderStyle::*setter)(const Color&))
120 : m_getter(getter)
121 , m_defaultValue(defaultValue)
122 , m_setter(setter)
123 {
124 }
applyInheritValue(CSSStyleSelector * selector) const125 virtual void applyInheritValue(CSSStyleSelector* selector) const
126 {
127 const Color& color = (selector->parentStyle()->*m_getter)();
128 if (m_defaultValue && !color.isValid())
129 (selector->style()->*m_setter)((selector->parentStyle()->*m_defaultValue)());
130 else
131 (selector->style()->*m_setter)(color);
132 }
applyInitialValue(CSSStyleSelector * selector) const133 virtual void applyInitialValue(CSSStyleSelector* selector) const
134 {
135 Color color;
136 (selector->style()->*m_setter)(color);
137 }
applyValue(CSSStyleSelector * selector,CSSValue * value) const138 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const
139 {
140 if (value->isPrimitiveValue())
141 (selector->style()->*m_setter)(selector->getColorFromPrimitiveValue(static_cast<CSSPrimitiveValue*>(value)));
142 }
143 protected:
144 const Color& (RenderStyle::*m_getter)() const;
145 const Color& (RenderStyle::*m_defaultValue)() const;
146 void (RenderStyle::*m_setter)(const Color&);
147 };
148
149 class ApplyPropertyColor : public ApplyPropertyColorBase {
150 public:
ApplyPropertyColor(const Color & (RenderStyle::* getter)()const,void (RenderStyle::* setter)(const Color &),Color (* initialValue)())151 ApplyPropertyColor(const Color& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&), Color (*initialValue)())
152 : ApplyPropertyColorBase(getter, 0, setter)
153 , m_initialValue(initialValue)
154 {
155 }
156
applyInitialValue(CSSStyleSelector * selector) const157 virtual void applyInitialValue(CSSStyleSelector* selector) const
158 {
159 (selector->style()->*m_setter)(m_initialValue());
160 }
161
applyValue(CSSStyleSelector * selector,CSSValue * value) const162 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const
163 {
164 if (!value->isPrimitiveValue())
165 return;
166
167 if ((static_cast<CSSPrimitiveValue*>(value))->getIdent() == CSSValueCurrentcolor)
168 applyInheritValue(selector);
169 else
170 ApplyPropertyColorBase::applyValue(selector, value);
171 }
172 protected:
173 Color (*m_initialValue)();
174 };
175
176 // CSSPropertyDirection
177 class ApplyPropertyDirection : public ApplyPropertyDefault<TextDirection> {
178 public:
ApplyPropertyDirection(TextDirection (RenderStyle::* getter)()const,void (RenderStyle::* setter)(TextDirection),TextDirection (* initial)())179 ApplyPropertyDirection(TextDirection (RenderStyle::*getter)() const, void (RenderStyle::*setter)(TextDirection), TextDirection (*initial)())
180 : ApplyPropertyDefault<TextDirection>(getter, setter, initial)
181 {
182 }
183
applyValue(CSSStyleSelector * selector,CSSValue * value) const184 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const
185 {
186 ApplyPropertyDefault<TextDirection>::applyValue(selector, value);
187 Element* element = selector->element();
188 if (element && selector->element() == element->document()->documentElement())
189 element->document()->setDirectionSetOnDocumentElement(true);
190 }
191 };
192
193 template <typename T>
194 class ApplyPropertyFillLayer : public ApplyPropertyBase {
195 public:
ApplyPropertyFillLayer(CSSPropertyID propertyId,EFillLayerType fillLayerType,FillLayer * (RenderStyle::* accessLayers)(),const FillLayer * (RenderStyle::* layers)()const,bool (FillLayer::* test)()const,T (FillLayer::* get)()const,void (FillLayer::* set)(T),void (FillLayer::* clear)(),T (* initial)(EFillLayerType),void (CSSStyleSelector::* mapFill)(CSSPropertyID,FillLayer *,CSSValue *))196 ApplyPropertyFillLayer(CSSPropertyID propertyId, EFillLayerType fillLayerType, FillLayer* (RenderStyle::*accessLayers)(),
197 const FillLayer* (RenderStyle::*layers)() const, bool (FillLayer::*test)() const, T (FillLayer::*get)() const,
198 void (FillLayer::*set)(T), void (FillLayer::*clear)(), T (*initial)(EFillLayerType),
199 void (CSSStyleSelector::*mapFill)(CSSPropertyID, FillLayer*, CSSValue*))
200 : m_propertyId(propertyId)
201 , m_fillLayerType(fillLayerType)
202 , m_accessLayers(accessLayers)
203 , m_layers(layers)
204 , m_test(test)
205 , m_get(get)
206 , m_set(set)
207 , m_clear(clear)
208 , m_initial(initial)
209 , m_mapFill(mapFill)
210 {
211 }
212
applyInheritValue(CSSStyleSelector * selector) const213 virtual void applyInheritValue(CSSStyleSelector* selector) const
214 {
215 FillLayer* currChild = (selector->style()->*m_accessLayers)();
216 FillLayer* prevChild = 0;
217 const FillLayer* currParent = (selector->parentStyle()->*m_layers)();
218 while (currParent && (currParent->*m_test)()) {
219 if (!currChild) {
220 /* Need to make a new layer.*/
221 currChild = new FillLayer(m_fillLayerType);
222 prevChild->setNext(currChild);
223 }
224 (currChild->*m_set)((currParent->*m_get)());
225 prevChild = currChild;
226 currChild = prevChild->next();
227 currParent = currParent->next();
228 }
229
230 while (currChild) {
231 /* Reset any remaining layers to not have the property set. */
232 (currChild->*m_clear)();
233 currChild = currChild->next();
234 }
235 }
236
applyInitialValue(CSSStyleSelector * selector) const237 virtual void applyInitialValue(CSSStyleSelector* selector) const
238 {
239 FillLayer* currChild = (selector->style()->*m_accessLayers)();
240 (currChild->*m_set)((*m_initial)(m_fillLayerType));
241 for (currChild = currChild->next(); currChild; currChild = currChild->next())
242 (currChild->*m_clear)();
243 }
244
applyValue(CSSStyleSelector * selector,CSSValue * value) const245 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const
246 {
247 FillLayer* currChild = (selector->style()->*m_accessLayers)();
248 FillLayer* prevChild = 0;
249 if (value->isValueList()) {
250 /* Walk each value and put it into a layer, creating new layers as needed. */
251 CSSValueList* valueList = static_cast<CSSValueList*>(value);
252 for (unsigned int i = 0; i < valueList->length(); i++) {
253 if (!currChild) {
254 /* Need to make a new layer to hold this value */
255 currChild = new FillLayer(m_fillLayerType);
256 prevChild->setNext(currChild);
257 }
258 (selector->*m_mapFill)(m_propertyId, currChild, valueList->itemWithoutBoundsCheck(i));
259 prevChild = currChild;
260 currChild = currChild->next();
261 }
262 } else {
263 (selector->*m_mapFill)(m_propertyId, currChild, value);
264 currChild = currChild->next();
265 }
266 while (currChild) {
267 /* Reset all remaining layers to not have the property set. */
268 (currChild->*m_clear)();
269 currChild = currChild->next();
270 }
271 }
272
273 protected:
274 CSSPropertyID m_propertyId;
275 EFillLayerType m_fillLayerType;
276 FillLayer* (RenderStyle::*m_accessLayers)();
277 const FillLayer* (RenderStyle::*m_layers)() const;
278 bool (FillLayer::*m_test)() const;
279 T (FillLayer::*m_get)() const;
280 void (FillLayer::*m_set)(T);
281 void (FillLayer::*m_clear)();
282 T (*m_initial)(EFillLayerType);
283 void (CSSStyleSelector::*m_mapFill)(CSSPropertyID, FillLayer*, CSSValue*);
284 };
285
sharedCSSStyleApplyProperty()286 const CSSStyleApplyProperty& CSSStyleApplyProperty::sharedCSSStyleApplyProperty()
287 {
288 DEFINE_STATIC_LOCAL(CSSStyleApplyProperty, cssStyleApplyPropertyInstance, ());
289 return cssStyleApplyPropertyInstance;
290 }
291
CSSStyleApplyProperty()292 CSSStyleApplyProperty::CSSStyleApplyProperty()
293 {
294 for (int i = 0; i < numCSSProperties; ++i)
295 m_propertyMap[i] = 0;
296
297 setPropertyValue(CSSPropertyColor, new ApplyPropertyColor(&RenderStyle::color, &RenderStyle::setColor, RenderStyle::initialColor));
298 setPropertyValue(CSSPropertyDirection, new ApplyPropertyDirection(&RenderStyle::direction, &RenderStyle::setDirection, RenderStyle::initialDirection));
299
300 setPropertyValue(CSSPropertyBackgroundAttachment, new ApplyPropertyFillLayer<EFillAttachment>(CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
301 &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSStyleSelector::mapFillAttachment));
302 setPropertyValue(CSSPropertyBackgroundClip, new ApplyPropertyFillLayer<EFillBox>(CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
303 &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSStyleSelector::mapFillClip));
304 setPropertyValue(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip);
305 setPropertyValue(CSSPropertyWebkitBackgroundComposite, new ApplyPropertyFillLayer<CompositeOperator>(CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
306 &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSStyleSelector::mapFillComposite));
307
308 setPropertyValue(CSSPropertyBackgroundImage, new ApplyPropertyFillLayer<StyleImage*>(CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
309 &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSStyleSelector::mapFillImage));
310
311 setPropertyValue(CSSPropertyBackgroundOrigin, new ApplyPropertyFillLayer<EFillBox>(CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
312 &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSStyleSelector::mapFillOrigin));
313 setPropertyValue(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
314
315 setPropertyValue(CSSPropertyBackgroundPositionX, new ApplyPropertyFillLayer<Length>(CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
316 &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSStyleSelector::mapFillXPosition));
317 setPropertyValue(CSSPropertyBackgroundPositionY, new ApplyPropertyFillLayer<Length>(CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
318 &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSStyleSelector::mapFillYPosition));
319 setPropertyValue(CSSPropertyBackgroundPosition, new ApplyPropertyExpandingSuppressValue(propertyValue(CSSPropertyBackgroundPositionX), propertyValue(CSSPropertyBackgroundPositionY)));
320
321 setPropertyValue(CSSPropertyBackgroundRepeatX, new ApplyPropertyFillLayer<EFillRepeat>(CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
322 &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSStyleSelector::mapFillRepeatX));
323 setPropertyValue(CSSPropertyBackgroundRepeatY, new ApplyPropertyFillLayer<EFillRepeat>(CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
324 &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSStyleSelector::mapFillRepeatY));
325 setPropertyValue(CSSPropertyBackgroundRepeat, new ApplyPropertyExpandingSuppressValue(propertyValue(CSSPropertyBackgroundRepeatX), propertyValue(CSSPropertyBackgroundRepeatY)));
326
327 setPropertyValue(CSSPropertyBackgroundSize, new ApplyPropertyFillLayer<FillSize>(CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
328 &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize));
329 setPropertyValue(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
330
331 setPropertyValue(CSSPropertyWebkitMaskAttachment, new ApplyPropertyFillLayer<EFillAttachment>(CSSPropertyWebkitMaskAttachment, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
332 &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSStyleSelector::mapFillAttachment));
333 setPropertyValue(CSSPropertyWebkitMaskClip, new ApplyPropertyFillLayer<EFillBox>(CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
334 &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSStyleSelector::mapFillClip));
335 setPropertyValue(CSSPropertyWebkitMaskComposite, new ApplyPropertyFillLayer<CompositeOperator>(CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
336 &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSStyleSelector::mapFillComposite));
337
338 setPropertyValue(CSSPropertyWebkitMaskImage, new ApplyPropertyFillLayer<StyleImage*>(CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
339 &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSStyleSelector::mapFillImage));
340
341 setPropertyValue(CSSPropertyWebkitMaskOrigin, new ApplyPropertyFillLayer<EFillBox>(CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
342 &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSStyleSelector::mapFillOrigin));
343 setPropertyValue(CSSPropertyWebkitMaskSize, new ApplyPropertyFillLayer<FillSize>(CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
344 &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize));
345
346 setPropertyValue(CSSPropertyWebkitMaskPositionX, new ApplyPropertyFillLayer<Length>(CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
347 &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSStyleSelector::mapFillXPosition));
348 setPropertyValue(CSSPropertyWebkitMaskPositionY, new ApplyPropertyFillLayer<Length>(CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
349 &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSStyleSelector::mapFillYPosition));
350 setPropertyValue(CSSPropertyWebkitMaskPosition, new ApplyPropertyExpandingSuppressValue(propertyValue(CSSPropertyWebkitMaskPositionX), propertyValue(CSSPropertyWebkitMaskPositionY)));
351
352 setPropertyValue(CSSPropertyWebkitMaskRepeatX, new ApplyPropertyFillLayer<EFillRepeat>(CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
353 &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSStyleSelector::mapFillRepeatX));
354 setPropertyValue(CSSPropertyWebkitMaskRepeatY, new ApplyPropertyFillLayer<EFillRepeat>(CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
355 &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSStyleSelector::mapFillRepeatY));
356 setPropertyValue(CSSPropertyWebkitMaskRepeat, new ApplyPropertyExpandingSuppressValue(propertyValue(CSSPropertyBackgroundRepeatX), propertyValue(CSSPropertyBackgroundRepeatY)));
357
358 setPropertyValue(CSSPropertyWebkitMaskSize, new ApplyPropertyFillLayer<FillSize>(CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
359 &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize));
360
361 setPropertyValue(CSSPropertyBackgroundColor, new ApplyPropertyColorBase(&RenderStyle::backgroundColor, 0, &RenderStyle::setBackgroundColor));
362 setPropertyValue(CSSPropertyBorderBottomColor, new ApplyPropertyColorBase(&RenderStyle::borderBottomColor, &RenderStyle::color, &RenderStyle::setBorderBottomColor));
363 setPropertyValue(CSSPropertyBorderLeftColor, new ApplyPropertyColorBase(&RenderStyle::borderLeftColor, &RenderStyle::color, &RenderStyle::setBorderLeftColor));
364 setPropertyValue(CSSPropertyBorderRightColor, new ApplyPropertyColorBase(&RenderStyle::borderRightColor, &RenderStyle::color, &RenderStyle::setBorderRightColor));
365 setPropertyValue(CSSPropertyBorderTopColor, new ApplyPropertyColorBase(&RenderStyle::borderTopColor, &RenderStyle::color, &RenderStyle::setBorderTopColor));
366
367 setPropertyValue(CSSPropertyBorderTopStyle, new ApplyPropertyDefault<EBorderStyle>(&RenderStyle::borderTopStyle, &RenderStyle::setBorderTopStyle, &RenderStyle::initialBorderStyle));
368 setPropertyValue(CSSPropertyBorderRightStyle, new ApplyPropertyDefault<EBorderStyle>(&RenderStyle::borderRightStyle, &RenderStyle::setBorderRightStyle, &RenderStyle::initialBorderStyle));
369 setPropertyValue(CSSPropertyBorderBottomStyle, new ApplyPropertyDefault<EBorderStyle>(&RenderStyle::borderBottomStyle, &RenderStyle::setBorderBottomStyle, &RenderStyle::initialBorderStyle));
370 setPropertyValue(CSSPropertyBorderLeftStyle, new ApplyPropertyDefault<EBorderStyle>(&RenderStyle::borderLeftStyle, &RenderStyle::setBorderLeftStyle, &RenderStyle::initialBorderStyle));
371
372 setPropertyValue(CSSPropertyOutlineColor, new ApplyPropertyColorBase(&RenderStyle::outlineColor, &RenderStyle::color, &RenderStyle::setOutlineColor));
373
374 setPropertyValue(CSSPropertyOverflowX, new ApplyPropertyDefault<EOverflow>(&RenderStyle::overflowX, &RenderStyle::setOverflowX, &RenderStyle::initialOverflowX));
375 setPropertyValue(CSSPropertyOverflowY, new ApplyPropertyDefault<EOverflow>(&RenderStyle::overflowY, &RenderStyle::setOverflowY, &RenderStyle::initialOverflowY));
376 setPropertyValue(CSSPropertyOverflow, new ApplyPropertyExpanding(propertyValue(CSSPropertyOverflowX), propertyValue(CSSPropertyOverflowY)));
377
378 setPropertyValue(CSSPropertyWebkitColumnRuleColor, new ApplyPropertyColorBase(&RenderStyle::columnRuleColor, &RenderStyle::color, &RenderStyle::setColumnRuleColor));
379 setPropertyValue(CSSPropertyWebkitTextEmphasisColor, new ApplyPropertyColorBase(&RenderStyle::textEmphasisColor, &RenderStyle::color, &RenderStyle::setTextEmphasisColor));
380 setPropertyValue(CSSPropertyWebkitTextFillColor, new ApplyPropertyColorBase(&RenderStyle::textFillColor, &RenderStyle::color, &RenderStyle::setTextFillColor));
381 setPropertyValue(CSSPropertyWebkitTextStrokeColor, new ApplyPropertyColorBase(&RenderStyle::textStrokeColor, &RenderStyle::color, &RenderStyle::setTextStrokeColor));
382 }
383
384
385 }
386