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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 if (value->isValueList()) { | 184 if (value->isValueList()) { |
185 CSSValueList* list = toCSSValueList(value); | 185 CSSValueList* list = toCSSValueList(value); |
186 int len = list->length(); | 186 int len = list->length(); |
187 state.style()->setCursor(CURSOR_AUTO); | 187 state.style()->setCursor(CURSOR_AUTO); |
188 for (int i = 0; i < len; i++) { | 188 for (int i = 0; i < len; i++) { |
189 CSSValue* item = list->item(i); | 189 CSSValue* item = list->item(i); |
190 if (item->isCursorImageValue()) { | 190 if (item->isCursorImageValue()) { |
191 CSSCursorImageValue* image = toCSSCursorImageValue(item); | 191 CSSCursorImageValue* image = toCSSCursorImageValue(item); |
192 if (image->updateIfSVGCursorIsUsed(state.element())) // Elements
with SVG cursors are not allowed to share style. | 192 if (image->updateIfSVGCursorIsUsed(state.element())) // Elements
with SVG cursors are not allowed to share style. |
193 state.style()->setUnique(); | 193 state.style()->setUnique(); |
194 state.style()->addCursor(state.styleImage(CSSPropertyCursor, ima
ge), image->hotSpotSpecified(), image->hotSpot()); | 194 state.style()->addCursor(state.styleImage(CSSPropertyCursor, *im
age), image->hotSpotSpecified(), image->hotSpot()); |
195 } else { | 195 } else { |
196 state.style()->setCursor(*toCSSPrimitiveValue(item)); | 196 state.style()->setCursor(*toCSSPrimitiveValue(item)); |
197 } | 197 } |
198 } | 198 } |
199 } else { | 199 } else { |
200 state.style()->setCursor(*toCSSPrimitiveValue(value)); | 200 state.style()->setCursor(*toCSSPrimitiveValue(value)); |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 void StyleBuilderFunctions::applyValueCSSPropertyDirection(StyleResolverState& s
tate, CSSValue* value) | 204 void StyleBuilderFunctions::applyValueCSSPropertyDirection(StyleResolverState& s
tate, CSSValue* value) |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 state.style()->setNamedGridColumnLines(namedGridColumnLines); | 248 state.style()->setNamedGridColumnLines(namedGridColumnLines); |
249 state.style()->setNamedGridRowLines(namedGridRowLines); | 249 state.style()->setNamedGridRowLines(namedGridRowLines); |
250 | 250 |
251 state.style()->setNamedGridArea(newNamedGridAreas); | 251 state.style()->setNamedGridArea(newNamedGridAreas); |
252 state.style()->setNamedGridAreaRowCount(gridTemplateAreasValue->rowCount()); | 252 state.style()->setNamedGridAreaRowCount(gridTemplateAreasValue->rowCount()); |
253 state.style()->setNamedGridAreaColumnCount(gridTemplateAreasValue->columnCou
nt()); | 253 state.style()->setNamedGridAreaColumnCount(gridTemplateAreasValue->columnCou
nt()); |
254 } | 254 } |
255 | 255 |
256 void StyleBuilderFunctions::applyValueCSSPropertyListStyleImage(StyleResolverSta
te& state, CSSValue* value) | 256 void StyleBuilderFunctions::applyValueCSSPropertyListStyleImage(StyleResolverSta
te& state, CSSValue* value) |
257 { | 257 { |
258 state.style()->setListStyleImage(state.styleImage(CSSPropertyListStyleImage,
value)); | 258 state.style()->setListStyleImage(state.styleImage(CSSPropertyListStyleImage,
*value)); |
259 } | 259 } |
260 | 260 |
261 void StyleBuilderFunctions::applyInitialCSSPropertyOutlineStyle(StyleResolverSta
te& state) | 261 void StyleBuilderFunctions::applyInitialCSSPropertyOutlineStyle(StyleResolverSta
te& state) |
262 { | 262 { |
263 state.style()->setOutlineStyleIsAuto(ComputedStyle::initialOutlineStyleIsAut
o()); | 263 state.style()->setOutlineStyleIsAuto(ComputedStyle::initialOutlineStyleIsAut
o()); |
264 state.style()->setOutlineStyle(ComputedStyle::initialBorderStyle()); | 264 state.style()->setOutlineStyle(ComputedStyle::initialBorderStyle()); |
265 } | 265 } |
266 | 266 |
267 void StyleBuilderFunctions::applyInheritCSSPropertyOutlineStyle(StyleResolverSta
te& state) | 267 void StyleBuilderFunctions::applyInheritCSSPropertyOutlineStyle(StyleResolverSta
te& state) |
268 { | 268 { |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 // note is a reminder that eventually "inherit" needs to be supported. | 699 // note is a reminder that eventually "inherit" needs to be supported. |
700 } | 700 } |
701 | 701 |
702 void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta
te, CSSValue* value) | 702 void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta
te, CSSValue* value) |
703 { | 703 { |
704 // list of string, uri, counter, attr, i | 704 // list of string, uri, counter, attr, i |
705 | 705 |
706 bool didSet = false; | 706 bool didSet = false; |
707 for (auto& item : toCSSValueList(*value)) { | 707 for (auto& item : toCSSValueList(*value)) { |
708 if (item->isImageGeneratorValue()) { | 708 if (item->isImageGeneratorValue()) { |
709 state.style()->setContent(StyleGeneratedImage::create(toCSSImageGene
ratorValue(item.get())), didSet); | 709 state.style()->setContent(StyleGeneratedImage::create(toCSSImageGene
ratorValue(*item)), didSet); |
710 didSet = true; | 710 didSet = true; |
711 } else if (item->isImageSetValue()) { | 711 } else if (item->isImageSetValue()) { |
712 state.style()->setContent(state.elementStyleResources().setOrPending
FromValue(CSSPropertyContent, toCSSImageSetValue(item.get())), didSet); | 712 state.style()->setContent(state.elementStyleResources().setOrPending
FromValue(CSSPropertyContent, toCSSImageSetValue(*item)), didSet); |
713 didSet = true; | 713 didSet = true; |
714 } | 714 } |
715 | 715 |
716 if (item->isImageValue()) { | 716 if (item->isImageValue()) { |
717 state.style()->setContent(state.elementStyleResources().cachedOrPend
ingFromValue(state.document(), CSSPropertyContent, toCSSImageValue(item.get())),
didSet); | 717 state.style()->setContent(state.elementStyleResources().cachedOrPend
ingFromValue(state.document(), CSSPropertyContent, toCSSImageValue(*item)), didS
et); |
718 didSet = true; | 718 didSet = true; |
719 continue; | 719 continue; |
720 } | 720 } |
721 | 721 |
722 if (item->isCounterValue()) { | 722 if (item->isCounterValue()) { |
723 CSSCounterValue* counterValue = toCSSCounterValue(item.get()); | 723 CSSCounterValue* counterValue = toCSSCounterValue(item.get()); |
724 EListStyleType listStyleType = NoneListStyle; | 724 EListStyleType listStyleType = NoneListStyle; |
725 CSSValueID listStyleIdent = counterValue->listStyle(); | 725 CSSValueID listStyleIdent = counterValue->listStyle(); |
726 if (listStyleIdent != CSSValueNone) | 726 if (listStyleIdent != CSSValueNone) |
727 listStyleType = static_cast<EListStyleType>(listStyleIdent - CSS
ValueDisc); | 727 listStyleType = static_cast<EListStyleType>(listStyleIdent - CSS
ValueDisc); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 return; | 846 return; |
847 case CSSValueSuper: | 847 case CSSValueSuper: |
848 svgStyle.setBaselineShift(BS_SUPER); | 848 svgStyle.setBaselineShift(BS_SUPER); |
849 return; | 849 return; |
850 default: | 850 default: |
851 ASSERT_NOT_REACHED(); | 851 ASSERT_NOT_REACHED(); |
852 } | 852 } |
853 } | 853 } |
854 | 854 |
855 } // namespace blink | 855 } // namespace blink |
OLD | NEW |