OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 { | 65 { |
66 if (value->isInitialValue()) { | 66 if (value->isInitialValue()) { |
67 layer->setAttachment(FillLayer::initialFillAttachment(layer->type())); | 67 layer->setAttachment(FillLayer::initialFillAttachment(layer->type())); |
68 return; | 68 return; |
69 } | 69 } |
70 | 70 |
71 if (!value->isPrimitiveValue()) | 71 if (!value->isPrimitiveValue()) |
72 return; | 72 return; |
73 | 73 |
74 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 74 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
75 switch (primitiveValue->getIdent()) { | 75 switch (primitiveValue->getValueID()) { |
76 case CSSValueFixed: | 76 case CSSValueFixed: |
77 layer->setAttachment(FixedBackgroundAttachment); | 77 layer->setAttachment(FixedBackgroundAttachment); |
78 break; | 78 break; |
79 case CSSValueScroll: | 79 case CSSValueScroll: |
80 layer->setAttachment(ScrollBackgroundAttachment); | 80 layer->setAttachment(ScrollBackgroundAttachment); |
81 break; | 81 break; |
82 case CSSValueLocal: | 82 case CSSValueLocal: |
83 layer->setAttachment(LocalBackgroundAttachment); | 83 layer->setAttachment(LocalBackgroundAttachment); |
84 break; | 84 break; |
85 default: | 85 default: |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } | 183 } |
184 | 184 |
185 void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value
) | 185 void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value
) |
186 { | 186 { |
187 if (!value->isPrimitiveValue()) { | 187 if (!value->isPrimitiveValue()) { |
188 layer->setSizeType(SizeNone); | 188 layer->setSizeType(SizeNone); |
189 return; | 189 return; |
190 } | 190 } |
191 | 191 |
192 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 192 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
193 if (primitiveValue->getIdent() == CSSValueContain) | 193 if (primitiveValue->getValueID() == CSSValueContain) |
194 layer->setSizeType(Contain); | 194 layer->setSizeType(Contain); |
195 else if (primitiveValue->getIdent() == CSSValueCover) | 195 else if (primitiveValue->getValueID() == CSSValueCover) |
196 layer->setSizeType(Cover); | 196 layer->setSizeType(Cover); |
197 else | 197 else |
198 layer->setSizeType(SizeLength); | 198 layer->setSizeType(SizeLength); |
199 | 199 |
200 LengthSize b = FillLayer::initialFillSizeLength(layer->type()); | 200 LengthSize b = FillLayer::initialFillSizeLength(layer->type()); |
201 | 201 |
202 if (value->isInitialValue() || primitiveValue->getIdent() == CSSValueContain
|| primitiveValue->getIdent() == CSSValueCover) { | 202 if (value->isInitialValue() || primitiveValue->getValueID() == CSSValueConta
in || primitiveValue->getValueID() == CSSValueCover) { |
203 layer->setSizeLength(b); | 203 layer->setSizeLength(b); |
204 return; | 204 return; |
205 } | 205 } |
206 | 206 |
207 float zoomFactor = style()->effectiveZoom(); | 207 float zoomFactor = style()->effectiveZoom(); |
208 | 208 |
209 Length firstLength; | 209 Length firstLength; |
210 Length secondLength; | 210 Length secondLength; |
211 | 211 |
212 if (Pair* pair = primitiveValue->getPairValue()) { | 212 if (Pair* pair = primitiveValue->getPairValue()) { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 { | 315 { |
316 if (value->isInitialValue()) { | 316 if (value->isInitialValue()) { |
317 layer->setDirection(CSSAnimationData::initialAnimationDirection()); | 317 layer->setDirection(CSSAnimationData::initialAnimationDirection()); |
318 return; | 318 return; |
319 } | 319 } |
320 | 320 |
321 if (!value->isPrimitiveValue()) | 321 if (!value->isPrimitiveValue()) |
322 return; | 322 return; |
323 | 323 |
324 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 324 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
325 switch (primitiveValue->getIdent()) { | 325 switch (primitiveValue->getValueID()) { |
326 case CSSValueNormal: | 326 case CSSValueNormal: |
327 layer->setDirection(CSSAnimationData::AnimationDirectionNormal); | 327 layer->setDirection(CSSAnimationData::AnimationDirectionNormal); |
328 break; | 328 break; |
329 case CSSValueAlternate: | 329 case CSSValueAlternate: |
330 layer->setDirection(CSSAnimationData::AnimationDirectionAlternate); | 330 layer->setDirection(CSSAnimationData::AnimationDirectionAlternate); |
331 break; | 331 break; |
332 case CSSValueReverse: | 332 case CSSValueReverse: |
333 layer->setDirection(CSSAnimationData::AnimationDirectionReverse); | 333 layer->setDirection(CSSAnimationData::AnimationDirectionReverse); |
334 break; | 334 break; |
335 case CSSValueAlternateReverse: | 335 case CSSValueAlternateReverse: |
336 layer->setDirection(CSSAnimationData::AnimationDirectionAlternateReverse
); | 336 layer->setDirection(CSSAnimationData::AnimationDirectionAlternateReverse
); |
337 break; | 337 break; |
| 338 default: |
| 339 break; |
338 } | 340 } |
339 } | 341 } |
340 | 342 |
341 void CSSToStyleMap::mapAnimationDuration(CSSAnimationData* animation, CSSValue*
value) | 343 void CSSToStyleMap::mapAnimationDuration(CSSAnimationData* animation, CSSValue*
value) |
342 { | 344 { |
343 if (value->isInitialValue()) { | 345 if (value->isInitialValue()) { |
344 animation->setDuration(CSSAnimationData::initialAnimationDuration()); | 346 animation->setDuration(CSSAnimationData::initialAnimationDuration()); |
345 return; | 347 return; |
346 } | 348 } |
347 | 349 |
348 if (!value->isPrimitiveValue()) | 350 if (!value->isPrimitiveValue()) |
349 return; | 351 return; |
350 | 352 |
351 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 353 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
352 animation->setDuration(primitiveValue->computeTime<double, CSSPrimitiveValue
::Seconds>()); | 354 animation->setDuration(primitiveValue->computeTime<double, CSSPrimitiveValue
::Seconds>()); |
353 } | 355 } |
354 | 356 |
355 void CSSToStyleMap::mapAnimationFillMode(CSSAnimationData* layer, CSSValue* valu
e) | 357 void CSSToStyleMap::mapAnimationFillMode(CSSAnimationData* layer, CSSValue* valu
e) |
356 { | 358 { |
357 if (value->isInitialValue()) { | 359 if (value->isInitialValue()) { |
358 layer->setFillMode(CSSAnimationData::initialAnimationFillMode()); | 360 layer->setFillMode(CSSAnimationData::initialAnimationFillMode()); |
359 return; | 361 return; |
360 } | 362 } |
361 | 363 |
362 if (!value->isPrimitiveValue()) | 364 if (!value->isPrimitiveValue()) |
363 return; | 365 return; |
364 | 366 |
365 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 367 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
366 switch (primitiveValue->getIdent()) { | 368 switch (primitiveValue->getValueID()) { |
367 case CSSValueNone: | 369 case CSSValueNone: |
368 layer->setFillMode(AnimationFillModeNone); | 370 layer->setFillMode(AnimationFillModeNone); |
369 break; | 371 break; |
370 case CSSValueForwards: | 372 case CSSValueForwards: |
371 layer->setFillMode(AnimationFillModeForwards); | 373 layer->setFillMode(AnimationFillModeForwards); |
372 break; | 374 break; |
373 case CSSValueBackwards: | 375 case CSSValueBackwards: |
374 layer->setFillMode(AnimationFillModeBackwards); | 376 layer->setFillMode(AnimationFillModeBackwards); |
375 break; | 377 break; |
376 case CSSValueBoth: | 378 case CSSValueBoth: |
377 layer->setFillMode(AnimationFillModeBoth); | 379 layer->setFillMode(AnimationFillModeBoth); |
378 break; | 380 break; |
| 381 default: |
| 382 break; |
379 } | 383 } |
380 } | 384 } |
381 | 385 |
382 void CSSToStyleMap::mapAnimationIterationCount(CSSAnimationData* animation, CSSV
alue* value) | 386 void CSSToStyleMap::mapAnimationIterationCount(CSSAnimationData* animation, CSSV
alue* value) |
383 { | 387 { |
384 if (value->isInitialValue()) { | 388 if (value->isInitialValue()) { |
385 animation->setIterationCount(CSSAnimationData::initialAnimationIteration
Count()); | 389 animation->setIterationCount(CSSAnimationData::initialAnimationIteration
Count()); |
386 return; | 390 return; |
387 } | 391 } |
388 | 392 |
389 if (!value->isPrimitiveValue()) | 393 if (!value->isPrimitiveValue()) |
390 return; | 394 return; |
391 | 395 |
392 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 396 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
393 if (primitiveValue->getIdent() == CSSValueInfinite) | 397 if (primitiveValue->getValueID() == CSSValueInfinite) |
394 animation->setIterationCount(CSSAnimationData::IterationCountInfinite); | 398 animation->setIterationCount(CSSAnimationData::IterationCountInfinite); |
395 else | 399 else |
396 animation->setIterationCount(primitiveValue->getFloatValue()); | 400 animation->setIterationCount(primitiveValue->getFloatValue()); |
397 } | 401 } |
398 | 402 |
399 void CSSToStyleMap::mapAnimationName(CSSAnimationData* layer, CSSValue* value) | 403 void CSSToStyleMap::mapAnimationName(CSSAnimationData* layer, CSSValue* value) |
400 { | 404 { |
401 if (value->isInitialValue()) { | 405 if (value->isInitialValue()) { |
402 layer->setName(CSSAnimationData::initialAnimationName()); | 406 layer->setName(CSSAnimationData::initialAnimationName()); |
403 return; | 407 return; |
404 } | 408 } |
405 | 409 |
406 if (!value->isPrimitiveValue()) | 410 if (!value->isPrimitiveValue()) |
407 return; | 411 return; |
408 | 412 |
409 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 413 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
410 if (primitiveValue->getIdent() == CSSValueNone) | 414 if (primitiveValue->getValueID() == CSSValueNone) |
411 layer->setIsNoneAnimation(true); | 415 layer->setIsNoneAnimation(true); |
412 else | 416 else |
413 layer->setName(primitiveValue->getStringValue()); | 417 layer->setName(primitiveValue->getStringValue()); |
414 } | 418 } |
415 | 419 |
416 void CSSToStyleMap::mapAnimationPlayState(CSSAnimationData* layer, CSSValue* val
ue) | 420 void CSSToStyleMap::mapAnimationPlayState(CSSAnimationData* layer, CSSValue* val
ue) |
417 { | 421 { |
418 if (value->isInitialValue()) { | 422 if (value->isInitialValue()) { |
419 layer->setPlayState(CSSAnimationData::initialAnimationPlayState()); | 423 layer->setPlayState(CSSAnimationData::initialAnimationPlayState()); |
420 return; | 424 return; |
421 } | 425 } |
422 | 426 |
423 if (!value->isPrimitiveValue()) | 427 if (!value->isPrimitiveValue()) |
424 return; | 428 return; |
425 | 429 |
426 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 430 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
427 EAnimPlayState playState = (primitiveValue->getIdent() == CSSValuePaused) ?
AnimPlayStatePaused : AnimPlayStatePlaying; | 431 EAnimPlayState playState = (primitiveValue->getValueID() == CSSValuePaused)
? AnimPlayStatePaused : AnimPlayStatePlaying; |
428 layer->setPlayState(playState); | 432 layer->setPlayState(playState); |
429 } | 433 } |
430 | 434 |
431 void CSSToStyleMap::mapAnimationProperty(CSSAnimationData* animation, CSSValue*
value) | 435 void CSSToStyleMap::mapAnimationProperty(CSSAnimationData* animation, CSSValue*
value) |
432 { | 436 { |
433 if (value->isInitialValue()) { | 437 if (value->isInitialValue()) { |
434 animation->setAnimationMode(CSSAnimationData::AnimateAll); | 438 animation->setAnimationMode(CSSAnimationData::AnimateAll); |
435 animation->setProperty(CSSPropertyInvalid); | 439 animation->setProperty(CSSPropertyInvalid); |
436 return; | 440 return; |
437 } | 441 } |
438 | 442 |
439 if (!value->isPrimitiveValue()) | 443 if (!value->isPrimitiveValue()) |
440 return; | 444 return; |
441 | 445 |
442 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 446 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
443 if (primitiveValue->getIdent() == CSSValueAll) { | 447 if (primitiveValue->getValueID() == CSSValueAll) { |
444 animation->setAnimationMode(CSSAnimationData::AnimateAll); | 448 animation->setAnimationMode(CSSAnimationData::AnimateAll); |
445 animation->setProperty(CSSPropertyInvalid); | 449 animation->setProperty(CSSPropertyInvalid); |
446 } else if (primitiveValue->getIdent() == CSSValueNone) { | 450 } else if (primitiveValue->getValueID() == CSSValueNone) { |
447 animation->setAnimationMode(CSSAnimationData::AnimateNone); | 451 animation->setAnimationMode(CSSAnimationData::AnimateNone); |
448 animation->setProperty(CSSPropertyInvalid); | 452 animation->setProperty(CSSPropertyInvalid); |
449 } else { | 453 } else { |
450 animation->setAnimationMode(CSSAnimationData::AnimateSingleProperty); | 454 animation->setAnimationMode(CSSAnimationData::AnimateSingleProperty); |
451 animation->setProperty(static_cast<CSSPropertyID>(primitiveValue->getIde
nt())); | 455 animation->setProperty(primitiveValue->getPropertyID()); |
452 } | 456 } |
453 } | 457 } |
454 | 458 |
455 void CSSToStyleMap::mapAnimationTimingFunction(CSSAnimationData* animation, CSSV
alue* value) | 459 void CSSToStyleMap::mapAnimationTimingFunction(CSSAnimationData* animation, CSSV
alue* value) |
456 { | 460 { |
457 if (value->isInitialValue()) { | 461 if (value->isInitialValue()) { |
458 animation->setTimingFunction(CSSAnimationData::initialAnimationTimingFun
ction()); | 462 animation->setTimingFunction(CSSAnimationData::initialAnimationTimingFun
ction()); |
459 return; | 463 return; |
460 } | 464 } |
461 | 465 |
462 if (value->isPrimitiveValue()) { | 466 if (value->isPrimitiveValue()) { |
463 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 467 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
464 switch (primitiveValue->getIdent()) { | 468 switch (primitiveValue->getValueID()) { |
465 case CSSValueLinear: | 469 case CSSValueLinear: |
466 animation->setTimingFunction(LinearTimingFunction::create()); | 470 animation->setTimingFunction(LinearTimingFunction::create()); |
467 break; | 471 break; |
468 case CSSValueEase: | 472 case CSSValueEase: |
469 animation->setTimingFunction(CubicBezierTimingFunction::preset(Cubic
BezierTimingFunction::Ease)); | 473 animation->setTimingFunction(CubicBezierTimingFunction::preset(Cubic
BezierTimingFunction::Ease)); |
470 break; | 474 break; |
471 case CSSValueEaseIn: | 475 case CSSValueEaseIn: |
472 animation->setTimingFunction(CubicBezierTimingFunction::preset(Cubic
BezierTimingFunction::EaseIn)); | 476 animation->setTimingFunction(CubicBezierTimingFunction::preset(Cubic
BezierTimingFunction::EaseIn)); |
473 break; | 477 break; |
474 case CSSValueEaseOut: | 478 case CSSValueEaseOut: |
475 animation->setTimingFunction(CubicBezierTimingFunction::preset(Cubic
BezierTimingFunction::EaseOut)); | 479 animation->setTimingFunction(CubicBezierTimingFunction::preset(Cubic
BezierTimingFunction::EaseOut)); |
476 break; | 480 break; |
477 case CSSValueEaseInOut: | 481 case CSSValueEaseInOut: |
478 animation->setTimingFunction(CubicBezierTimingFunction::preset(Cubic
BezierTimingFunction::EaseInOut)); | 482 animation->setTimingFunction(CubicBezierTimingFunction::preset(Cubic
BezierTimingFunction::EaseInOut)); |
479 break; | 483 break; |
480 case CSSValueStepStart: | 484 case CSSValueStepStart: |
481 animation->setTimingFunction(StepsTimingFunction::create(1, true)); | 485 animation->setTimingFunction(StepsTimingFunction::create(1, true)); |
482 break; | 486 break; |
483 case CSSValueStepEnd: | 487 case CSSValueStepEnd: |
484 animation->setTimingFunction(StepsTimingFunction::create(1, false)); | 488 animation->setTimingFunction(StepsTimingFunction::create(1, false)); |
485 break; | 489 break; |
| 490 default: |
| 491 break; |
486 } | 492 } |
487 return; | 493 return; |
488 } | 494 } |
489 | 495 |
490 if (value->isCubicBezierTimingFunctionValue()) { | 496 if (value->isCubicBezierTimingFunctionValue()) { |
491 CSSCubicBezierTimingFunctionValue* cubicTimingFunction = static_cast<CSS
CubicBezierTimingFunctionValue*>(value); | 497 CSSCubicBezierTimingFunctionValue* cubicTimingFunction = static_cast<CSS
CubicBezierTimingFunctionValue*>(value); |
492 animation->setTimingFunction(CubicBezierTimingFunction::create(cubicTimi
ngFunction->x1(), cubicTimingFunction->y1(), cubicTimingFunction->x2(), cubicTim
ingFunction->y2())); | 498 animation->setTimingFunction(CubicBezierTimingFunction::create(cubicTimi
ngFunction->x1(), cubicTimingFunction->y1(), cubicTimingFunction->x2(), cubicTim
ingFunction->y2())); |
493 } else if (value->isStepsTimingFunctionValue()) { | 499 } else if (value->isStepsTimingFunctionValue()) { |
494 CSSStepsTimingFunctionValue* stepsTimingFunction = static_cast<CSSStepsT
imingFunctionValue*>(value); | 500 CSSStepsTimingFunctionValue* stepsTimingFunction = static_cast<CSSStepsT
imingFunctionValue*>(value); |
495 animation->setTimingFunction(StepsTimingFunction::create(stepsTimingFunc
tion->numberOfSteps(), stepsTimingFunction->stepAtStart())); | 501 animation->setTimingFunction(StepsTimingFunction::create(stepsTimingFunc
tion->numberOfSteps(), stepsTimingFunction->stepAtStart())); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 // Retrieve the primitive value. | 606 // Retrieve the primitive value. |
601 CSSPrimitiveValue* borderWidths = toCSSPrimitiveValue(value); | 607 CSSPrimitiveValue* borderWidths = toCSSPrimitiveValue(value); |
602 | 608 |
603 // Set up a length box to represent our image slices. | 609 // Set up a length box to represent our image slices. |
604 LengthBox box; // Defaults to 'auto' so we don't have to handle that explici
tly below. | 610 LengthBox box; // Defaults to 'auto' so we don't have to handle that explici
tly below. |
605 Quad* slices = borderWidths->getQuadValue(); | 611 Quad* slices = borderWidths->getQuadValue(); |
606 if (slices->top()->isNumber()) | 612 if (slices->top()->isNumber()) |
607 box.m_top = Length(slices->top()->getIntValue(), Relative); | 613 box.m_top = Length(slices->top()->getIntValue(), Relative); |
608 else if (slices->top()->isPercentage()) | 614 else if (slices->top()->isPercentage()) |
609 box.m_top = Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_
PERCENTAGE), Percent); | 615 box.m_top = Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_
PERCENTAGE), Percent); |
610 else if (slices->top()->getIdent() != CSSValueAuto) | 616 else if (slices->top()->getValueID() != CSSValueAuto) |
611 box.m_top = slices->top()->computeLength<Length>(style(), rootElementSty
le(), zoom); | 617 box.m_top = slices->top()->computeLength<Length>(style(), rootElementSty
le(), zoom); |
612 | 618 |
613 if (slices->right()->isNumber()) | 619 if (slices->right()->isNumber()) |
614 box.m_right = Length(slices->right()->getIntValue(), Relative); | 620 box.m_right = Length(slices->right()->getIntValue(), Relative); |
615 else if (slices->right()->isPercentage()) | 621 else if (slices->right()->isPercentage()) |
616 box.m_right = Length(slices->right()->getDoubleValue(CSSPrimitiveValue::
CSS_PERCENTAGE), Percent); | 622 box.m_right = Length(slices->right()->getDoubleValue(CSSPrimitiveValue::
CSS_PERCENTAGE), Percent); |
617 else if (slices->right()->getIdent() != CSSValueAuto) | 623 else if (slices->right()->getValueID() != CSSValueAuto) |
618 box.m_right = slices->right()->computeLength<Length>(style(), rootElemen
tStyle(), zoom); | 624 box.m_right = slices->right()->computeLength<Length>(style(), rootElemen
tStyle(), zoom); |
619 | 625 |
620 if (slices->bottom()->isNumber()) | 626 if (slices->bottom()->isNumber()) |
621 box.m_bottom = Length(slices->bottom()->getIntValue(), Relative); | 627 box.m_bottom = Length(slices->bottom()->getIntValue(), Relative); |
622 else if (slices->bottom()->isPercentage()) | 628 else if (slices->bottom()->isPercentage()) |
623 box.m_bottom = Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue
::CSS_PERCENTAGE), Percent); | 629 box.m_bottom = Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue
::CSS_PERCENTAGE), Percent); |
624 else if (slices->bottom()->getIdent() != CSSValueAuto) | 630 else if (slices->bottom()->getValueID() != CSSValueAuto) |
625 box.m_bottom = slices->bottom()->computeLength<Length>(style(), rootElem
entStyle(), zoom); | 631 box.m_bottom = slices->bottom()->computeLength<Length>(style(), rootElem
entStyle(), zoom); |
626 | 632 |
627 if (slices->left()->isNumber()) | 633 if (slices->left()->isNumber()) |
628 box.m_left = Length(slices->left()->getIntValue(), Relative); | 634 box.m_left = Length(slices->left()->getIntValue(), Relative); |
629 else if (slices->left()->isPercentage()) | 635 else if (slices->left()->isPercentage()) |
630 box.m_left = Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CS
S_PERCENTAGE), Percent); | 636 box.m_left = Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CS
S_PERCENTAGE), Percent); |
631 else if (slices->left()->getIdent() != CSSValueAuto) | 637 else if (slices->left()->getValueID() != CSSValueAuto) |
632 box.m_left = slices->left()->computeLength<Length>(style(), rootElementS
tyle(), zoom); | 638 box.m_left = slices->left()->computeLength<Length>(style(), rootElementS
tyle(), zoom); |
633 | 639 |
634 return box; | 640 return box; |
635 } | 641 } |
636 | 642 |
637 void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& ima
ge) | 643 void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& ima
ge) |
638 { | 644 { |
639 if (!value || !value->isPrimitiveValue()) | 645 if (!value || !value->isPrimitiveValue()) |
640 return; | 646 return; |
641 | 647 |
642 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 648 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
643 Pair* pair = primitiveValue->getPairValue(); | 649 Pair* pair = primitiveValue->getPairValue(); |
644 if (!pair || !pair->first() || !pair->second()) | 650 if (!pair || !pair->first() || !pair->second()) |
645 return; | 651 return; |
646 | 652 |
647 int firstIdentifier = pair->first()->getIdent(); | 653 CSSValueID firstIdentifier = pair->first()->getValueID(); |
648 int secondIdentifier = pair->second()->getIdent(); | 654 CSSValueID secondIdentifier = pair->second()->getValueID(); |
649 | 655 |
650 ENinePieceImageRule horizontalRule; | 656 ENinePieceImageRule horizontalRule; |
651 switch (firstIdentifier) { | 657 switch (firstIdentifier) { |
652 case CSSValueStretch: | 658 case CSSValueStretch: |
653 horizontalRule = StretchImageRule; | 659 horizontalRule = StretchImageRule; |
654 break; | 660 break; |
655 case CSSValueRound: | 661 case CSSValueRound: |
656 horizontalRule = RoundImageRule; | 662 horizontalRule = RoundImageRule; |
657 break; | 663 break; |
658 case CSSValueSpace: | 664 case CSSValueSpace: |
(...skipping 17 matching lines...) Expand all Loading... |
676 verticalRule = SpaceImageRule; | 682 verticalRule = SpaceImageRule; |
677 break; | 683 break; |
678 default: // CSSValueRepeat | 684 default: // CSSValueRepeat |
679 verticalRule = RepeatImageRule; | 685 verticalRule = RepeatImageRule; |
680 break; | 686 break; |
681 } | 687 } |
682 image.setVerticalRule(verticalRule); | 688 image.setVerticalRule(verticalRule); |
683 } | 689 } |
684 | 690 |
685 }; | 691 }; |
OLD | NEW |