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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "core/css/StylePropertySet.h" | 58 #include "core/css/StylePropertySet.h" |
59 #include "core/css/StyleRule.h" | 59 #include "core/css/StyleRule.h" |
60 #include "core/css/resolver/ElementStyleResources.h" | 60 #include "core/css/resolver/ElementStyleResources.h" |
61 #include "core/css/resolver/FilterOperationResolver.h" | 61 #include "core/css/resolver/FilterOperationResolver.h" |
62 #include "core/css/resolver/FontBuilder.h" | 62 #include "core/css/resolver/FontBuilder.h" |
63 #include "core/css/resolver/StyleBuilder.h" | 63 #include "core/css/resolver/StyleBuilder.h" |
64 #include "core/css/resolver/TransformBuilder.h" | 64 #include "core/css/resolver/TransformBuilder.h" |
65 #include "core/frame/LocalFrame.h" | 65 #include "core/frame/LocalFrame.h" |
66 #include "core/frame/Settings.h" | 66 #include "core/frame/Settings.h" |
67 #include "core/layout/style/CounterContent.h" | 67 #include "core/layout/style/CounterContent.h" |
68 #include "core/layout/style/LayoutStyle.h" | 68 #include "core/layout/style/ComputedStyle.h" |
69 #include "core/layout/style/LayoutStyleConstants.h" | 69 #include "core/layout/style/ComputedStyleConstants.h" |
70 #include "core/layout/style/PathStyleMotionPath.h" | 70 #include "core/layout/style/PathStyleMotionPath.h" |
71 #include "core/layout/style/QuotesData.h" | 71 #include "core/layout/style/QuotesData.h" |
72 #include "core/layout/style/SVGLayoutStyle.h" | 72 #include "core/layout/style/SVGComputedStyle.h" |
73 #include "core/layout/style/StyleGeneratedImage.h" | 73 #include "core/layout/style/StyleGeneratedImage.h" |
74 #include "platform/fonts/FontDescription.h" | 74 #include "platform/fonts/FontDescription.h" |
75 #include "wtf/MathExtras.h" | 75 #include "wtf/MathExtras.h" |
76 #include "wtf/StdLibExtras.h" | 76 #include "wtf/StdLibExtras.h" |
77 #include "wtf/Vector.h" | 77 #include "wtf/Vector.h" |
78 | 78 |
79 namespace blink { | 79 namespace blink { |
80 | 80 |
81 namespace { | 81 namespace { |
82 | 82 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 isInherit = true; | 128 isInherit = true; |
129 else | 129 else |
130 isInitial = true; | 130 isInitial = true; |
131 } | 131 } |
132 | 132 |
133 StyleBuilder::applyProperty(id, state, value, isInitial, isInherit); | 133 StyleBuilder::applyProperty(id, state, value, isInitial, isInherit); |
134 } | 134 } |
135 | 135 |
136 void StyleBuilderFunctions::applyInitialCSSPropertyColor(StyleResolverState& sta
te) | 136 void StyleBuilderFunctions::applyInitialCSSPropertyColor(StyleResolverState& sta
te) |
137 { | 137 { |
138 Color color = LayoutStyle::initialColor(); | 138 Color color = ComputedStyle::initialColor(); |
139 if (state.applyPropertyToRegularStyle()) | 139 if (state.applyPropertyToRegularStyle()) |
140 state.style()->setColor(color); | 140 state.style()->setColor(color); |
141 if (state.applyPropertyToVisitedLinkStyle()) | 141 if (state.applyPropertyToVisitedLinkStyle()) |
142 state.style()->setVisitedLinkColor(color); | 142 state.style()->setVisitedLinkColor(color); |
143 } | 143 } |
144 | 144 |
145 void StyleBuilderFunctions::applyInheritCSSPropertyColor(StyleResolverState& sta
te) | 145 void StyleBuilderFunctions::applyInheritCSSPropertyColor(StyleResolverState& sta
te) |
146 { | 146 { |
147 Color color = state.parentStyle()->color(); | 147 Color color = state.parentStyle()->color(); |
148 if (state.applyPropertyToRegularStyle()) | 148 if (state.applyPropertyToRegularStyle()) |
(...skipping 12 matching lines...) Expand all Loading... |
161 } | 161 } |
162 | 162 |
163 if (state.applyPropertyToRegularStyle()) | 163 if (state.applyPropertyToRegularStyle()) |
164 state.style()->setColor(StyleBuilderConverter::convertColor(state, value
)); | 164 state.style()->setColor(StyleBuilderConverter::convertColor(state, value
)); |
165 if (state.applyPropertyToVisitedLinkStyle()) | 165 if (state.applyPropertyToVisitedLinkStyle()) |
166 state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(s
tate, value, true)); | 166 state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(s
tate, value, true)); |
167 } | 167 } |
168 | 168 |
169 void StyleBuilderFunctions::applyInitialCSSPropertyJustifyItems(StyleResolverSta
te& state) | 169 void StyleBuilderFunctions::applyInitialCSSPropertyJustifyItems(StyleResolverSta
te& state) |
170 { | 170 { |
171 state.style()->setJustifyItems(LayoutStyle::initialJustifyItems()); | 171 state.style()->setJustifyItems(ComputedStyle::initialJustifyItems()); |
172 state.style()->setJustifyItemsOverflowAlignment(LayoutStyle::initialJustifyI
temsOverflowAlignment()); | 172 state.style()->setJustifyItemsOverflowAlignment(ComputedStyle::initialJustif
yItemsOverflowAlignment()); |
173 state.style()->setJustifyItemsPositionType(LayoutStyle::initialJustifyItemsP
ositionType()); | 173 state.style()->setJustifyItemsPositionType(ComputedStyle::initialJustifyItem
sPositionType()); |
174 } | 174 } |
175 | 175 |
176 void StyleBuilderFunctions::applyInheritCSSPropertyJustifyItems(StyleResolverSta
te& state) | 176 void StyleBuilderFunctions::applyInheritCSSPropertyJustifyItems(StyleResolverSta
te& state) |
177 { | 177 { |
178 state.style()->setJustifyItems(state.parentStyle()->justifyItems()); | 178 state.style()->setJustifyItems(state.parentStyle()->justifyItems()); |
179 state.style()->setJustifyItemsOverflowAlignment(state.parentStyle()->justify
ItemsOverflowAlignment()); | 179 state.style()->setJustifyItemsOverflowAlignment(state.parentStyle()->justify
ItemsOverflowAlignment()); |
180 state.style()->setJustifyItemsPositionType(state.parentStyle()->justifyItems
PositionType()); | 180 state.style()->setJustifyItemsPositionType(state.parentStyle()->justifyItems
PositionType()); |
181 } | 181 } |
182 | 182 |
183 void StyleBuilderFunctions::applyValueCSSPropertyJustifyItems(StyleResolverState
& state, CSSValue* value) | 183 void StyleBuilderFunctions::applyValueCSSPropertyJustifyItems(StyleResolverState
& state, CSSValue* value) |
184 { | 184 { |
185 state.style()->setJustifyItems(LayoutStyle::initialJustifyItems()); | 185 state.style()->setJustifyItems(ComputedStyle::initialJustifyItems()); |
186 state.style()->setJustifyItemsOverflowAlignment(LayoutStyle::initialJustifyI
temsOverflowAlignment()); | 186 state.style()->setJustifyItemsOverflowAlignment(ComputedStyle::initialJustif
yItemsOverflowAlignment()); |
187 state.style()->setJustifyItemsPositionType(LayoutStyle::initialJustifyItemsP
ositionType()); | 187 state.style()->setJustifyItemsPositionType(ComputedStyle::initialJustifyItem
sPositionType()); |
188 | 188 |
189 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 189 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
190 if (Pair* pairValue = primitiveValue->getPairValue()) { | 190 if (Pair* pairValue = primitiveValue->getPairValue()) { |
191 if (pairValue->first()->getValueID() == CSSValueLegacy) { | 191 if (pairValue->first()->getValueID() == CSSValueLegacy) { |
192 state.style()->setJustifyItemsPositionType(LegacyPosition); | 192 state.style()->setJustifyItemsPositionType(LegacyPosition); |
193 state.style()->setJustifyItems(*pairValue->second()); | 193 state.style()->setJustifyItems(*pairValue->second()); |
194 } else { | 194 } else { |
195 state.style()->setJustifyItems(*pairValue->first()); | 195 state.style()->setJustifyItems(*pairValue->first()); |
196 state.style()->setJustifyItemsOverflowAlignment(*pairValue->second()
); | 196 state.style()->setJustifyItemsOverflowAlignment(*pairValue->second()
); |
197 } | 197 } |
198 } else { | 198 } else { |
199 state.style()->setJustifyItems(*primitiveValue); | 199 state.style()->setJustifyItems(*primitiveValue); |
200 } | 200 } |
201 } | 201 } |
202 | 202 |
203 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st
ate) | 203 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st
ate) |
204 { | 204 { |
205 state.style()->clearCursorList(); | 205 state.style()->clearCursorList(); |
206 state.style()->setCursor(LayoutStyle::initialCursor()); | 206 state.style()->setCursor(ComputedStyle::initialCursor()); |
207 } | 207 } |
208 | 208 |
209 void StyleBuilderFunctions::applyInheritCSSPropertyCursor(StyleResolverState& st
ate) | 209 void StyleBuilderFunctions::applyInheritCSSPropertyCursor(StyleResolverState& st
ate) |
210 { | 210 { |
211 state.style()->setCursor(state.parentStyle()->cursor()); | 211 state.style()->setCursor(state.parentStyle()->cursor()); |
212 state.style()->setCursorList(state.parentStyle()->cursors()); | 212 state.style()->setCursorList(state.parentStyle()->cursors()); |
213 } | 213 } |
214 | 214 |
215 void StyleBuilderFunctions::applyValueCSSPropertyCursor(StyleResolverState& stat
e, CSSValue* value) | 215 void StyleBuilderFunctions::applyValueCSSPropertyCursor(StyleResolverState& stat
e, CSSValue* value) |
216 { | 216 { |
(...skipping 26 matching lines...) Expand all Loading... |
243 void StyleBuilderFunctions::applyValueCSSPropertyGlyphOrientationVertical(StyleR
esolverState& state, CSSValue* value) | 243 void StyleBuilderFunctions::applyValueCSSPropertyGlyphOrientationVertical(StyleR
esolverState& state, CSSValue* value) |
244 { | 244 { |
245 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() ==
CSSValueAuto) | 245 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() ==
CSSValueAuto) |
246 state.style()->accessSVGStyle().setGlyphOrientationVertical(GO_AUTO); | 246 state.style()->accessSVGStyle().setGlyphOrientationVertical(GO_AUTO); |
247 else | 247 else |
248 state.style()->accessSVGStyle().setGlyphOrientationVertical(StyleBuilder
Converter::convertGlyphOrientation(state, value)); | 248 state.style()->accessSVGStyle().setGlyphOrientationVertical(StyleBuilder
Converter::convertGlyphOrientation(state, value)); |
249 } | 249 } |
250 | 250 |
251 void StyleBuilderFunctions::applyInitialCSSPropertyGridTemplateAreas(StyleResolv
erState& state) | 251 void StyleBuilderFunctions::applyInitialCSSPropertyGridTemplateAreas(StyleResolv
erState& state) |
252 { | 252 { |
253 state.style()->setNamedGridArea(LayoutStyle::initialNamedGridArea()); | 253 state.style()->setNamedGridArea(ComputedStyle::initialNamedGridArea()); |
254 state.style()->setNamedGridAreaRowCount(LayoutStyle::initialNamedGridAreaCou
nt()); | 254 state.style()->setNamedGridAreaRowCount(ComputedStyle::initialNamedGridAreaC
ount()); |
255 state.style()->setNamedGridAreaColumnCount(LayoutStyle::initialNamedGridArea
Count()); | 255 state.style()->setNamedGridAreaColumnCount(ComputedStyle::initialNamedGridAr
eaCount()); |
256 } | 256 } |
257 | 257 |
258 void StyleBuilderFunctions::applyInheritCSSPropertyGridTemplateAreas(StyleResolv
erState& state) | 258 void StyleBuilderFunctions::applyInheritCSSPropertyGridTemplateAreas(StyleResolv
erState& state) |
259 { | 259 { |
260 state.style()->setNamedGridArea(state.parentStyle()->namedGridArea()); | 260 state.style()->setNamedGridArea(state.parentStyle()->namedGridArea()); |
261 state.style()->setNamedGridAreaRowCount(state.parentStyle()->namedGridAreaRo
wCount()); | 261 state.style()->setNamedGridAreaRowCount(state.parentStyle()->namedGridAreaRo
wCount()); |
262 state.style()->setNamedGridAreaColumnCount(state.parentStyle()->namedGridAre
aColumnCount()); | 262 state.style()->setNamedGridAreaColumnCount(state.parentStyle()->namedGridAre
aColumnCount()); |
263 } | 263 } |
264 | 264 |
265 void StyleBuilderFunctions::applyValueCSSPropertyGridTemplateAreas(StyleResolver
State& state, CSSValue* value) | 265 void StyleBuilderFunctions::applyValueCSSPropertyGridTemplateAreas(StyleResolver
State& state, CSSValue* value) |
(...skipping 21 matching lines...) Expand all Loading... |
287 state.style()->setNamedGridAreaColumnCount(gridTemplateAreasValue->columnCou
nt()); | 287 state.style()->setNamedGridAreaColumnCount(gridTemplateAreasValue->columnCou
nt()); |
288 } | 288 } |
289 | 289 |
290 void StyleBuilderFunctions::applyValueCSSPropertyListStyleImage(StyleResolverSta
te& state, CSSValue* value) | 290 void StyleBuilderFunctions::applyValueCSSPropertyListStyleImage(StyleResolverSta
te& state, CSSValue* value) |
291 { | 291 { |
292 state.style()->setListStyleImage(state.styleImage(CSSPropertyListStyleImage,
value)); | 292 state.style()->setListStyleImage(state.styleImage(CSSPropertyListStyleImage,
value)); |
293 } | 293 } |
294 | 294 |
295 void StyleBuilderFunctions::applyInitialCSSPropertyOutlineStyle(StyleResolverSta
te& state) | 295 void StyleBuilderFunctions::applyInitialCSSPropertyOutlineStyle(StyleResolverSta
te& state) |
296 { | 296 { |
297 state.style()->setOutlineStyleIsAuto(LayoutStyle::initialOutlineStyleIsAuto(
)); | 297 state.style()->setOutlineStyleIsAuto(ComputedStyle::initialOutlineStyleIsAut
o()); |
298 state.style()->setOutlineStyle(LayoutStyle::initialBorderStyle()); | 298 state.style()->setOutlineStyle(ComputedStyle::initialBorderStyle()); |
299 } | 299 } |
300 | 300 |
301 void StyleBuilderFunctions::applyInheritCSSPropertyOutlineStyle(StyleResolverSta
te& state) | 301 void StyleBuilderFunctions::applyInheritCSSPropertyOutlineStyle(StyleResolverSta
te& state) |
302 { | 302 { |
303 state.style()->setOutlineStyleIsAuto(state.parentStyle()->outlineStyleIsAuto
()); | 303 state.style()->setOutlineStyleIsAuto(state.parentStyle()->outlineStyleIsAuto
()); |
304 state.style()->setOutlineStyle(state.parentStyle()->outlineStyle()); | 304 state.style()->setOutlineStyle(state.parentStyle()->outlineStyle()); |
305 } | 305 } |
306 | 306 |
307 void StyleBuilderFunctions::applyValueCSSPropertyOutlineStyle(StyleResolverState
& state, CSSValue* value) | 307 void StyleBuilderFunctions::applyValueCSSPropertyOutlineStyle(StyleResolverState
& state, CSSValue* value) |
308 { | 308 { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 | 456 |
457 void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent(StyleResolverState
& state) | 457 void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent(StyleResolverState
& state) |
458 { | 458 { |
459 state.style()->setTextIndent(state.parentStyle()->textIndent()); | 459 state.style()->setTextIndent(state.parentStyle()->textIndent()); |
460 state.style()->setTextIndentLine(state.parentStyle()->textIndentLine()); | 460 state.style()->setTextIndentLine(state.parentStyle()->textIndentLine()); |
461 state.style()->setTextIndentType(state.parentStyle()->textIndentType()); | 461 state.style()->setTextIndentType(state.parentStyle()->textIndentType()); |
462 } | 462 } |
463 | 463 |
464 void StyleBuilderFunctions::applyInitialCSSPropertyTextIndent(StyleResolverState
& state) | 464 void StyleBuilderFunctions::applyInitialCSSPropertyTextIndent(StyleResolverState
& state) |
465 { | 465 { |
466 state.style()->setTextIndent(LayoutStyle::initialTextIndent()); | 466 state.style()->setTextIndent(ComputedStyle::initialTextIndent()); |
467 state.style()->setTextIndentLine(LayoutStyle::initialTextIndentLine()); | 467 state.style()->setTextIndentLine(ComputedStyle::initialTextIndentLine()); |
468 state.style()->setTextIndentType(LayoutStyle::initialTextIndentType()); | 468 state.style()->setTextIndentType(ComputedStyle::initialTextIndentType()); |
469 } | 469 } |
470 | 470 |
471 void StyleBuilderFunctions::applyValueCSSPropertyTextIndent(StyleResolverState&
state, CSSValue* value) | 471 void StyleBuilderFunctions::applyValueCSSPropertyTextIndent(StyleResolverState&
state, CSSValue* value) |
472 { | 472 { |
473 Length lengthOrPercentageValue; | 473 Length lengthOrPercentageValue; |
474 TextIndentLine textIndentLineValue = LayoutStyle::initialTextIndentLine(); | 474 TextIndentLine textIndentLineValue = ComputedStyle::initialTextIndentLine(); |
475 TextIndentType textIndentTypeValue = LayoutStyle::initialTextIndentType(); | 475 TextIndentType textIndentTypeValue = ComputedStyle::initialTextIndentType(); |
476 | 476 |
477 for (auto& listValue : toCSSValueList(*value)) { | 477 for (auto& listValue : toCSSValueList(*value)) { |
478 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(listValue.get())
; | 478 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(listValue.get())
; |
479 if (!primitiveValue->getValueID()) | 479 if (!primitiveValue->getValueID()) |
480 lengthOrPercentageValue = primitiveValue->convertToLength(state.cssT
oLengthConversionData()); | 480 lengthOrPercentageValue = primitiveValue->convertToLength(state.cssT
oLengthConversionData()); |
481 else if (primitiveValue->getValueID() == CSSValueEachLine) | 481 else if (primitiveValue->getValueID() == CSSValueEachLine) |
482 textIndentLineValue = TextIndentEachLine; | 482 textIndentLineValue = TextIndentEachLine; |
483 else if (primitiveValue->getValueID() == CSSValueHanging) | 483 else if (primitiveValue->getValueID() == CSSValueHanging) |
484 textIndentTypeValue = TextIndentHanging; | 484 textIndentTypeValue = TextIndentHanging; |
485 else | 485 else |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 } | 525 } |
526 | 526 |
527 void StyleBuilderFunctions::applyInheritCSSPropertyMotionRotation(StyleResolverS
tate& state) | 527 void StyleBuilderFunctions::applyInheritCSSPropertyMotionRotation(StyleResolverS
tate& state) |
528 { | 528 { |
529 state.style()->setMotionRotation(state.parentStyle()->motionRotation()); | 529 state.style()->setMotionRotation(state.parentStyle()->motionRotation()); |
530 state.style()->setMotionRotationType(state.parentStyle()->motionRotationType
()); | 530 state.style()->setMotionRotationType(state.parentStyle()->motionRotationType
()); |
531 } | 531 } |
532 | 532 |
533 void StyleBuilderFunctions::applyInitialCSSPropertyMotionRotation(StyleResolverS
tate& state) | 533 void StyleBuilderFunctions::applyInitialCSSPropertyMotionRotation(StyleResolverS
tate& state) |
534 { | 534 { |
535 state.style()->setMotionRotation(LayoutStyle::initialMotionRotation()); | 535 state.style()->setMotionRotation(ComputedStyle::initialMotionRotation()); |
536 state.style()->setMotionRotationType(LayoutStyle::initialMotionRotationType(
)); | 536 state.style()->setMotionRotationType(ComputedStyle::initialMotionRotationTyp
e()); |
537 } | 537 } |
538 | 538 |
539 void StyleBuilderFunctions::applyValueCSSPropertyMotionRotation(StyleResolverSta
te& state, CSSValue* value) | 539 void StyleBuilderFunctions::applyValueCSSPropertyMotionRotation(StyleResolverSta
te& state, CSSValue* value) |
540 { | 540 { |
541 float rotation = 0; | 541 float rotation = 0; |
542 MotionRotationType rotationType = MotionRotationFixed; | 542 MotionRotationType rotationType = MotionRotationFixed; |
543 | 543 |
544 ASSERT(value->isValueList()); | 544 ASSERT(value->isValueList()); |
545 CSSValueList* list = toCSSValueList(value); | 545 CSSValueList* list = toCSSValueList(value); |
546 int len = list->length(); | 546 int len = list->length(); |
(...skipping 29 matching lines...) Expand all Loading... |
576 | 576 |
577 if (primitiveValue->getValueID()) | 577 if (primitiveValue->getValueID()) |
578 state.style()->setVerticalAlign(*primitiveValue); | 578 state.style()->setVerticalAlign(*primitiveValue); |
579 else | 579 else |
580 state.style()->setVerticalAlignLength(primitiveValue->convertToLength(st
ate.cssToLengthConversionData())); | 580 state.style()->setVerticalAlignLength(primitiveValue->convertToLength(st
ate.cssToLengthConversionData())); |
581 } | 581 } |
582 | 582 |
583 static void resetEffectiveZoom(StyleResolverState& state) | 583 static void resetEffectiveZoom(StyleResolverState& state) |
584 { | 584 { |
585 // Reset the zoom in effect. This allows the setZoom method to accurately co
mpute a new zoom in effect. | 585 // Reset the zoom in effect. This allows the setZoom method to accurately co
mpute a new zoom in effect. |
586 state.setEffectiveZoom(state.parentStyle() ? state.parentStyle()->effectiveZ
oom() : LayoutStyle::initialZoom()); | 586 state.setEffectiveZoom(state.parentStyle() ? state.parentStyle()->effectiveZ
oom() : ComputedStyle::initialZoom()); |
587 } | 587 } |
588 | 588 |
589 void StyleBuilderFunctions::applyInitialCSSPropertyZoom(StyleResolverState& stat
e) | 589 void StyleBuilderFunctions::applyInitialCSSPropertyZoom(StyleResolverState& stat
e) |
590 { | 590 { |
591 resetEffectiveZoom(state); | 591 resetEffectiveZoom(state); |
592 state.setZoom(LayoutStyle::initialZoom()); | 592 state.setZoom(ComputedStyle::initialZoom()); |
593 } | 593 } |
594 | 594 |
595 void StyleBuilderFunctions::applyInheritCSSPropertyZoom(StyleResolverState& stat
e) | 595 void StyleBuilderFunctions::applyInheritCSSPropertyZoom(StyleResolverState& stat
e) |
596 { | 596 { |
597 resetEffectiveZoom(state); | 597 resetEffectiveZoom(state); |
598 state.setZoom(state.parentStyle()->zoom()); | 598 state.setZoom(state.parentStyle()->zoom()); |
599 } | 599 } |
600 | 600 |
601 void StyleBuilderFunctions::applyValueCSSPropertyZoom(StyleResolverState& state,
CSSValue* value) | 601 void StyleBuilderFunctions::applyValueCSSPropertyZoom(StyleResolverState& state,
CSSValue* value) |
602 { | 602 { |
603 ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue()); | 603 ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue()); |
604 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 604 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
605 | 605 |
606 if (primitiveValue->getValueID() == CSSValueNormal) { | 606 if (primitiveValue->getValueID() == CSSValueNormal) { |
607 resetEffectiveZoom(state); | 607 resetEffectiveZoom(state); |
608 state.setZoom(LayoutStyle::initialZoom()); | 608 state.setZoom(ComputedStyle::initialZoom()); |
609 } else if (primitiveValue->getValueID() == CSSValueReset) { | 609 } else if (primitiveValue->getValueID() == CSSValueReset) { |
610 state.setEffectiveZoom(LayoutStyle::initialZoom()); | 610 state.setEffectiveZoom(ComputedStyle::initialZoom()); |
611 state.setZoom(LayoutStyle::initialZoom()); | 611 state.setZoom(ComputedStyle::initialZoom()); |
612 } else if (primitiveValue->getValueID() == CSSValueDocument) { | 612 } else if (primitiveValue->getValueID() == CSSValueDocument) { |
613 float docZoom = state.rootElementStyle() ? state.rootElementStyle()->zoo
m() : LayoutStyle::initialZoom(); | 613 float docZoom = state.rootElementStyle() ? state.rootElementStyle()->zoo
m() : ComputedStyle::initialZoom(); |
614 state.setEffectiveZoom(docZoom); | 614 state.setEffectiveZoom(docZoom); |
615 state.setZoom(docZoom); | 615 state.setZoom(docZoom); |
616 } else if (primitiveValue->isPercentage()) { | 616 } else if (primitiveValue->isPercentage()) { |
617 resetEffectiveZoom(state); | 617 resetEffectiveZoom(state); |
618 if (float percent = primitiveValue->getFloatValue()) | 618 if (float percent = primitiveValue->getFloatValue()) |
619 state.setZoom(percent / 100.0f); | 619 state.setZoom(percent / 100.0f); |
620 } else if (primitiveValue->isNumber()) { | 620 } else if (primitiveValue->isNumber()) { |
621 resetEffectiveZoom(state); | 621 resetEffectiveZoom(state); |
622 if (float number = primitiveValue->getFloatValue()) | 622 if (float number = primitiveValue->getFloatValue()) |
623 state.setZoom(number); | 623 state.setZoom(number); |
(...skipping 26 matching lines...) Expand all Loading... |
650 | 650 |
651 void StyleBuilderFunctions::applyValueCSSPropertyWebkitFilter(StyleResolverState
& state, CSSValue* value) | 651 void StyleBuilderFunctions::applyValueCSSPropertyWebkitFilter(StyleResolverState
& state, CSSValue* value) |
652 { | 652 { |
653 FilterOperations operations; | 653 FilterOperations operations; |
654 if (FilterOperationResolver::createFilterOperations(value, state.cssToLength
ConversionData(), operations, state)) | 654 if (FilterOperationResolver::createFilterOperations(value, state.cssToLength
ConversionData(), operations, state)) |
655 state.style()->setFilter(operations); | 655 state.style()->setFilter(operations); |
656 } | 656 } |
657 | 657 |
658 void StyleBuilderFunctions::applyInitialCSSPropertyWebkitTextEmphasisStyle(Style
ResolverState& state) | 658 void StyleBuilderFunctions::applyInitialCSSPropertyWebkitTextEmphasisStyle(Style
ResolverState& state) |
659 { | 659 { |
660 state.style()->setTextEmphasisFill(LayoutStyle::initialTextEmphasisFill()); | 660 state.style()->setTextEmphasisFill(ComputedStyle::initialTextEmphasisFill())
; |
661 state.style()->setTextEmphasisMark(LayoutStyle::initialTextEmphasisMark()); | 661 state.style()->setTextEmphasisMark(ComputedStyle::initialTextEmphasisMark())
; |
662 state.style()->setTextEmphasisCustomMark(LayoutStyle::initialTextEmphasisCus
tomMark()); | 662 state.style()->setTextEmphasisCustomMark(ComputedStyle::initialTextEmphasisC
ustomMark()); |
663 } | 663 } |
664 | 664 |
665 void StyleBuilderFunctions::applyInheritCSSPropertyWebkitTextEmphasisStyle(Style
ResolverState& state) | 665 void StyleBuilderFunctions::applyInheritCSSPropertyWebkitTextEmphasisStyle(Style
ResolverState& state) |
666 { | 666 { |
667 state.style()->setTextEmphasisFill(state.parentStyle()->textEmphasisFill()); | 667 state.style()->setTextEmphasisFill(state.parentStyle()->textEmphasisFill()); |
668 state.style()->setTextEmphasisMark(state.parentStyle()->textEmphasisMark()); | 668 state.style()->setTextEmphasisMark(state.parentStyle()->textEmphasisMark()); |
669 state.style()->setTextEmphasisCustomMark(state.parentStyle()->textEmphasisCu
stomMark()); | 669 state.style()->setTextEmphasisCustomMark(state.parentStyle()->textEmphasisCu
stomMark()); |
670 } | 670 } |
671 | 671 |
672 void StyleBuilderFunctions::applyValueCSSPropertyWebkitTextEmphasisStyle(StyleRe
solverState& state, CSSValue* value) | 672 void StyleBuilderFunctions::applyValueCSSPropertyWebkitTextEmphasisStyle(StyleRe
solverState& state, CSSValue* value) |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 state.setWritingMode(*toCSSPrimitiveValue(value)); | 861 state.setWritingMode(*toCSSPrimitiveValue(value)); |
862 } | 862 } |
863 | 863 |
864 void StyleBuilderFunctions::applyValueCSSPropertyWebkitTextOrientation(StyleReso
lverState& state, CSSValue* value) | 864 void StyleBuilderFunctions::applyValueCSSPropertyWebkitTextOrientation(StyleReso
lverState& state, CSSValue* value) |
865 { | 865 { |
866 state.setTextOrientation(*toCSSPrimitiveValue(value)); | 866 state.setTextOrientation(*toCSSPrimitiveValue(value)); |
867 } | 867 } |
868 | 868 |
869 void StyleBuilderFunctions::applyInheritCSSPropertyBaselineShift(StyleResolverSt
ate& state) | 869 void StyleBuilderFunctions::applyInheritCSSPropertyBaselineShift(StyleResolverSt
ate& state) |
870 { | 870 { |
871 const SVGLayoutStyle& parentSvgStyle = state.parentStyle()->svgStyle(); | 871 const SVGComputedStyle& parentSvgStyle = state.parentStyle()->svgStyle(); |
872 EBaselineShift baselineShift = parentSvgStyle.baselineShift(); | 872 EBaselineShift baselineShift = parentSvgStyle.baselineShift(); |
873 SVGLayoutStyle& svgStyle = state.style()->accessSVGStyle(); | 873 SVGComputedStyle& svgStyle = state.style()->accessSVGStyle(); |
874 svgStyle.setBaselineShift(baselineShift); | 874 svgStyle.setBaselineShift(baselineShift); |
875 if (baselineShift == BS_LENGTH) | 875 if (baselineShift == BS_LENGTH) |
876 svgStyle.setBaselineShiftValue(parentSvgStyle.baselineShiftValue()); | 876 svgStyle.setBaselineShiftValue(parentSvgStyle.baselineShiftValue()); |
877 } | 877 } |
878 | 878 |
879 void StyleBuilderFunctions::applyValueCSSPropertyBaselineShift(StyleResolverStat
e& state, CSSValue* value) | 879 void StyleBuilderFunctions::applyValueCSSPropertyBaselineShift(StyleResolverStat
e& state, CSSValue* value) |
880 { | 880 { |
881 SVGLayoutStyle& svgStyle = state.style()->accessSVGStyle(); | 881 SVGComputedStyle& svgStyle = state.style()->accessSVGStyle(); |
882 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 882 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
883 if (!primitiveValue->isValueID()) { | 883 if (!primitiveValue->isValueID()) { |
884 svgStyle.setBaselineShift(BS_LENGTH); | 884 svgStyle.setBaselineShift(BS_LENGTH); |
885 svgStyle.setBaselineShiftValue(StyleBuilderConverter::convertLength(stat
e, primitiveValue)); | 885 svgStyle.setBaselineShiftValue(StyleBuilderConverter::convertLength(stat
e, primitiveValue)); |
886 return; | 886 return; |
887 } | 887 } |
888 switch (primitiveValue->getValueID()) { | 888 switch (primitiveValue->getValueID()) { |
889 case CSSValueBaseline: | 889 case CSSValueBaseline: |
890 svgStyle.setBaselineShift(BS_LENGTH); | 890 svgStyle.setBaselineShift(BS_LENGTH); |
891 svgStyle.setBaselineShiftValue(Length(Fixed)); | 891 svgStyle.setBaselineShiftValue(Length(Fixed)); |
892 return; | 892 return; |
893 case CSSValueSub: | 893 case CSSValueSub: |
894 svgStyle.setBaselineShift(BS_SUB); | 894 svgStyle.setBaselineShift(BS_SUB); |
895 return; | 895 return; |
896 case CSSValueSuper: | 896 case CSSValueSuper: |
897 svgStyle.setBaselineShift(BS_SUPER); | 897 svgStyle.setBaselineShift(BS_SUPER); |
898 return; | 898 return; |
899 default: | 899 default: |
900 ASSERT_NOT_REACHED(); | 900 ASSERT_NOT_REACHED(); |
901 } | 901 } |
902 } | 902 } |
903 | 903 |
904 } // namespace blink | 904 } // namespace blink |
OLD | NEW |