OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> | 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. | 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 case SpaceImageRule: | 398 case SpaceImageRule: |
399 return CSSValueSpace; | 399 return CSSValueSpace; |
400 default: | 400 default: |
401 return CSSValueStretch; | 401 return CSSValueStretch; |
402 } | 402 } |
403 } | 403 } |
404 | 404 |
405 static PassRefPtrWillBeRawPtr<CSSBorderImageSliceValue> valueForNinePieceImageSl
ice(const NinePieceImage& image) | 405 static PassRefPtrWillBeRawPtr<CSSBorderImageSliceValue> valueForNinePieceImageSl
ice(const NinePieceImage& image) |
406 { | 406 { |
407 // Create the slices. | 407 // Create the slices. |
408 RefPtr<CSSPrimitiveValue> top; | 408 RefPtrWillBeRawPtr<CSSPrimitiveValue> top; |
409 RefPtr<CSSPrimitiveValue> right; | 409 RefPtrWillBeRawPtr<CSSPrimitiveValue> right; |
410 RefPtr<CSSPrimitiveValue> bottom; | 410 RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom; |
411 RefPtr<CSSPrimitiveValue> left; | 411 RefPtrWillBeRawPtr<CSSPrimitiveValue> left; |
412 | 412 |
413 if (image.imageSlices().top().isPercent()) | 413 if (image.imageSlices().top().isPercent()) |
414 top = cssValuePool().createValue(image.imageSlices().top().value(), CSSP
rimitiveValue::CSS_PERCENTAGE); | 414 top = cssValuePool().createValue(image.imageSlices().top().value(), CSSP
rimitiveValue::CSS_PERCENTAGE); |
415 else | 415 else |
416 top = cssValuePool().createValue(image.imageSlices().top().value(), CSSP
rimitiveValue::CSS_NUMBER); | 416 top = cssValuePool().createValue(image.imageSlices().top().value(), CSSP
rimitiveValue::CSS_NUMBER); |
417 | 417 |
418 if (image.imageSlices().right() == image.imageSlices().top() && image.imageS
lices().bottom() == image.imageSlices().top() | 418 if (image.imageSlices().right() == image.imageSlices().top() && image.imageS
lices().bottom() == image.imageSlices().top() |
419 && image.imageSlices().left() == image.imageSlices().top()) { | 419 && image.imageSlices().left() == image.imageSlices().top()) { |
420 right = top; | 420 right = top; |
421 bottom = top; | 421 bottom = top; |
(...skipping 26 matching lines...) Expand all Loading... |
448 | 448 |
449 RefPtr<Quad> quad = Quad::create(); | 449 RefPtr<Quad> quad = Quad::create(); |
450 quad->setTop(top); | 450 quad->setTop(top); |
451 quad->setRight(right); | 451 quad->setRight(right); |
452 quad->setBottom(bottom); | 452 quad->setBottom(bottom); |
453 quad->setLeft(left); | 453 quad->setLeft(left); |
454 | 454 |
455 return CSSBorderImageSliceValue::create(cssValuePool().createValue(quad.rele
ase()), image.fill()); | 455 return CSSBorderImageSliceValue::create(cssValuePool().createValue(quad.rele
ase()), image.fill()); |
456 } | 456 } |
457 | 457 |
458 static PassRefPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(const BorderImag
eLengthBox& box, const RenderStyle& style) | 458 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(cons
t BorderImageLengthBox& box, const RenderStyle& style) |
459 { | 459 { |
460 // Create the slices. | 460 // Create the slices. |
461 RefPtr<CSSPrimitiveValue> top; | 461 RefPtrWillBeRawPtr<CSSPrimitiveValue> top; |
462 RefPtr<CSSPrimitiveValue> right; | 462 RefPtrWillBeRawPtr<CSSPrimitiveValue> right; |
463 RefPtr<CSSPrimitiveValue> bottom; | 463 RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom; |
464 RefPtr<CSSPrimitiveValue> left; | 464 RefPtrWillBeRawPtr<CSSPrimitiveValue> left; |
465 | 465 |
466 if (box.top().isNumber()) | 466 if (box.top().isNumber()) |
467 top = cssValuePool().createValue(box.top().number(), CSSPrimitiveValue::
CSS_NUMBER); | 467 top = cssValuePool().createValue(box.top().number(), CSSPrimitiveValue::
CSS_NUMBER); |
468 else | 468 else |
469 top = cssValuePool().createValue(box.top().length(), style); | 469 top = cssValuePool().createValue(box.top().length(), style); |
470 | 470 |
471 if (box.right() == box.top() && box.bottom() == box.top() && box.left() == b
ox.top()) { | 471 if (box.right() == box.top() && box.bottom() == box.top() && box.left() == b
ox.top()) { |
472 right = top; | 472 right = top; |
473 bottom = top; | 473 bottom = top; |
474 left = top; | 474 left = top; |
(...skipping 27 matching lines...) Expand all Loading... |
502 quad->setTop(top); | 502 quad->setTop(top); |
503 quad->setRight(right); | 503 quad->setRight(right); |
504 quad->setBottom(bottom); | 504 quad->setBottom(bottom); |
505 quad->setLeft(left); | 505 quad->setLeft(left); |
506 | 506 |
507 return cssValuePool().createValue(quad.release()); | 507 return cssValuePool().createValue(quad.release()); |
508 } | 508 } |
509 | 509 |
510 static PassRefPtr<CSSValue> valueForNinePieceImageRepeat(const NinePieceImage& i
mage) | 510 static PassRefPtr<CSSValue> valueForNinePieceImageRepeat(const NinePieceImage& i
mage) |
511 { | 511 { |
512 RefPtr<CSSPrimitiveValue> horizontalRepeat; | 512 RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontalRepeat; |
513 RefPtr<CSSPrimitiveValue> verticalRepeat; | 513 RefPtrWillBeRawPtr<CSSPrimitiveValue> verticalRepeat; |
514 | 514 |
515 horizontalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule(i
mage.horizontalRule())); | 515 horizontalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule(i
mage.horizontalRule())); |
516 if (image.horizontalRule() == image.verticalRule()) | 516 if (image.horizontalRule() == image.verticalRule()) |
517 verticalRepeat = horizontalRepeat; | 517 verticalRepeat = horizontalRepeat; |
518 else | 518 else |
519 verticalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule
(image.verticalRule())); | 519 verticalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule
(image.verticalRule())); |
520 return cssValuePool().createValue(Pair::create(horizontalRepeat.release(), v
erticalRepeat.release(), Pair::DropIdenticalValues)); | 520 return cssValuePool().createValue(Pair::create(horizontalRepeat.release(), v
erticalRepeat.release(), Pair::DropIdenticalValues)); |
521 } | 521 } |
522 | 522 |
523 static PassRefPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image,
const RenderStyle& style) | 523 static PassRefPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image,
const RenderStyle& style) |
(...skipping 14 matching lines...) Expand all Loading... |
538 | 538 |
539 // Create the border outset. | 539 // Create the border outset. |
540 RefPtr<CSSValue> outset = valueForNinePieceImageQuad(image.outset(), style); | 540 RefPtr<CSSValue> outset = valueForNinePieceImageQuad(image.outset(), style); |
541 | 541 |
542 // Create the repeat rules. | 542 // Create the repeat rules. |
543 RefPtr<CSSValue> repeat = valueForNinePieceImageRepeat(image); | 543 RefPtr<CSSValue> repeat = valueForNinePieceImageRepeat(image); |
544 | 544 |
545 return createBorderImageValue(imageValue.release(), imageSlices.release(), b
orderSlices.release(), outset.release(), repeat.release()); | 545 return createBorderImageValue(imageValue.release(), imageSlices.release(), b
orderSlices.release(), outset.release(), repeat.release()); |
546 } | 546 } |
547 | 547 |
548 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(double value,
const RenderStyle& style) | 548 inline static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(d
ouble value, const RenderStyle& style) |
549 { | 549 { |
550 return cssValuePool().createValue(adjustFloatForAbsoluteZoom(value, style),
CSSPrimitiveValue::CSS_PX); | 550 return cssValuePool().createValue(adjustFloatForAbsoluteZoom(value, style),
CSSPrimitiveValue::CSS_PX); |
551 } | 551 } |
552 | 552 |
553 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value
, const RenderStyle& style) | 553 inline static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(
double value, const RenderStyle& style) |
554 { | 554 { |
555 return cssValuePool().createValue(value / style.effectiveZoom(), CSSPrimitiv
eValue::CSS_NUMBER); | 555 return cssValuePool().createValue(value / style.effectiveZoom(), CSSPrimitiv
eValue::CSS_NUMBER); |
556 } | 556 } |
557 | 557 |
558 static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValueForLength(const Lengt
h& length, const RenderStyle& style) | 558 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> zoomAdjustedPixelValueForLength
(const Length& length, const RenderStyle& style) |
559 { | 559 { |
560 if (length.isFixed()) | 560 if (length.isFixed()) |
561 return zoomAdjustedPixelValue(length.value(), style); | 561 return zoomAdjustedPixelValue(length.value(), style); |
562 return cssValuePool().createValue(length, style); | 562 return cssValuePool().createValue(length, style); |
563 } | 563 } |
564 | 564 |
565 static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection
, const RenderStyle& style) | 565 static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection
, const RenderStyle& style) |
566 { | 566 { |
567 if (!reflection) | 567 if (!reflection) |
568 return cssValuePool().createIdentifierValue(CSSValueNone); | 568 return cssValuePool().createIdentifierValue(CSSValueNone); |
569 | 569 |
570 RefPtr<CSSPrimitiveValue> offset; | 570 RefPtrWillBeRawPtr<CSSPrimitiveValue> offset; |
571 if (reflection->offset().isPercent()) | 571 if (reflection->offset().isPercent()) |
572 offset = cssValuePool().createValue(reflection->offset().percent(), CSSP
rimitiveValue::CSS_PERCENTAGE); | 572 offset = cssValuePool().createValue(reflection->offset().percent(), CSSP
rimitiveValue::CSS_PERCENTAGE); |
573 else | 573 else |
574 offset = zoomAdjustedPixelValue(reflection->offset().value(), style); | 574 offset = zoomAdjustedPixelValue(reflection->offset().value(), style); |
575 | 575 |
576 RefPtr<CSSPrimitiveValue> direction; | 576 RefPtrWillBeRawPtr<CSSPrimitiveValue> direction; |
577 switch (reflection->direction()) { | 577 switch (reflection->direction()) { |
578 case ReflectionBelow: | 578 case ReflectionBelow: |
579 direction = cssValuePool().createIdentifierValue(CSSValueBelow); | 579 direction = cssValuePool().createIdentifierValue(CSSValueBelow); |
580 break; | 580 break; |
581 case ReflectionAbove: | 581 case ReflectionAbove: |
582 direction = cssValuePool().createIdentifierValue(CSSValueAbove); | 582 direction = cssValuePool().createIdentifierValue(CSSValueAbove); |
583 break; | 583 break; |
584 case ReflectionLeft: | 584 case ReflectionLeft: |
585 direction = cssValuePool().createIdentifierValue(CSSValueLeft); | 585 direction = cssValuePool().createIdentifierValue(CSSValueLeft); |
586 break; | 586 break; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 if (l.isAuto()) { | 637 if (l.isAuto()) { |
638 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. | 638 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. |
639 // In other words if left is auto and right is not auto, then left's com
puted value is negative right(). | 639 // In other words if left is auto and right is not auto, then left's com
puted value is negative right(). |
640 // So we should get the opposite length unit and see if it is auto. | 640 // So we should get the opposite length unit and see if it is auto. |
641 return cssValuePool().createValue(l); | 641 return cssValuePool().createValue(l); |
642 } | 642 } |
643 | 643 |
644 return zoomAdjustedPixelValueForLength(l, style); | 644 return zoomAdjustedPixelValueForLength(l, style); |
645 } | 645 } |
646 | 646 |
647 PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo
lor(const RenderStyle& style, const StyleColor& color) const | 647 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentCo
lorOrValidColor(const RenderStyle& style, const StyleColor& color) const |
648 { | 648 { |
649 // This function does NOT look at visited information, so that computed styl
e doesn't expose that. | 649 // This function does NOT look at visited information, so that computed styl
e doesn't expose that. |
650 return cssValuePool().createColorValue(color.resolve(style.color()).rgb()); | 650 return cssValuePool().createColorValue(color.resolve(style.color()).rgb()); |
651 } | 651 } |
652 | 652 |
653 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForBorderRadiusCorner(LengthSi
ze radius, const RenderStyle& style) | 653 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForBorderRadiusCorner(LengthSi
ze radius, const RenderStyle& style) |
654 { | 654 { |
655 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 655 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
656 if (radius.width().type() == Percent) | 656 if (radius.width().type() == Percent) |
657 list->append(cssValuePool().createValue(radius.width().percent(), CSSPri
mitiveValue::CSS_PERCENTAGE)); | 657 list->append(cssValuePool().createValue(radius.width().percent(), CSSPri
mitiveValue::CSS_PERCENTAGE)); |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 | 1179 |
1180 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier); | 1180 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier); |
1181 if (!style) | 1181 if (!style) |
1182 return false; | 1182 return false; |
1183 | 1183 |
1184 return style->fontDescription().useFixedDefaultSize(); | 1184 return style->fontDescription().useFixedDefaultSize(); |
1185 } | 1185 } |
1186 | 1186 |
1187 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadowData(const Shado
wData& shadow, const RenderStyle& style, bool useSpread) const | 1187 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadowData(const Shado
wData& shadow, const RenderStyle& style, bool useSpread) const |
1188 { | 1188 { |
1189 RefPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(shadow.x(), style); | 1189 RefPtrWillBeRawPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(shadow.x(),
style); |
1190 RefPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(shadow.y(), style); | 1190 RefPtrWillBeRawPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(shadow.y(),
style); |
1191 RefPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(shadow.blur(), style
); | 1191 RefPtrWillBeRawPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(shadow.b
lur(), style); |
1192 RefPtr<CSSPrimitiveValue> spread = useSpread ? zoomAdjustedPixelValue(shadow
.spread(), style) : PassRefPtr<CSSPrimitiveValue>(); | 1192 RefPtrWillBeRawPtr<CSSPrimitiveValue> spread = useSpread ? zoomAdjustedPixel
Value(shadow.spread(), style) : PassRefPtrWillBeRawPtr<CSSPrimitiveValue>(); |
1193 RefPtr<CSSPrimitiveValue> shadowStyle = shadow.style() == Normal ? PassRefPt
r<CSSPrimitiveValue>() : cssValuePool().createIdentifierValue(CSSValueInset); | 1193 RefPtrWillBeRawPtr<CSSPrimitiveValue> shadowStyle = shadow.style() == Normal
? PassRefPtrWillBeRawPtr<CSSPrimitiveValue>() : cssValuePool().createIdentifier
Value(CSSValueInset); |
1194 RefPtr<CSSPrimitiveValue> color = currentColorOrValidColor(style, shadow.col
or()); | 1194 RefPtrWillBeRawPtr<CSSPrimitiveValue> color = currentColorOrValidColor(style
, shadow.color()); |
1195 return CSSShadowValue::create(x.release(), y.release(), blur.release(), spre
ad.release(), shadowStyle.release(), color.release()); | 1195 return CSSShadowValue::create(x.release(), y.release(), blur.release(), spre
ad.release(), shadowStyle.release(), color.release()); |
1196 } | 1196 } |
1197 | 1197 |
1198 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadowList(const Shado
wList* shadowList, const RenderStyle& style, bool useSpread) const | 1198 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadowList(const Shado
wList* shadowList, const RenderStyle& style, bool useSpread) const |
1199 { | 1199 { |
1200 if (!shadowList) | 1200 if (!shadowList) |
1201 return cssValuePool().createIdentifierValue(CSSValueNone); | 1201 return cssValuePool().createIdentifierValue(CSSValueNone); |
1202 | 1202 |
1203 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 1203 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; |
1204 size_t shadowCount = shadowList->shadows().size(); | 1204 size_t shadowCount = shadowList->shadows().size(); |
(...skipping 17 matching lines...) Expand all Loading... |
1222 return CSSValueMonospace; | 1222 return CSSValueMonospace; |
1223 if (family == FontFamilyNames::webkit_pictograph) | 1223 if (family == FontFamilyNames::webkit_pictograph) |
1224 return CSSValueWebkitPictograph; | 1224 return CSSValueWebkitPictograph; |
1225 if (family == FontFamilyNames::webkit_sans_serif) | 1225 if (family == FontFamilyNames::webkit_sans_serif) |
1226 return CSSValueSansSerif; | 1226 return CSSValueSansSerif; |
1227 if (family == FontFamilyNames::webkit_serif) | 1227 if (family == FontFamilyNames::webkit_serif) |
1228 return CSSValueSerif; | 1228 return CSSValueSerif; |
1229 return CSSValueInvalid; | 1229 return CSSValueInvalid; |
1230 } | 1230 } |
1231 | 1231 |
1232 static PassRefPtr<CSSPrimitiveValue> valueForFamily(const AtomicString& family) | 1232 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFamily(const AtomicStri
ng& family) |
1233 { | 1233 { |
1234 if (CSSValueID familyIdentifier = identifierForFamily(family)) | 1234 if (CSSValueID familyIdentifier = identifierForFamily(family)) |
1235 return cssValuePool().createIdentifierValue(familyIdentifier); | 1235 return cssValuePool().createIdentifierValue(familyIdentifier); |
1236 return cssValuePool().createValue(family.string(), CSSPrimitiveValue::CSS_ST
RING); | 1236 return cssValuePool().createValue(family.string(), CSSPrimitiveValue::CSS_ST
RING); |
1237 } | 1237 } |
1238 | 1238 |
1239 static PassRefPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecorati
on) | 1239 static PassRefPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecorati
on) |
1240 { | 1240 { |
1241 // Blink value is ignored. | 1241 // Blink value is ignored. |
1242 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1242 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 | 1365 |
1366 static PassRefPtrWillBeRawPtr<CSSValueList> valueForFontFamily(RenderStyle& styl
e) | 1366 static PassRefPtrWillBeRawPtr<CSSValueList> valueForFontFamily(RenderStyle& styl
e) |
1367 { | 1367 { |
1368 const FontFamily& firstFamily = style.fontDescription().family(); | 1368 const FontFamily& firstFamily = style.fontDescription().family(); |
1369 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 1369 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; |
1370 for (const FontFamily* family = &firstFamily; family; family = family->next(
)) | 1370 for (const FontFamily* family = &firstFamily; family; family = family->next(
)) |
1371 list->append(valueForFamily(family->family())); | 1371 list->append(valueForFamily(family->family())); |
1372 return list.release(); | 1372 return list.release(); |
1373 } | 1373 } |
1374 | 1374 |
1375 static PassRefPtr<CSSPrimitiveValue> valueForLineHeight(RenderStyle& style) | 1375 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForLineHeight(RenderStyle&
style) |
1376 { | 1376 { |
1377 Length length = style.lineHeight(); | 1377 Length length = style.lineHeight(); |
1378 if (length.isNegative()) | 1378 if (length.isNegative()) |
1379 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1379 return cssValuePool().createIdentifierValue(CSSValueNormal); |
1380 | 1380 |
1381 return zoomAdjustedPixelValue(floatValueForLength(length, style.fontDescript
ion().specifiedSize()), style); | 1381 return zoomAdjustedPixelValue(floatValueForLength(length, style.fontDescript
ion().specifiedSize()), style); |
1382 } | 1382 } |
1383 | 1383 |
1384 static PassRefPtr<CSSPrimitiveValue> valueForFontSize(RenderStyle& style) | 1384 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontSize(RenderStyle& s
tyle) |
1385 { | 1385 { |
1386 return zoomAdjustedPixelValue(style.fontDescription().computedPixelSize(), s
tyle); | 1386 return zoomAdjustedPixelValue(style.fontDescription().computedPixelSize(), s
tyle); |
1387 } | 1387 } |
1388 | 1388 |
1389 static PassRefPtr<CSSPrimitiveValue> valueForFontStyle(RenderStyle& style) | 1389 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontStyle(RenderStyle&
style) |
1390 { | 1390 { |
1391 if (style.fontDescription().italic()) | 1391 if (style.fontDescription().italic()) |
1392 return cssValuePool().createIdentifierValue(CSSValueItalic); | 1392 return cssValuePool().createIdentifierValue(CSSValueItalic); |
1393 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1393 return cssValuePool().createIdentifierValue(CSSValueNormal); |
1394 } | 1394 } |
1395 | 1395 |
1396 static PassRefPtr<CSSPrimitiveValue> valueForFontVariant(RenderStyle& style) | 1396 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontVariant(RenderStyle
& style) |
1397 { | 1397 { |
1398 if (style.fontDescription().smallCaps()) | 1398 if (style.fontDescription().smallCaps()) |
1399 return cssValuePool().createIdentifierValue(CSSValueSmallCaps); | 1399 return cssValuePool().createIdentifierValue(CSSValueSmallCaps); |
1400 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1400 return cssValuePool().createIdentifierValue(CSSValueNormal); |
1401 } | 1401 } |
1402 | 1402 |
1403 static PassRefPtr<CSSPrimitiveValue> valueForFontWeight(RenderStyle& style) | 1403 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontWeight(RenderStyle&
style) |
1404 { | 1404 { |
1405 switch (style.fontDescription().weight()) { | 1405 switch (style.fontDescription().weight()) { |
1406 case FontWeight100: | 1406 case FontWeight100: |
1407 return cssValuePool().createIdentifierValue(CSSValue100); | 1407 return cssValuePool().createIdentifierValue(CSSValue100); |
1408 case FontWeight200: | 1408 case FontWeight200: |
1409 return cssValuePool().createIdentifierValue(CSSValue200); | 1409 return cssValuePool().createIdentifierValue(CSSValue200); |
1410 case FontWeight300: | 1410 case FontWeight300: |
1411 return cssValuePool().createIdentifierValue(CSSValue300); | 1411 return cssValuePool().createIdentifierValue(CSSValue300); |
1412 case FontWeightNormal: | 1412 case FontWeightNormal: |
1413 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1413 return cssValuePool().createIdentifierValue(CSSValueNormal); |
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3052 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, | 3052 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, |
3053 CSSPropertyB
ackgroundClip }; | 3053 CSSPropertyB
ackgroundClip }; |
3054 | 3054 |
3055 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated()
; | 3055 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated()
; |
3056 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); | 3056 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); |
3057 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); | 3057 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); |
3058 return list.release(); | 3058 return list.release(); |
3059 } | 3059 } |
3060 | 3060 |
3061 } // namespace WebCore | 3061 } // namespace WebCore |
OLD | NEW |