OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 if (!value->isPrimitiveValue()) | 269 if (!value->isPrimitiveValue()) |
270 return; | 270 return; |
271 | 271 |
272 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 272 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
273 Length lineHeight; | 273 Length lineHeight; |
274 | 274 |
275 if (primitiveValue->getValueID() == CSSValueNormal) { | 275 if (primitiveValue->getValueID() == CSSValueNormal) { |
276 lineHeight = RenderStyle::initialLineHeight(); | 276 lineHeight = RenderStyle::initialLineHeight(); |
277 } else if (primitiveValue->isLength()) { | 277 } else if (primitiveValue->isLength()) { |
278 double multiplier = state.style()->effectiveZoom(); | 278 double multiplier = state.style()->effectiveZoom(); |
279 if (Frame* frame = state.document()->frame()) | 279 if (Frame* frame = state.document().frame()) |
280 multiplier *= frame->textZoomFactor(); | 280 multiplier *= frame->textZoomFactor(); |
281 lineHeight = primitiveValue->computeLength<Length>(state.style(), state.
rootElementStyle(), multiplier); | 281 lineHeight = primitiveValue->computeLength<Length>(state.style(), state.
rootElementStyle(), multiplier); |
282 } else if (primitiveValue->isPercentage()) { | 282 } else if (primitiveValue->isPercentage()) { |
283 // FIXME: percentage should not be restricted to an integer here. | 283 // FIXME: percentage should not be restricted to an integer here. |
284 lineHeight = Length((state.style()->fontSize() * primitiveValue->getIntV
alue()) / 100, Fixed); | 284 lineHeight = Length((state.style()->fontSize() * primitiveValue->getIntV
alue()) / 100, Fixed); |
285 } else if (primitiveValue->isNumber()) { | 285 } else if (primitiveValue->isNumber()) { |
286 // FIXME: number and percentage values should produce the same type of L
ength (ie. Fixed or Percent). | 286 // FIXME: number and percentage values should produce the same type of L
ength (ie. Fixed or Percent). |
287 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent); | 287 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent); |
288 } else if (primitiveValue->isViewportPercentageLength()) { | 288 } else if (primitiveValue->isViewportPercentageLength()) { |
289 lineHeight = primitiveValue->viewportPercentageLength(); | 289 lineHeight = primitiveValue->viewportPercentageLength(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 if (!value->isPrimitiveValue()) | 322 if (!value->isPrimitiveValue()) |
323 return; | 323 return; |
324 | 324 |
325 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 325 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
326 | 326 |
327 EResize r = RESIZE_NONE; | 327 EResize r = RESIZE_NONE; |
328 switch (primitiveValue->getValueID()) { | 328 switch (primitiveValue->getValueID()) { |
329 case 0: | 329 case 0: |
330 return; | 330 return; |
331 case CSSValueAuto: | 331 case CSSValueAuto: |
332 if (Settings* settings = state.document()->settings()) | 332 if (Settings* settings = state.document().settings()) |
333 r = settings->textAreasAreResizable() ? RESIZE_BOTH : RESIZE_NONE; | 333 r = settings->textAreasAreResizable() ? RESIZE_BOTH : RESIZE_NONE; |
334 break; | 334 break; |
335 default: | 335 default: |
336 r = *primitiveValue; | 336 r = *primitiveValue; |
337 } | 337 } |
338 state.style()->setResize(r); | 338 state.style()->setResize(r); |
339 } | 339 } |
340 | 340 |
341 static Length mmLength(double mm) { return CSSPrimitiveValue::create(mm, CSSPrim
itiveValue::CSS_MM)->computeLength<Length>(0, 0); } | 341 static Length mmLength(double mm) { return CSSPrimitiveValue::create(mm, CSSPrim
itiveValue::CSS_MM)->computeLength<Length>(0, 0); } |
342 static Length inchLength(double inch) { return CSSPrimitiveValue::create(inch, C
SSPrimitiveValue::CSS_IN)->computeLength<Length>(0, 0); } | 342 static Length inchLength(double inch) { return CSSPrimitiveValue::create(inch, C
SSPrimitiveValue::CSS_IN)->computeLength<Length>(0, 0); } |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 void StyleBuilderFunctions::applyValueCSSPropertyWebkitClipPath(StyleResolverSta
te& state, CSSValue* value) | 638 void StyleBuilderFunctions::applyValueCSSPropertyWebkitClipPath(StyleResolverSta
te& state, CSSValue* value) |
639 { | 639 { |
640 if (value->isPrimitiveValue()) { | 640 if (value->isPrimitiveValue()) { |
641 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 641 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
642 if (primitiveValue->getValueID() == CSSValueNone) { | 642 if (primitiveValue->getValueID() == CSSValueNone) { |
643 state.style()->setClipPath(0); | 643 state.style()->setClipPath(0); |
644 } else if (primitiveValue->isShape()) { | 644 } else if (primitiveValue->isShape()) { |
645 state.style()->setClipPath(ShapeClipPathOperation::create(basicShape
ForValue(state, primitiveValue->getShapeValue()))); | 645 state.style()->setClipPath(ShapeClipPathOperation::create(basicShape
ForValue(state, primitiveValue->getShapeValue()))); |
646 } else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_URI
) { | 646 } else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_URI
) { |
647 String cssURLValue = primitiveValue->getStringValue(); | 647 String cssURLValue = primitiveValue->getStringValue(); |
648 KURL url = state.document()->completeURL(cssURLValue); | 648 KURL url = state.document().completeURL(cssURLValue); |
649 // FIXME: It doesn't work with forward or external SVG references (s
ee https://bugs.webkit.org/show_bug.cgi?id=90405) | 649 // FIXME: It doesn't work with forward or external SVG references (s
ee https://bugs.webkit.org/show_bug.cgi?id=90405) |
650 state.style()->setClipPath(ReferenceClipPathOperation::create(cssURL
Value, url.fragmentIdentifier())); | 650 state.style()->setClipPath(ReferenceClipPathOperation::create(cssURL
Value, url.fragmentIdentifier())); |
651 } | 651 } |
652 } | 652 } |
653 } | 653 } |
654 | 654 |
655 void StyleBuilderFunctions::applyInitialCSSPropertyWebkitFontVariantLigatures(St
yleResolverState& state) | 655 void StyleBuilderFunctions::applyInitialCSSPropertyWebkitFontVariantLigatures(St
yleResolverState& state) |
656 { | 656 { |
657 state.fontBuilder().setFontVariantLigaturesInitial(); | 657 state.fontBuilder().setFontVariantLigaturesInitial(); |
658 } | 658 } |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 { | 1222 { |
1223 std::pair<CSSPropertyID, String> expression(id, value->serializeResolvingVar
iables(*state.style()->variables())); | 1223 std::pair<CSSPropertyID, String> expression(id, value->serializeResolvingVar
iables(*state.style()->variables())); |
1224 | 1224 |
1225 if (knownExpressions.contains(expression)) | 1225 if (knownExpressions.contains(expression)) |
1226 return; // cycle detected. | 1226 return; // cycle detected. |
1227 | 1227 |
1228 knownExpressions.append(expression); | 1228 knownExpressions.append(expression); |
1229 | 1229 |
1230 // FIXME: It would be faster not to re-parse from strings, but for now CSS p
roperty validation lives inside the parser so we do it there. | 1230 // FIXME: It would be faster not to re-parse from strings, but for now CSS p
roperty validation lives inside the parser so we do it there. |
1231 RefPtr<MutableStylePropertySet> resultSet = MutableStylePropertySet::create(
); | 1231 RefPtr<MutableStylePropertySet> resultSet = MutableStylePropertySet::create(
); |
1232 if (!CSSParser::parseValue(resultSet.get(), id, expression.second, false, st
ate.document())) | 1232 if (!CSSParser::parseValue(resultSet.get(), id, expression.second, false, &s
tate.document())) |
1233 return; // expression failed to parse. | 1233 return; // expression failed to parse. |
1234 | 1234 |
1235 for (unsigned i = 0; i < resultSet->propertyCount(); i++) { | 1235 for (unsigned i = 0; i < resultSet->propertyCount(); i++) { |
1236 StylePropertySet::PropertyReference property = resultSet->propertyAt(i); | 1236 StylePropertySet::PropertyReference property = resultSet->propertyAt(i); |
1237 if (property.id() != CSSPropertyVariable && hasVariableReference(propert
y.value())) { | 1237 if (property.id() != CSSPropertyVariable && hasVariableReference(propert
y.value())) { |
1238 resolveVariables(state, property.id(), property.value(), knownExpres
sions); | 1238 resolveVariables(state, property.id(), property.value(), knownExpres
sions); |
1239 } else { | 1239 } else { |
1240 StyleBuilder::applyProperty(property.id(), state, property.value()); | 1240 StyleBuilder::applyProperty(property.id(), state, property.value()); |
1241 // All properties become dependent on their parent style when they u
se variables. | 1241 // All properties become dependent on their parent style when they u
se variables. |
1242 state.style()->setHasExplicitlyInheritedProperties(); | 1242 state.style()->setHasExplicitlyInheritedProperties(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1307 } | 1307 } |
1308 | 1308 |
1309 if (!value->isValueList()) | 1309 if (!value->isValueList()) |
1310 return; | 1310 return; |
1311 | 1311 |
1312 bool didSet = false; | 1312 bool didSet = false; |
1313 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) { | 1313 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) { |
1314 CSSValue* item = i.value(); | 1314 CSSValue* item = i.value(); |
1315 if (item->isImageGeneratorValue()) { | 1315 if (item->isImageGeneratorValue()) { |
1316 if (item->isGradientValue()) | 1316 if (item->isGradientValue()) |
1317 state.style()->setContent(StyleGeneratedImage::create(st
atic_cast<CSSGradientValue*>(item)->gradientWithStylesResolved(state.document()-
>textLinkColors()).get()), didSet); | 1317 state.style()->setContent(StyleGeneratedImage::create(st
atic_cast<CSSGradientValue*>(item)->gradientWithStylesResolved(state.document().
textLinkColors()).get()), didSet); |
1318 else | 1318 else |
1319 state.style()->setContent(StyleGeneratedImage::create(st
atic_cast<CSSImageGeneratorValue*>(item)), didSet); | 1319 state.style()->setContent(StyleGeneratedImage::create(st
atic_cast<CSSImageGeneratorValue*>(item)), didSet); |
1320 didSet = true; | 1320 didSet = true; |
1321 } else if (item->isImageSetValue()) { | 1321 } else if (item->isImageSetValue()) { |
1322 state.style()->setContent(state.elementStyleResources().setO
rPendingFromValue(CSSPropertyContent, static_cast<CSSImageSetValue*>(item)), did
Set); | 1322 state.style()->setContent(state.elementStyleResources().setO
rPendingFromValue(CSSPropertyContent, static_cast<CSSImageSetValue*>(item)), did
Set); |
1323 didSet = true; | 1323 didSet = true; |
1324 } | 1324 } |
1325 | 1325 |
1326 if (item->isImageValue()) { | 1326 if (item->isImageValue()) { |
1327 state.style()->setContent(state.elementStyleResources().cach
edOrPendingFromValue(CSSPropertyContent, toCSSImageValue(item)), didSet); | 1327 state.style()->setContent(state.elementStyleResources().cach
edOrPendingFromValue(CSSPropertyContent, toCSSImageValue(item)), didSet); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1489 if (!currValue->isShadowValue()) | 1489 if (!currValue->isShadowValue()) |
1490 continue; | 1490 continue; |
1491 ShadowValue* item = static_cast<ShadowValue*>(currValue); | 1491 ShadowValue* item = static_cast<ShadowValue*>(currValue); |
1492 int x = item->x->computeLength<int>(state.style(), state.rootElement
Style(), zoomFactor); | 1492 int x = item->x->computeLength<int>(state.style(), state.rootElement
Style(), zoomFactor); |
1493 int y = item->y->computeLength<int>(state.style(), state.rootElement
Style(), zoomFactor); | 1493 int y = item->y->computeLength<int>(state.style(), state.rootElement
Style(), zoomFactor); |
1494 int blur = item->blur ? item->blur->computeLength<int>(state.style()
, state.rootElementStyle(), zoomFactor) : 0; | 1494 int blur = item->blur ? item->blur->computeLength<int>(state.style()
, state.rootElementStyle(), zoomFactor) : 0; |
1495 int spread = item->spread ? item->spread->computeLength<int>(state.s
tyle(), state.rootElementStyle(), zoomFactor) : 0; | 1495 int spread = item->spread ? item->spread->computeLength<int>(state.s
tyle(), state.rootElementStyle(), zoomFactor) : 0; |
1496 ShadowStyle shadowStyle = item->style && item->style->getValueID() =
= CSSValueInset ? Inset : Normal; | 1496 ShadowStyle shadowStyle = item->style && item->style->getValueID() =
= CSSValueInset ? Inset : Normal; |
1497 StyleColor color; | 1497 StyleColor color; |
1498 if (item->color) | 1498 if (item->color) |
1499 color = state.document()->textLinkColors().colorFromPrimitiveVal
ue(item->color.get()); | 1499 color = state.document().textLinkColors().colorFromPrimitiveValu
e(item->color.get()); |
1500 else if (state.style()) | 1500 else if (state.style()) |
1501 color = state.style()->color(); | 1501 color = state.style()->color(); |
1502 | 1502 |
1503 if (!color.isValid()) | 1503 if (!color.isValid()) |
1504 color = Color::transparent; | 1504 color = Color::transparent; |
1505 OwnPtr<ShadowData> shadow = ShadowData::create(IntPoint(x, y), blur,
spread, shadowStyle, color); | 1505 OwnPtr<ShadowData> shadow = ShadowData::create(IntPoint(x, y), blur,
spread, shadowStyle, color); |
1506 if (id == CSSPropertyTextShadow) | 1506 if (id == CSSPropertyTextShadow) |
1507 state.style()->setTextShadow(shadow.release(), i.index()); // ad
d to the list if this is not the first entry | 1507 state.style()->setTextShadow(shadow.release(), i.index()); // ad
d to the list if this is not the first entry |
1508 else | 1508 else |
1509 state.style()->setBoxShadow(shadow.release(), i.index()); // add
to the list if this is not the first entry | 1509 state.style()->setBoxShadow(shadow.release(), i.index()); // add
to the list if this is not the first entry |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1545 state.style()->setLocale(nullAtom); | 1545 state.style()->setLocale(nullAtom); |
1546 else | 1546 else |
1547 state.style()->setLocale(primitiveValue->getStringValue()); | 1547 state.style()->setLocale(primitiveValue->getStringValue()); |
1548 state.fontBuilder().setScript(state.style()->locale()); | 1548 state.fontBuilder().setScript(state.style()->locale()); |
1549 return; | 1549 return; |
1550 } | 1550 } |
1551 case CSSPropertyWebkitAppRegion: { | 1551 case CSSPropertyWebkitAppRegion: { |
1552 if (!primitiveValue || !primitiveValue->getValueID()) | 1552 if (!primitiveValue || !primitiveValue->getValueID()) |
1553 return; | 1553 return; |
1554 state.style()->setDraggableRegionMode(primitiveValue->getValueID() == CS
SValueDrag ? DraggableRegionDrag : DraggableRegionNoDrag); | 1554 state.style()->setDraggableRegionMode(primitiveValue->getValueID() == CS
SValueDrag ? DraggableRegionDrag : DraggableRegionNoDrag); |
1555 state.document()->setHasAnnotatedRegions(true); | 1555 state.document().setHasAnnotatedRegions(true); |
1556 return; | 1556 return; |
1557 } | 1557 } |
1558 case CSSPropertyWebkitTextStrokeWidth: { | 1558 case CSSPropertyWebkitTextStrokeWidth: { |
1559 HANDLE_INHERIT_AND_INITIAL(textStrokeWidth, TextStrokeWidth) | 1559 HANDLE_INHERIT_AND_INITIAL(textStrokeWidth, TextStrokeWidth) |
1560 float width = 0; | 1560 float width = 0; |
1561 switch (primitiveValue->getValueID()) { | 1561 switch (primitiveValue->getValueID()) { |
1562 case CSSValueThin: | 1562 case CSSValueThin: |
1563 case CSSValueMedium: | 1563 case CSSValueMedium: |
1564 case CSSValueThick: { | 1564 case CSSValueThick: { |
1565 double result = 1.0 / 48; | 1565 double result = 1.0 / 48; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1607 | 1607 |
1608 if (perspectiveValue >= 0.0f) | 1608 if (perspectiveValue >= 0.0f) |
1609 state.style()->setPerspective(perspectiveValue); | 1609 state.style()->setPerspective(perspectiveValue); |
1610 return; | 1610 return; |
1611 } | 1611 } |
1612 case CSSPropertyWebkitTapHighlightColor: { | 1612 case CSSPropertyWebkitTapHighlightColor: { |
1613 HANDLE_INHERIT_AND_INITIAL(tapHighlightColor, TapHighlightColor); | 1613 HANDLE_INHERIT_AND_INITIAL(tapHighlightColor, TapHighlightColor); |
1614 if (!primitiveValue) | 1614 if (!primitiveValue) |
1615 break; | 1615 break; |
1616 | 1616 |
1617 StyleColor col = state.document()->textLinkColors().colorFromPrimitiveVa
lue(primitiveValue); | 1617 StyleColor col = state.document().textLinkColors().colorFromPrimitiveVal
ue(primitiveValue); |
1618 state.style()->setTapHighlightColor(col); | 1618 state.style()->setTapHighlightColor(col); |
1619 return; | 1619 return; |
1620 } | 1620 } |
1621 case CSSPropertyInvalid: | 1621 case CSSPropertyInvalid: |
1622 return; | 1622 return; |
1623 // Directional properties are resolved by resolveDirectionAwareProperty() be
fore the switch. | 1623 // Directional properties are resolved by resolveDirectionAwareProperty() be
fore the switch. |
1624 case CSSPropertyWebkitBorderEndColor: | 1624 case CSSPropertyWebkitBorderEndColor: |
1625 case CSSPropertyWebkitBorderEndStyle: | 1625 case CSSPropertyWebkitBorderEndStyle: |
1626 case CSSPropertyWebkitBorderEndWidth: | 1626 case CSSPropertyWebkitBorderEndWidth: |
1627 case CSSPropertyWebkitBorderStartColor: | 1627 case CSSPropertyWebkitBorderStartColor: |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 return; | 1675 return; |
1676 | 1676 |
1677 // CSS Text Layout Module Level 3: Vertical writing support | 1677 // CSS Text Layout Module Level 3: Vertical writing support |
1678 case CSSPropertyWebkitWritingMode: { | 1678 case CSSPropertyWebkitWritingMode: { |
1679 HANDLE_INHERIT_AND_INITIAL(writingMode, WritingMode); | 1679 HANDLE_INHERIT_AND_INITIAL(writingMode, WritingMode); |
1680 | 1680 |
1681 if (primitiveValue) | 1681 if (primitiveValue) |
1682 state.setWritingMode(*primitiveValue); | 1682 state.setWritingMode(*primitiveValue); |
1683 | 1683 |
1684 // FIXME: It is not ok to modify document state while applying style. | 1684 // FIXME: It is not ok to modify document state while applying style. |
1685 if (state.element() && state.element() == state.document()->documentElem
ent()) | 1685 if (state.element() && state.element() == state.document().documentEleme
nt()) |
1686 state.document()->setWritingModeSetOnDocumentElement(true); | 1686 state.document().setWritingModeSetOnDocumentElement(true); |
1687 return; | 1687 return; |
1688 } | 1688 } |
1689 | 1689 |
1690 case CSSPropertyWebkitTextOrientation: { | 1690 case CSSPropertyWebkitTextOrientation: { |
1691 HANDLE_INHERIT_AND_INITIAL(textOrientation, TextOrientation); | 1691 HANDLE_INHERIT_AND_INITIAL(textOrientation, TextOrientation); |
1692 | 1692 |
1693 if (primitiveValue) | 1693 if (primitiveValue) |
1694 state.setTextOrientation(*primitiveValue); | 1694 state.setTextOrientation(*primitiveValue); |
1695 | 1695 |
1696 return; | 1696 return; |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 HANDLE_SVG_INHERIT_AND_INITIAL(stopOpacity, StopOpacity) | 2271 HANDLE_SVG_INHERIT_AND_INITIAL(stopOpacity, StopOpacity) |
2272 float f = 0.0f; | 2272 float f = 0.0f; |
2273 if (percentageOrNumberToFloat(primitiveValue, f)) | 2273 if (percentageOrNumberToFloat(primitiveValue, f)) |
2274 state.style()->accessSVGStyle()->setStopOpacity(f); | 2274 state.style()->accessSVGStyle()->setStopOpacity(f); |
2275 break; | 2275 break; |
2276 } | 2276 } |
2277 case CSSPropertyMarkerStart: | 2277 case CSSPropertyMarkerStart: |
2278 { | 2278 { |
2279 HANDLE_SVG_INHERIT_AND_INITIAL(markerStartResource, MarkerStartResource) | 2279 HANDLE_SVG_INHERIT_AND_INITIAL(markerStartResource, MarkerStartResource) |
2280 if (primitiveValue) | 2280 if (primitiveValue) |
2281 state.style()->accessSVGStyle()->setMarkerStartResource(fragmentIden
tifier(primitiveValue, state.document())); | 2281 state.style()->accessSVGStyle()->setMarkerStartResource(fragmentIden
tifier(primitiveValue, &state.document())); |
2282 break; | 2282 break; |
2283 } | 2283 } |
2284 case CSSPropertyMarkerMid: | 2284 case CSSPropertyMarkerMid: |
2285 { | 2285 { |
2286 HANDLE_SVG_INHERIT_AND_INITIAL(markerMidResource, MarkerMidResource) | 2286 HANDLE_SVG_INHERIT_AND_INITIAL(markerMidResource, MarkerMidResource) |
2287 if (primitiveValue) | 2287 if (primitiveValue) |
2288 state.style()->accessSVGStyle()->setMarkerMidResource(fragmentIdenti
fier(primitiveValue, state.document())); | 2288 state.style()->accessSVGStyle()->setMarkerMidResource(fragmentIdenti
fier(primitiveValue, &state.document())); |
2289 break; | 2289 break; |
2290 } | 2290 } |
2291 case CSSPropertyMarkerEnd: | 2291 case CSSPropertyMarkerEnd: |
2292 { | 2292 { |
2293 HANDLE_SVG_INHERIT_AND_INITIAL(markerEndResource, MarkerEndResource) | 2293 HANDLE_SVG_INHERIT_AND_INITIAL(markerEndResource, MarkerEndResource) |
2294 if (primitiveValue) | 2294 if (primitiveValue) |
2295 state.style()->accessSVGStyle()->setMarkerEndResource(fragmentIdenti
fier(primitiveValue, state.document())); | 2295 state.style()->accessSVGStyle()->setMarkerEndResource(fragmentIdenti
fier(primitiveValue, &state.document())); |
2296 break; | 2296 break; |
2297 } | 2297 } |
2298 case CSSPropertyStrokeMiterlimit: | 2298 case CSSPropertyStrokeMiterlimit: |
2299 { | 2299 { |
2300 HANDLE_SVG_INHERIT_AND_INITIAL(strokeMiterLimit, StrokeMiterLimit) | 2300 HANDLE_SVG_INHERIT_AND_INITIAL(strokeMiterLimit, StrokeMiterLimit) |
2301 float f = 0.0f; | 2301 float f = 0.0f; |
2302 if (numberToFloat(primitiveValue, f)) | 2302 if (numberToFloat(primitiveValue, f)) |
2303 state.style()->accessSVGStyle()->setStrokeMiterLimit(f); | 2303 state.style()->accessSVGStyle()->setStrokeMiterLimit(f); |
2304 break; | 2304 break; |
2305 } | 2305 } |
2306 case CSSPropertyFilter: | 2306 case CSSPropertyFilter: |
2307 { | 2307 { |
2308 HANDLE_SVG_INHERIT_AND_INITIAL(filterResource, FilterResource) | 2308 HANDLE_SVG_INHERIT_AND_INITIAL(filterResource, FilterResource) |
2309 if (primitiveValue) | 2309 if (primitiveValue) |
2310 state.style()->accessSVGStyle()->setFilterResource(fragmentIdentifie
r(primitiveValue, state.document())); | 2310 state.style()->accessSVGStyle()->setFilterResource(fragmentIdentifie
r(primitiveValue, &state.document())); |
2311 break; | 2311 break; |
2312 } | 2312 } |
2313 case CSSPropertyMask: | 2313 case CSSPropertyMask: |
2314 { | 2314 { |
2315 HANDLE_SVG_INHERIT_AND_INITIAL(maskerResource, MaskerResource) | 2315 HANDLE_SVG_INHERIT_AND_INITIAL(maskerResource, MaskerResource) |
2316 if (primitiveValue) | 2316 if (primitiveValue) |
2317 state.style()->accessSVGStyle()->setMaskerResource(fragmentIdentifie
r(primitiveValue, state.document())); | 2317 state.style()->accessSVGStyle()->setMaskerResource(fragmentIdentifie
r(primitiveValue, &state.document())); |
2318 break; | 2318 break; |
2319 } | 2319 } |
2320 case CSSPropertyClipPath: | 2320 case CSSPropertyClipPath: |
2321 { | 2321 { |
2322 HANDLE_SVG_INHERIT_AND_INITIAL(clipperResource, ClipperResource) | 2322 HANDLE_SVG_INHERIT_AND_INITIAL(clipperResource, ClipperResource) |
2323 if (primitiveValue) | 2323 if (primitiveValue) |
2324 state.style()->accessSVGStyle()->setClipperResource(fragmentIdentifi
er(primitiveValue, state.document())); | 2324 state.style()->accessSVGStyle()->setClipperResource(fragmentIdentifi
er(primitiveValue, &state.document())); |
2325 break; | 2325 break; |
2326 } | 2326 } |
2327 case CSSPropertyStopColor: | 2327 case CSSPropertyStopColor: |
2328 { | 2328 { |
2329 HANDLE_SVG_INHERIT_AND_INITIAL(stopColor, StopColor); | 2329 HANDLE_SVG_INHERIT_AND_INITIAL(stopColor, StopColor); |
2330 if (value->isSVGColor()) | 2330 if (value->isSVGColor()) |
2331 state.style()->accessSVGStyle()->setStopColor(colorFromSVGColorCSSVa
lue(static_cast<SVGColor*>(value), state.style()->color())); | 2331 state.style()->accessSVGStyle()->setStopColor(colorFromSVGColorCSSVa
lue(static_cast<SVGColor*>(value), state.style()->color())); |
2332 break; | 2332 break; |
2333 } | 2333 } |
2334 case CSSPropertyLightingColor: | 2334 case CSSPropertyLightingColor: |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2380 break; | 2380 break; |
2381 } | 2381 } |
2382 case CSSPropertyEnableBackground: | 2382 case CSSPropertyEnableBackground: |
2383 // Silently ignoring this property for now | 2383 // Silently ignoring this property for now |
2384 // http://bugs.webkit.org/show_bug.cgi?id=6022 | 2384 // http://bugs.webkit.org/show_bug.cgi?id=6022 |
2385 break; | 2385 break; |
2386 } | 2386 } |
2387 } | 2387 } |
2388 | 2388 |
2389 } // namespace WebCore | 2389 } // namespace WebCore |
OLD | NEW |