Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 57643004: Pass RenderStyle / RenderObject by reference in more places (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.h ('k') | Source/core/css/CSSValuePool.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 454
455 RefPtr<Quad> quad = Quad::create(); 455 RefPtr<Quad> quad = Quad::create();
456 quad->setTop(top); 456 quad->setTop(top);
457 quad->setRight(right); 457 quad->setRight(right);
458 quad->setBottom(bottom); 458 quad->setBottom(bottom);
459 quad->setLeft(left); 459 quad->setLeft(left);
460 460
461 return CSSBorderImageSliceValue::create(cssValuePool().createValue(quad.rele ase()), image.fill()); 461 return CSSBorderImageSliceValue::create(cssValuePool().createValue(quad.rele ase()), image.fill());
462 } 462 }
463 463
464 static PassRefPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(const BorderImag eLengthBox& box, const RenderStyle* style) 464 static PassRefPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(const BorderImag eLengthBox& box, const RenderStyle& style)
465 { 465 {
466 // Create the slices. 466 // Create the slices.
467 RefPtr<CSSPrimitiveValue> top; 467 RefPtr<CSSPrimitiveValue> top;
468 RefPtr<CSSPrimitiveValue> right; 468 RefPtr<CSSPrimitiveValue> right;
469 RefPtr<CSSPrimitiveValue> bottom; 469 RefPtr<CSSPrimitiveValue> bottom;
470 RefPtr<CSSPrimitiveValue> left; 470 RefPtr<CSSPrimitiveValue> left;
471 471
472 if (box.top().isNumber()) 472 if (box.top().isNumber())
473 top = cssValuePool().createValue(box.top().number(), CSSPrimitiveValue:: CSS_NUMBER); 473 top = cssValuePool().createValue(box.top().number(), CSSPrimitiveValue:: CSS_NUMBER);
474 else 474 else
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 RefPtr<CSSPrimitiveValue> verticalRepeat; 519 RefPtr<CSSPrimitiveValue> verticalRepeat;
520 520
521 horizontalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule(i mage.horizontalRule())); 521 horizontalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule(i mage.horizontalRule()));
522 if (image.horizontalRule() == image.verticalRule()) 522 if (image.horizontalRule() == image.verticalRule())
523 verticalRepeat = horizontalRepeat; 523 verticalRepeat = horizontalRepeat;
524 else 524 else
525 verticalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule (image.verticalRule())); 525 verticalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule (image.verticalRule()));
526 return cssValuePool().createValue(Pair::create(horizontalRepeat.release(), v erticalRepeat.release(), Pair::DropIdenticalValues)); 526 return cssValuePool().createValue(Pair::create(horizontalRepeat.release(), v erticalRepeat.release(), Pair::DropIdenticalValues));
527 } 527 }
528 528
529 static PassRefPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image, const RenderStyle* style) 529 static PassRefPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image, const RenderStyle& style)
530 { 530 {
531 if (!image.hasImage()) 531 if (!image.hasImage())
532 return cssValuePool().createIdentifierValue(CSSValueNone); 532 return cssValuePool().createIdentifierValue(CSSValueNone);
533 533
534 // Image first. 534 // Image first.
535 RefPtr<CSSValue> imageValue; 535 RefPtr<CSSValue> imageValue;
536 if (image.image()) 536 if (image.image())
537 imageValue = image.image()->cssValue(); 537 imageValue = image.image()->cssValue();
538 538
539 // Create the image slice. 539 // Create the image slice.
540 RefPtr<CSSBorderImageSliceValue> imageSlices = valueForNinePieceImageSlice(i mage); 540 RefPtr<CSSBorderImageSliceValue> imageSlices = valueForNinePieceImageSlice(i mage);
541 541
542 // Create the border area slices. 542 // Create the border area slices.
543 RefPtr<CSSValue> borderSlices = valueForNinePieceImageQuad(image.borderSlice s(), style); 543 RefPtr<CSSValue> borderSlices = valueForNinePieceImageQuad(image.borderSlice s(), style);
544 544
545 // Create the border outset. 545 // Create the border outset.
546 RefPtr<CSSValue> outset = valueForNinePieceImageQuad(image.outset(), style); 546 RefPtr<CSSValue> outset = valueForNinePieceImageQuad(image.outset(), style);
547 547
548 // Create the repeat rules. 548 // Create the repeat rules.
549 RefPtr<CSSValue> repeat = valueForNinePieceImageRepeat(image); 549 RefPtr<CSSValue> repeat = valueForNinePieceImageRepeat(image);
550 550
551 return createBorderImageValue(imageValue.release(), imageSlices.release(), b orderSlices.release(), outset.release(), repeat.release()); 551 return createBorderImageValue(imageValue.release(), imageSlices.release(), b orderSlices.release(), outset.release(), repeat.release());
552 } 552 }
553 553
554 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(double value, const RenderStyle* style) 554 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(double value, const RenderStyle& style)
555 { 555 {
556 return cssValuePool().createValue(adjustFloatForAbsoluteZoom(value, style), CSSPrimitiveValue::CSS_PX); 556 return cssValuePool().createValue(adjustFloatForAbsoluteZoom(value, style), CSSPrimitiveValue::CSS_PX);
557 } 557 }
558 558
559 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value , const RenderStyle* style) 559 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value , const RenderStyle& style)
560 { 560 {
561 return cssValuePool().createValue(value / style->effectiveZoom(), CSSPrimiti veValue::CSS_NUMBER); 561 return cssValuePool().createValue(value / style.effectiveZoom(), CSSPrimitiv eValue::CSS_NUMBER);
562 } 562 }
563 563
564 static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValueForLength(const Lengt h& length, const RenderStyle* style) 564 static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValueForLength(const Lengt h& length, const RenderStyle& style)
565 { 565 {
566 if (length.isFixed()) 566 if (length.isFixed())
567 return zoomAdjustedPixelValue(length.value(), style); 567 return zoomAdjustedPixelValue(length.value(), style);
568 return cssValuePool().createValue(length, style); 568 return cssValuePool().createValue(length, style);
569 } 569 }
570 570
571 static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection , const RenderStyle* style) 571 static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection , const RenderStyle& style)
572 { 572 {
573 if (!reflection) 573 if (!reflection)
574 return cssValuePool().createIdentifierValue(CSSValueNone); 574 return cssValuePool().createIdentifierValue(CSSValueNone);
575 575
576 RefPtr<CSSPrimitiveValue> offset; 576 RefPtr<CSSPrimitiveValue> offset;
577 if (reflection->offset().isPercent()) 577 if (reflection->offset().isPercent())
578 offset = cssValuePool().createValue(reflection->offset().percent(), CSSP rimitiveValue::CSS_PERCENTAGE); 578 offset = cssValuePool().createValue(reflection->offset().percent(), CSSP rimitiveValue::CSS_PERCENTAGE);
579 else 579 else
580 offset = zoomAdjustedPixelValue(reflection->offset().value(), style); 580 offset = zoomAdjustedPixelValue(reflection->offset().value(), style);
581 581
582 RefPtr<CSSPrimitiveValue> direction; 582 RefPtr<CSSPrimitiveValue> direction;
583 switch (reflection->direction()) { 583 switch (reflection->direction()) {
584 case ReflectionBelow: 584 case ReflectionBelow:
585 direction = cssValuePool().createIdentifierValue(CSSValueBelow); 585 direction = cssValuePool().createIdentifierValue(CSSValueBelow);
586 break; 586 break;
587 case ReflectionAbove: 587 case ReflectionAbove:
588 direction = cssValuePool().createIdentifierValue(CSSValueAbove); 588 direction = cssValuePool().createIdentifierValue(CSSValueAbove);
589 break; 589 break;
590 case ReflectionLeft: 590 case ReflectionLeft:
591 direction = cssValuePool().createIdentifierValue(CSSValueLeft); 591 direction = cssValuePool().createIdentifierValue(CSSValueLeft);
592 break; 592 break;
593 case ReflectionRight: 593 case ReflectionRight:
594 direction = cssValuePool().createIdentifierValue(CSSValueRight); 594 direction = cssValuePool().createIdentifierValue(CSSValueRight);
595 break; 595 break;
596 } 596 }
597 597
598 return CSSReflectValue::create(direction.release(), offset.release(), valueF orNinePieceImage(reflection->mask(), style)); 598 return CSSReflectValue::create(direction.release(), offset.release(), valueF orNinePieceImage(reflection->mask(), style));
599 } 599 }
600 600
601 static PassRefPtr<CSSValueList> createPositionListForLayer(CSSPropertyID propert yID, const FillLayer* layer, const RenderStyle* style) 601 static PassRefPtr<CSSValueList> createPositionListForLayer(CSSPropertyID propert yID, const FillLayer* layer, const RenderStyle& style)
602 { 602 {
603 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPosition || pro pertyID == CSSPropertyWebkitMaskPosition); 603 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPosition || pro pertyID == CSSPropertyWebkitMaskPosition);
604 RefPtr<CSSValueList> positionList = CSSValueList::createSpaceSeparated(); 604 RefPtr<CSSValueList> positionList = CSSValueList::createSpaceSeparated();
605 positionList->append(cssValuePool().createValue(layer->backgroundXOrigin())) ; 605 positionList->append(cssValuePool().createValue(layer->backgroundXOrigin())) ;
606 positionList->append(zoomAdjustedPixelValueForLength(layer->xPosition(), sty le)); 606 positionList->append(zoomAdjustedPixelValueForLength(layer->xPosition(), sty le));
607 positionList->append(cssValuePool().createValue(layer->backgroundYOrigin())) ; 607 positionList->append(cssValuePool().createValue(layer->backgroundYOrigin())) ;
608 positionList->append(zoomAdjustedPixelValueForLength(layer->yPosition(), sty le)); 608 positionList->append(zoomAdjustedPixelValueForLength(layer->yPosition(), sty le));
609 return positionList.release(); 609 return positionList.release();
610 } 610 }
611 611
612 static PassRefPtr<CSSValue> valueForPositionOffset(RenderStyle* style, CSSProper tyID propertyID, const RenderObject* renderer, RenderView* renderView) 612 static PassRefPtr<CSSValue> valueForPositionOffset(RenderStyle& style, CSSProper tyID propertyID, const RenderObject* renderer, RenderView* renderView)
613 { 613 {
614 if (!style)
615 return 0;
616
617 Length l; 614 Length l;
618 switch (propertyID) { 615 switch (propertyID) {
619 case CSSPropertyLeft: 616 case CSSPropertyLeft:
620 l = style->left(); 617 l = style.left();
621 break; 618 break;
622 case CSSPropertyRight: 619 case CSSPropertyRight:
623 l = style->right(); 620 l = style.right();
624 break; 621 break;
625 case CSSPropertyTop: 622 case CSSPropertyTop:
626 l = style->top(); 623 l = style.top();
627 break; 624 break;
628 case CSSPropertyBottom: 625 case CSSPropertyBottom:
629 l = style->bottom(); 626 l = style.bottom();
630 break; 627 break;
631 default: 628 default:
632 return 0; 629 return 0;
633 } 630 }
634 631
635 if (l.isPercent() && renderer && renderer->isBox()) { 632 if (l.isPercent() && renderer && renderer->isBox()) {
636 LayoutUnit containingBlockSize = (propertyID == CSSPropertyLeft || prope rtyID == CSSPropertyRight) ? 633 LayoutUnit containingBlockSize = (propertyID == CSSPropertyLeft || prope rtyID == CSSPropertyRight) ?
637 toRenderBox(renderer)->containingBlockLogicalWidthForContent() : 634 toRenderBox(renderer)->containingBlockLogicalWidthForContent() :
638 toRenderBox(renderer)->containingBlockLogicalHeightForContent(Exclud eMarginBorderPadding); 635 toRenderBox(renderer)->containingBlockLogicalHeightForContent(Exclud eMarginBorderPadding);
639 return zoomAdjustedPixelValue(valueForLength(l, containingBlockSize, 0), style); 636 return zoomAdjustedPixelValue(valueForLength(l, containingBlockSize, 0), style);
640 } 637 }
641 if (l.isViewportPercentage()) 638 if (l.isViewportPercentage())
642 return zoomAdjustedPixelValue(valueForLength(l, 0, renderView), style); 639 return zoomAdjustedPixelValue(valueForLength(l, 0, renderView), style);
643 if (l.isAuto()) { 640 if (l.isAuto()) {
644 // FIXME: It's not enough to simply return "auto" values for one offset if the other side is defined. 641 // FIXME: It's not enough to simply return "auto" values for one offset if the other side is defined.
645 // In other words if left is auto and right is not auto, then left's com puted value is negative right(). 642 // In other words if left is auto and right is not auto, then left's com puted value is negative right().
646 // So we should get the opposite length unit and see if it is auto. 643 // So we should get the opposite length unit and see if it is auto.
647 return cssValuePool().createValue(l); 644 return cssValuePool().createValue(l);
648 } 645 }
649 646
650 return zoomAdjustedPixelValueForLength(l, style); 647 return zoomAdjustedPixelValueForLength(l, style);
651 } 648 }
652 649
653 PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo lor(const RenderStyle* style, const Color& color) const 650 PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo lor(const RenderStyle& style, const Color& color) const
654 { 651 {
655 // This function does NOT look at visited information, so that computed styl e doesn't expose that. 652 // This function does NOT look at visited information, so that computed styl e doesn't expose that.
656 if (!color.isValid()) 653 if (!color.isValid())
657 return cssValuePool().createColorValue(style->color().rgb()); 654 return cssValuePool().createColorValue(style.color().rgb());
658 return cssValuePool().createColorValue(color.rgb()); 655 return cssValuePool().createColorValue(color.rgb());
659 } 656 }
660 657
661 static PassRefPtr<CSSValueList> valuesForBorderRadiusCorner(LengthSize radius, c onst RenderStyle* style) 658 static PassRefPtr<CSSValueList> valuesForBorderRadiusCorner(LengthSize radius, c onst RenderStyle& style)
662 { 659 {
663 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 660 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
664 if (radius.width().type() == Percent) 661 if (radius.width().type() == Percent)
665 list->append(cssValuePool().createValue(radius.width().percent(), CSSPri mitiveValue::CSS_PERCENTAGE)); 662 list->append(cssValuePool().createValue(radius.width().percent(), CSSPri mitiveValue::CSS_PERCENTAGE));
666 else 663 else
667 list->append(zoomAdjustedPixelValueForLength(radius.width(), style)); 664 list->append(zoomAdjustedPixelValueForLength(radius.width(), style));
668 if (radius.height().type() == Percent) 665 if (radius.height().type() == Percent)
669 list->append(cssValuePool().createValue(radius.height().percent(), CSSPr imitiveValue::CSS_PERCENTAGE)); 666 list->append(cssValuePool().createValue(radius.height().percent(), CSSPr imitiveValue::CSS_PERCENTAGE));
670 else 667 else
671 list->append(zoomAdjustedPixelValueForLength(radius.height(), style)); 668 list->append(zoomAdjustedPixelValueForLength(radius.height(), style));
672 return list.release(); 669 return list.release();
673 } 670 }
674 671
675 static PassRefPtr<CSSValue> valueForBorderRadiusCorner(LengthSize radius, const RenderStyle* style) 672 static PassRefPtr<CSSValue> valueForBorderRadiusCorner(LengthSize radius, const RenderStyle& style)
676 { 673 {
677 RefPtr<CSSValueList> list = valuesForBorderRadiusCorner(radius, style); 674 RefPtr<CSSValueList> list = valuesForBorderRadiusCorner(radius, style);
678 if (list->item(0)->equals(*list->item(1))) 675 if (list->item(0)->equals(*list->item(1)))
679 return list->item(0); 676 return list->item(0);
680 return list.release(); 677 return list.release();
681 } 678 }
682 679
683 static PassRefPtr<CSSValueList> valueForBorderRadiusShorthand(const RenderStyle* style) 680 static PassRefPtr<CSSValueList> valueForBorderRadiusShorthand(const RenderStyle& style)
684 { 681 {
685 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 682 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
686 683
687 bool showHorizontalBottomLeft = style->borderTopRightRadius().width() != sty le->borderBottomLeftRadius().width(); 684 bool showHorizontalBottomLeft = style.borderTopRightRadius().width() != styl e.borderBottomLeftRadius().width();
688 bool showHorizontalBottomRight = showHorizontalBottomLeft || (style->borderB ottomRightRadius().width() != style->borderTopLeftRadius().width()); 685 bool showHorizontalBottomRight = showHorizontalBottomLeft || (style.borderBo ttomRightRadius().width() != style.borderTopLeftRadius().width());
689 bool showHorizontalTopRight = showHorizontalBottomRight || (style->borderTop RightRadius().width() != style->borderTopLeftRadius().width()); 686 bool showHorizontalTopRight = showHorizontalBottomRight || (style.borderTopR ightRadius().width() != style.borderTopLeftRadius().width());
690 687
691 bool showVerticalBottomLeft = style->borderTopRightRadius().height() != styl e->borderBottomLeftRadius().height(); 688 bool showVerticalBottomLeft = style.borderTopRightRadius().height() != style .borderBottomLeftRadius().height();
692 bool showVerticalBottomRight = showVerticalBottomLeft || (style->borderBotto mRightRadius().height() != style->borderTopLeftRadius().height()); 689 bool showVerticalBottomRight = showVerticalBottomLeft || (style.borderBottom RightRadius().height() != style.borderTopLeftRadius().height());
693 bool showVerticalTopRight = showVerticalBottomRight || (style->borderTopRigh tRadius().height() != style->borderTopLeftRadius().height()); 690 bool showVerticalTopRight = showVerticalBottomRight || (style.borderTopRight Radius().height() != style.borderTopLeftRadius().height());
694 691
695 RefPtr<CSSValueList> topLeftRadius = valuesForBorderRadiusCorner(style->bord erTopLeftRadius(), style); 692 RefPtr<CSSValueList> topLeftRadius = valuesForBorderRadiusCorner(style.borde rTopLeftRadius(), style);
696 RefPtr<CSSValueList> topRightRadius = valuesForBorderRadiusCorner(style->bor derTopRightRadius(), style); 693 RefPtr<CSSValueList> topRightRadius = valuesForBorderRadiusCorner(style.bord erTopRightRadius(), style);
697 RefPtr<CSSValueList> bottomRightRadius = valuesForBorderRadiusCorner(style-> borderBottomRightRadius(), style); 694 RefPtr<CSSValueList> bottomRightRadius = valuesForBorderRadiusCorner(style.b orderBottomRightRadius(), style);
698 RefPtr<CSSValueList> bottomLeftRadius = valuesForBorderRadiusCorner(style->b orderBottomLeftRadius(), style); 695 RefPtr<CSSValueList> bottomLeftRadius = valuesForBorderRadiusCorner(style.bo rderBottomLeftRadius(), style);
699 696
700 RefPtr<CSSValueList> horizontalRadii = CSSValueList::createSpaceSeparated(); 697 RefPtr<CSSValueList> horizontalRadii = CSSValueList::createSpaceSeparated();
701 horizontalRadii->append(topLeftRadius->item(0)); 698 horizontalRadii->append(topLeftRadius->item(0));
702 if (showHorizontalTopRight) 699 if (showHorizontalTopRight)
703 horizontalRadii->append(topRightRadius->item(0)); 700 horizontalRadii->append(topRightRadius->item(0));
704 if (showHorizontalBottomRight) 701 if (showHorizontalBottomRight)
705 horizontalRadii->append(bottomRightRadius->item(0)); 702 horizontalRadii->append(bottomRightRadius->item(0));
706 if (showHorizontalBottomLeft) 703 if (showHorizontalBottomLeft)
707 horizontalRadii->append(bottomLeftRadius->item(0)); 704 horizontalRadii->append(bottomLeftRadius->item(0));
708 705
(...skipping 16 matching lines...) Expand all
725 722
726 static LayoutRect sizingBox(RenderObject* renderer) 723 static LayoutRect sizingBox(RenderObject* renderer)
727 { 724 {
728 if (!renderer->isBox()) 725 if (!renderer->isBox())
729 return LayoutRect(); 726 return LayoutRect();
730 727
731 RenderBox* box = toRenderBox(renderer); 728 RenderBox* box = toRenderBox(renderer);
732 return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box- >computedCSSContentBoxRect(); 729 return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box- >computedCSSContentBoxRect();
733 } 730 }
734 731
735 static PassRefPtr<CSSTransformValue> valueForMatrixTransform(const Transformatio nMatrix& transform, const RenderStyle* style) 732 static PassRefPtr<CSSTransformValue> valueForMatrixTransform(const Transformatio nMatrix& transform, const RenderStyle& style)
736 { 733 {
737 RefPtr<CSSTransformValue> transformValue; 734 RefPtr<CSSTransformValue> transformValue;
738 if (transform.isAffine()) { 735 if (transform.isAffine()) {
739 transformValue = CSSTransformValue::create(CSSTransformValue::MatrixTran sformOperation); 736 transformValue = CSSTransformValue::create(CSSTransformValue::MatrixTran sformOperation);
740 737
741 transformValue->append(cssValuePool().createValue(transform.a(), CSSPrim itiveValue::CSS_NUMBER)); 738 transformValue->append(cssValuePool().createValue(transform.a(), CSSPrim itiveValue::CSS_NUMBER));
742 transformValue->append(cssValuePool().createValue(transform.b(), CSSPrim itiveValue::CSS_NUMBER)); 739 transformValue->append(cssValuePool().createValue(transform.b(), CSSPrim itiveValue::CSS_NUMBER));
743 transformValue->append(cssValuePool().createValue(transform.c(), CSSPrim itiveValue::CSS_NUMBER)); 740 transformValue->append(cssValuePool().createValue(transform.c(), CSSPrim itiveValue::CSS_NUMBER));
744 transformValue->append(cssValuePool().createValue(transform.d(), CSSPrim itiveValue::CSS_NUMBER)); 741 transformValue->append(cssValuePool().createValue(transform.d(), CSSPrim itiveValue::CSS_NUMBER));
745 transformValue->append(zoomAdjustedNumberValue(transform.e(), style)); 742 transformValue->append(zoomAdjustedNumberValue(transform.e(), style));
(...skipping 18 matching lines...) Expand all
764 761
765 transformValue->append(zoomAdjustedNumberValue(transform.m41(), style)); 762 transformValue->append(zoomAdjustedNumberValue(transform.m41(), style));
766 transformValue->append(zoomAdjustedNumberValue(transform.m42(), style)); 763 transformValue->append(zoomAdjustedNumberValue(transform.m42(), style));
767 transformValue->append(zoomAdjustedNumberValue(transform.m43(), style)); 764 transformValue->append(zoomAdjustedNumberValue(transform.m43(), style));
768 transformValue->append(cssValuePool().createValue(transform.m44(), CSSPr imitiveValue::CSS_NUMBER)); 765 transformValue->append(cssValuePool().createValue(transform.m44(), CSSPr imitiveValue::CSS_NUMBER));
769 } 766 }
770 767
771 return transformValue.release(); 768 return transformValue.release();
772 } 769 }
773 770
774 static PassRefPtr<CSSValue> computedTransform(RenderObject* renderer, const Rend erStyle* style) 771 static PassRefPtr<CSSValue> computedTransform(RenderObject* renderer, const Rend erStyle& style)
775 { 772 {
776 if (!renderer || !renderer->hasTransform() || !style->hasTransform()) 773 if (!renderer || !renderer->hasTransform() || !style.hasTransform())
777 return cssValuePool().createIdentifierValue(CSSValueNone); 774 return cssValuePool().createIdentifierValue(CSSValueNone);
778 775
779 IntRect box; 776 IntRect box;
780 if (renderer->isBox()) 777 if (renderer->isBox())
781 box = pixelSnappedIntRect(toRenderBox(renderer)->borderBoxRect()); 778 box = pixelSnappedIntRect(toRenderBox(renderer)->borderBoxRect());
782 779
783 TransformationMatrix transform; 780 TransformationMatrix transform;
784 style->applyTransform(transform, box.size(), RenderStyle::ExcludeTransformOr igin); 781 style.applyTransform(transform, box.size(), RenderStyle::ExcludeTransformOri gin);
785 782
786 // FIXME: Need to print out individual functions (https://bugs.webkit.org/sh ow_bug.cgi?id=23924) 783 // FIXME: Need to print out individual functions (https://bugs.webkit.org/sh ow_bug.cgi?id=23924)
787 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 784 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
788 list->append(valueForMatrixTransform(transform, style)); 785 list->append(valueForMatrixTransform(transform, style));
789 786
790 return list.release(); 787 return list.release();
791 } 788 }
792 789
793 static PassRefPtr<CSSValue> valueForCustomFilterArrayParameter(const CustomFilte rArrayParameter* arrayParameter) 790 static PassRefPtr<CSSValue> valueForCustomFilterArrayParameter(const CustomFilte rArrayParameter* arrayParameter)
794 { 791 {
795 RefPtr<CSSArrayFunctionValue> arrayParameterValue = CSSArrayFunctionValue::c reate(); 792 RefPtr<CSSArrayFunctionValue> arrayParameterValue = CSSArrayFunctionValue::c reate();
796 for (unsigned i = 0, size = arrayParameter->size(); i < size; ++i) 793 for (unsigned i = 0, size = arrayParameter->size(); i < size; ++i)
797 arrayParameterValue->append(cssValuePool().createValue(arrayParameter->v alueAt(i), CSSPrimitiveValue::CSS_NUMBER)); 794 arrayParameterValue->append(cssValuePool().createValue(arrayParameter->v alueAt(i), CSSPrimitiveValue::CSS_NUMBER));
798 return arrayParameterValue.release(); 795 return arrayParameterValue.release();
799 } 796 }
800 797
801 static PassRefPtr<CSSValue> valueForCustomFilterNumberParameter(const CustomFilt erNumberParameter* numberParameter) 798 static PassRefPtr<CSSValue> valueForCustomFilterNumberParameter(const CustomFilt erNumberParameter* numberParameter)
802 { 799 {
803 RefPtr<CSSValueList> numberParameterValue = CSSValueList::createSpaceSeparat ed(); 800 RefPtr<CSSValueList> numberParameterValue = CSSValueList::createSpaceSeparat ed();
804 for (unsigned i = 0; i < numberParameter->size(); ++i) 801 for (unsigned i = 0; i < numberParameter->size(); ++i)
805 numberParameterValue->append(cssValuePool().createValue(numberParameter- >valueAt(i), CSSPrimitiveValue::CSS_NUMBER)); 802 numberParameterValue->append(cssValuePool().createValue(numberParameter- >valueAt(i), CSSPrimitiveValue::CSS_NUMBER));
806 return numberParameterValue.release(); 803 return numberParameterValue.release();
807 } 804 }
808 805
809 static PassRefPtr<CSSValue> valueForCustomFilterTransformParameter(const RenderO bject* renderer, const RenderStyle* style, const CustomFilterTransformParameter* transformParameter) 806 static PassRefPtr<CSSValue> valueForCustomFilterTransformParameter(const RenderO bject* renderer, const RenderStyle& style, const CustomFilterTransformParameter* transformParameter)
810 { 807 {
811 IntSize size; 808 IntSize size;
812 if (renderer && renderer->isBox()) 809 if (renderer && renderer->isBox())
813 size = pixelSnappedIntRect(toRenderBox(renderer)->borderBoxRect()).size( ); 810 size = pixelSnappedIntRect(toRenderBox(renderer)->borderBoxRect()).size( );
814 811
815 TransformationMatrix transform; 812 TransformationMatrix transform;
816 transformParameter->applyTransform(transform, size); 813 transformParameter->applyTransform(transform, size);
817 // FIXME: Need to print out individual functions (https://bugs.webkit.org/sh ow_bug.cgi?id=23924) 814 // FIXME: Need to print out individual functions (https://bugs.webkit.org/sh ow_bug.cgi?id=23924)
818 return valueForMatrixTransform(transform, style); 815 return valueForMatrixTransform(transform, style);
819 } 816 }
820 817
821 static PassRefPtr<CSSValue> valueForCustomFilterParameter(const RenderObject* re nderer, const RenderStyle* style, const CustomFilterParameter* parameter) 818 static PassRefPtr<CSSValue> valueForCustomFilterParameter(const RenderObject* re nderer, const RenderStyle& style, const CustomFilterParameter* parameter)
822 { 819 {
823 // FIXME: Add here computed style for the other types: boolean, transform, m atrix, texture. 820 // FIXME: Add here computed style for the other types: boolean, transform, m atrix, texture.
824 ASSERT(parameter); 821 ASSERT(parameter);
825 switch (parameter->parameterType()) { 822 switch (parameter->parameterType()) {
826 case CustomFilterParameter::Array: 823 case CustomFilterParameter::Array:
827 return valueForCustomFilterArrayParameter(static_cast<const CustomFilter ArrayParameter*>(parameter)); 824 return valueForCustomFilterArrayParameter(static_cast<const CustomFilter ArrayParameter*>(parameter));
828 case CustomFilterParameter::Number: 825 case CustomFilterParameter::Number:
829 return valueForCustomFilterNumberParameter(static_cast<const CustomFilte rNumberParameter*>(parameter)); 826 return valueForCustomFilterNumberParameter(static_cast<const CustomFilte rNumberParameter*>(parameter));
830 case CustomFilterParameter::Transform: 827 case CustomFilterParameter::Transform:
831 return valueForCustomFilterTransformParameter(renderer, style, static_ca st<const CustomFilterTransformParameter*>(parameter)); 828 return valueForCustomFilterTransformParameter(renderer, style, static_ca st<const CustomFilterTransformParameter*>(parameter));
832 } 829 }
833 830
834 ASSERT_NOT_REACHED(); 831 ASSERT_NOT_REACHED();
835 return 0; 832 return 0;
836 } 833 }
837 834
838 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForFilter(const RenderObj ect* renderer, const RenderStyle* style) const 835 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForFilter(const RenderObj ect* renderer, const RenderStyle& style) const
839 { 836 {
840 if (style->filter().operations().isEmpty()) 837 if (style.filter().operations().isEmpty())
841 return cssValuePool().createIdentifierValue(CSSValueNone); 838 return cssValuePool().createIdentifierValue(CSSValueNone);
842 839
843 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 840 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
844 841
845 RefPtr<CSSFilterValue> filterValue; 842 RefPtr<CSSFilterValue> filterValue;
846 843
847 Vector<RefPtr<FilterOperation> >::const_iterator end = style->filter().opera tions().end(); 844 Vector<RefPtr<FilterOperation> >::const_iterator end = style.filter().operat ions().end();
848 for (Vector<RefPtr<FilterOperation> >::const_iterator it = style->filter().o perations().begin(); it != end; ++it) { 845 for (Vector<RefPtr<FilterOperation> >::const_iterator it = style.filter().op erations().begin(); it != end; ++it) {
849 FilterOperation* filterOperation = (*it).get(); 846 FilterOperation* filterOperation = (*it).get();
850 switch (filterOperation->getOperationType()) { 847 switch (filterOperation->getOperationType()) {
851 case FilterOperation::REFERENCE: { 848 case FilterOperation::REFERENCE: {
852 ReferenceFilterOperation* referenceOperation = static_cast<Reference FilterOperation*>(filterOperation); 849 ReferenceFilterOperation* referenceOperation = static_cast<Reference FilterOperation*>(filterOperation);
853 filterValue = CSSFilterValue::create(CSSFilterValue::ReferenceFilter Operation); 850 filterValue = CSSFilterValue::create(CSSFilterValue::ReferenceFilter Operation);
854 filterValue->append(cssValuePool().createValue(referenceOperation->u rl(), CSSPrimitiveValue::CSS_STRING)); 851 filterValue->append(cssValuePool().createValue(referenceOperation->u rl(), CSSPrimitiveValue::CSS_STRING));
855 break; 852 break;
856 } 853 }
857 case FilterOperation::GRAYSCALE: { 854 case FilterOperation::GRAYSCALE: {
858 BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast< BasicColorMatrixFilterOperation*>(filterOperation); 855 BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast< BasicColorMatrixFilterOperation*>(filterOperation);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 default: 978 default:
982 filterValue = CSSFilterValue::create(CSSFilterValue::UnknownFilterOp eration); 979 filterValue = CSSFilterValue::create(CSSFilterValue::UnknownFilterOp eration);
983 break; 980 break;
984 } 981 }
985 list->append(filterValue.release()); 982 list->append(filterValue.release());
986 } 983 }
987 984
988 return list.release(); 985 return list.release();
989 } 986 }
990 987
991 static PassRefPtr<CSSValue> valueForGridTrackBreadth(const GridLength& trackBrea dth, const RenderStyle* style, RenderView* renderView) 988 static PassRefPtr<CSSValue> valueForGridTrackBreadth(const GridLength& trackBrea dth, const RenderStyle& style, RenderView* renderView)
992 { 989 {
993 if (!trackBreadth.isLength()) 990 if (!trackBreadth.isLength())
994 return cssValuePool().createValue(trackBreadth.flex(), CSSPrimitiveValue ::CSS_FR); 991 return cssValuePool().createValue(trackBreadth.flex(), CSSPrimitiveValue ::CSS_FR);
995 992
996 const Length& trackBreadthLength = trackBreadth.length(); 993 const Length& trackBreadthLength = trackBreadth.length();
997 if (trackBreadthLength.isAuto()) 994 if (trackBreadthLength.isAuto())
998 return cssValuePool().createIdentifierValue(CSSValueAuto); 995 return cssValuePool().createIdentifierValue(CSSValueAuto);
999 if (trackBreadthLength.isViewportPercentage()) 996 if (trackBreadthLength.isViewportPercentage())
1000 return zoomAdjustedPixelValue(valueForLength(trackBreadthLength, 0, rend erView), style); 997 return zoomAdjustedPixelValue(valueForLength(trackBreadthLength, 0, rend erView), style);
1001 return zoomAdjustedPixelValueForLength(trackBreadthLength, style); 998 return zoomAdjustedPixelValueForLength(trackBreadthLength, style);
1002 } 999 }
1003 1000
1004 static PassRefPtr<CSSValue> specifiedValueForGridTrackSize(const GridTrackSize& trackSize, const RenderStyle* style, RenderView* renderView) 1001 static PassRefPtr<CSSValue> specifiedValueForGridTrackSize(const GridTrackSize& trackSize, const RenderStyle& style, RenderView* renderView)
1005 { 1002 {
1006 switch (trackSize.type()) { 1003 switch (trackSize.type()) {
1007 case LengthTrackSizing: 1004 case LengthTrackSizing:
1008 return valueForGridTrackBreadth(trackSize.length(), style, renderView); 1005 return valueForGridTrackBreadth(trackSize.length(), style, renderView);
1009 case MinMaxTrackSizing: 1006 case MinMaxTrackSizing:
1010 RefPtr<CSSValueList> minMaxTrackBreadths = CSSValueList::createCommaSepa rated(); 1007 RefPtr<CSSValueList> minMaxTrackBreadths = CSSValueList::createCommaSepa rated();
1011 minMaxTrackBreadths->append(valueForGridTrackBreadth(trackSize.minTrackB readth(), style, renderView)); 1008 minMaxTrackBreadths->append(valueForGridTrackBreadth(trackSize.minTrackB readth(), style, renderView));
1012 minMaxTrackBreadths->append(valueForGridTrackBreadth(trackSize.maxTrackB readth(), style, renderView)); 1009 minMaxTrackBreadths->append(valueForGridTrackBreadth(trackSize.maxTrackB readth(), style, renderView));
1013 return CSSFunctionValue::create("minmax(", minMaxTrackBreadths); 1010 return CSSFunctionValue::create("minmax(", minMaxTrackBreadths);
1014 } 1011 }
1015 ASSERT_NOT_REACHED(); 1012 ASSERT_NOT_REACHED();
1016 return 0; 1013 return 0;
1017 } 1014 }
1018 1015
1019 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order edNamedGridLines, size_t i, CSSValueList& list) 1016 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order edNamedGridLines, size_t i, CSSValueList& list)
1020 { 1017 {
1021 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); 1018 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i);
1022 for (size_t j = 0; j < namedGridLines.size(); ++j) 1019 for (size_t j = 0; j < namedGridLines.size(); ++j)
1023 list.append(cssValuePool().createValue(namedGridLines[j], CSSPrimitiveVa lue::CSS_STRING)); 1020 list.append(cssValuePool().createValue(namedGridLines[j], CSSPrimitiveVa lue::CSS_STRING));
1024 } 1021 }
1025 1022
1026 static PassRefPtr<CSSValue> valueForGridTrackList(GridTrackSizingDirection direc tion, RenderObject* renderer, const RenderStyle* style, RenderView* renderView) 1023 static PassRefPtr<CSSValue> valueForGridTrackList(GridTrackSizingDirection direc tion, RenderObject* renderer, const RenderStyle& style, RenderView* renderView)
1027 { 1024 {
1028 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style->g ridDefinitionColumns() : style->gridDefinitionRows(); 1025 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr idDefinitionColumns() : style.gridDefinitionRows();
1029 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns ? style->orderedNamedGridColumnLines() : style->orderedNamedGridRowLines(); 1026 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns ? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines();
1030 1027
1031 // Handle the 'none' case here. 1028 // Handle the 'none' case here.
1032 if (!trackSizes.size()) { 1029 if (!trackSizes.size()) {
1033 ASSERT(orderedNamedGridLines.isEmpty()); 1030 ASSERT(orderedNamedGridLines.isEmpty());
1034 return cssValuePool().createIdentifierValue(CSSValueNone); 1031 return cssValuePool().createIdentifierValue(CSSValueNone);
1035 } 1032 }
1036 1033
1037 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1034 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
1038 if (renderer && renderer->isRenderGrid()) { 1035 if (renderer && renderer->isRenderGrid()) {
1039 const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? toR enderGrid(renderer)->columnPositions() : toRenderGrid(renderer)->rowPositions(); 1036 const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? toR enderGrid(renderer)->columnPositions() : toRenderGrid(renderer)->rowPositions();
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 m_node->document().updateLayoutIgnorePendingStylesheets(); 1291 m_node->document().updateLayoutIgnorePendingStylesheets();
1295 1292
1296 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier); 1293 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier);
1297 if (!style) 1294 if (!style)
1298 return 0; 1295 return 0;
1299 1296
1300 if (int keywordSize = style->fontDescription().keywordSize()) 1297 if (int keywordSize = style->fontDescription().keywordSize())
1301 return cssValuePool().createIdentifierValue(cssIdentifierForFontSizeKeyw ord(keywordSize)); 1298 return cssValuePool().createIdentifierValue(cssIdentifierForFontSizeKeyw ord(keywordSize));
1302 1299
1303 1300
1304 return zoomAdjustedPixelValue(style->fontDescription().computedPixelSize(), style.get()); 1301 return zoomAdjustedPixelValue(style->fontDescription().computedPixelSize(), *style);
1305 } 1302 }
1306 1303
1307 bool CSSComputedStyleDeclaration::useFixedFontDefaultSize() const 1304 bool CSSComputedStyleDeclaration::useFixedFontDefaultSize() const
1308 { 1305 {
1309 if (!m_node) 1306 if (!m_node)
1310 return false; 1307 return false;
1311 1308
1312 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier); 1309 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier);
1313 if (!style) 1310 if (!style)
1314 return false; 1311 return false;
1315 1312
1316 return style->fontDescription().useFixedDefaultSize(); 1313 return style->fontDescription().useFixedDefaultSize();
1317 } 1314 }
1318 1315
1319 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadowData(const Shado wData& shadow, const RenderStyle* style, bool useSpread) const 1316 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadowData(const Shado wData& shadow, const RenderStyle& style, bool useSpread) const
1320 { 1317 {
1321 RefPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(shadow.x(), style); 1318 RefPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(shadow.x(), style);
1322 RefPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(shadow.y(), style); 1319 RefPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(shadow.y(), style);
1323 RefPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(shadow.blur(), style ); 1320 RefPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(shadow.blur(), style );
1324 RefPtr<CSSPrimitiveValue> spread = useSpread ? zoomAdjustedPixelValue(shadow .spread(), style) : PassRefPtr<CSSPrimitiveValue>(); 1321 RefPtr<CSSPrimitiveValue> spread = useSpread ? zoomAdjustedPixelValue(shadow .spread(), style) : PassRefPtr<CSSPrimitiveValue>();
1325 RefPtr<CSSPrimitiveValue> shadowStyle = shadow.style() == Normal ? PassRefPt r<CSSPrimitiveValue>() : cssValuePool().createIdentifierValue(CSSValueInset); 1322 RefPtr<CSSPrimitiveValue> shadowStyle = shadow.style() == Normal ? PassRefPt r<CSSPrimitiveValue>() : cssValuePool().createIdentifierValue(CSSValueInset);
1326 RefPtr<CSSPrimitiveValue> color = currentColorOrValidColor(style, shadow.col or()); 1323 RefPtr<CSSPrimitiveValue> color = currentColorOrValidColor(style, shadow.col or());
1327 return CSSShadowValue::create(x.release(), y.release(), blur.release(), spre ad.release(), shadowStyle.release(), color.release()); 1324 return CSSShadowValue::create(x.release(), y.release(), blur.release(), spre ad.release(), shadowStyle.release(), color.release());
1328 } 1325 }
1329 1326
1330 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadowList(const Shado wList* shadowList, const RenderStyle* style, bool useSpread) const 1327 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadowList(const Shado wList* shadowList, const RenderStyle& style, bool useSpread) const
1331 { 1328 {
1332 if (!shadowList) 1329 if (!shadowList)
1333 return cssValuePool().createIdentifierValue(CSSValueNone); 1330 return cssValuePool().createIdentifierValue(CSSValueNone);
1334 1331
1335 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 1332 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
1336 size_t shadowCount = shadowList->shadows().size(); 1333 size_t shadowCount = shadowList->shadows().size();
1337 for (size_t i = 0; i < shadowCount; ++i) 1334 for (size_t i = 0; i < shadowCount; ++i)
1338 list->append(valueForShadowData(shadowList->shadows()[i], style, useSpre ad)); 1335 list->append(valueForShadowData(shadowList->shadows()[i], style, useSpre ad));
1339 return list.release(); 1336 return list.release();
1340 } 1337 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 return cssValuePool().createValue(CSSValueAlpha); 1424 return cssValuePool().createValue(CSSValueAlpha);
1428 case MaskLuminance: 1425 case MaskLuminance:
1429 return cssValuePool().createValue(CSSValueLuminance); 1426 return cssValuePool().createValue(CSSValueLuminance);
1430 } 1427 }
1431 1428
1432 ASSERT_NOT_REACHED(); 1429 ASSERT_NOT_REACHED();
1433 1430
1434 return 0; 1431 return 0;
1435 } 1432 }
1436 1433
1437 static PassRefPtr<CSSValue> valueForFillSize(const FillSize& fillSize, const Ren derStyle* style) 1434 static PassRefPtr<CSSValue> valueForFillSize(const FillSize& fillSize, const Ren derStyle& style)
1438 { 1435 {
1439 if (fillSize.type == Contain) 1436 if (fillSize.type == Contain)
1440 return cssValuePool().createIdentifierValue(CSSValueContain); 1437 return cssValuePool().createIdentifierValue(CSSValueContain);
1441 1438
1442 if (fillSize.type == Cover) 1439 if (fillSize.type == Cover)
1443 return cssValuePool().createIdentifierValue(CSSValueCover); 1440 return cssValuePool().createIdentifierValue(CSSValueCover);
1444 1441
1445 if (fillSize.size.height().isAuto()) 1442 if (fillSize.size.height().isAuto())
1446 return zoomAdjustedPixelValueForLength(fillSize.size.width(), style); 1443 return zoomAdjustedPixelValueForLength(fillSize.size.width(), style);
1447 1444
1448 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1445 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
1449 list->append(zoomAdjustedPixelValueForLength(fillSize.size.width(), style)); 1446 list->append(zoomAdjustedPixelValueForLength(fillSize.size.width(), style));
1450 list->append(zoomAdjustedPixelValueForLength(fillSize.size.height(), style)) ; 1447 list->append(zoomAdjustedPixelValueForLength(fillSize.size.height(), style)) ;
1451 return list.release(); 1448 return list.release();
1452 } 1449 }
1453 1450
1454 static PassRefPtr<CSSValue> valueForContentData(const RenderStyle* style) 1451 static PassRefPtr<CSSValue> valueForContentData(const RenderStyle& style)
1455 { 1452 {
1456 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1453 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
1457 for (const ContentData* contentData = style->contentData(); contentData; con tentData = contentData->next()) { 1454 for (const ContentData* contentData = style.contentData(); contentData; cont entData = contentData->next()) {
1458 if (contentData->isCounter()) { 1455 if (contentData->isCounter()) {
1459 const CounterContent* counter = static_cast<const CounterContentData *>(contentData)->counter(); 1456 const CounterContent* counter = static_cast<const CounterContentData *>(contentData)->counter();
1460 ASSERT(counter); 1457 ASSERT(counter);
1461 list->append(cssValuePool().createValue(counter->identifier(), CSSPr imitiveValue::CSS_COUNTER_NAME)); 1458 list->append(cssValuePool().createValue(counter->identifier(), CSSPr imitiveValue::CSS_COUNTER_NAME));
1462 } else if (contentData->isImage()) { 1459 } else if (contentData->isImage()) {
1463 const StyleImage* image = static_cast<const ImageContentData*>(conte ntData)->image(); 1460 const StyleImage* image = static_cast<const ImageContentData*>(conte ntData)->image();
1464 ASSERT(image); 1461 ASSERT(image);
1465 list->append(image->cssValue()); 1462 list->append(image->cssValue());
1466 } else if (contentData->isText()) 1463 } else if (contentData->isText())
1467 list->append(cssValuePool().createValue(static_cast<const TextConten tData*>(contentData)->text(), CSSPrimitiveValue::CSS_STRING)); 1464 list->append(cssValuePool().createValue(static_cast<const TextConten tData*>(contentData)->text(), CSSPrimitiveValue::CSS_STRING));
1468 } 1465 }
1469 if (style->hasFlowFrom()) 1466 if (style.hasFlowFrom())
1470 list->append(cssValuePool().createValue(style->regionThread(), CSSPrimit iveValue::CSS_STRING)); 1467 list->append(cssValuePool().createValue(style.regionThread(), CSSPrimiti veValue::CSS_STRING));
1471 return list.release(); 1468 return list.release();
1472 } 1469 }
1473 1470
1474 static PassRefPtr<CSSValue> valueForCounterDirectives(const RenderStyle* style, CSSPropertyID propertyID) 1471 static PassRefPtr<CSSValue> valueForCounterDirectives(const RenderStyle& style, CSSPropertyID propertyID)
1475 { 1472 {
1476 const CounterDirectiveMap* map = style->counterDirectives(); 1473 const CounterDirectiveMap* map = style.counterDirectives();
1477 if (!map) 1474 if (!map)
1478 return 0; 1475 return 0;
1479 1476
1480 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1477 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
1481 for (CounterDirectiveMap::const_iterator it = map->begin(); it != map->end() ; ++it) { 1478 for (CounterDirectiveMap::const_iterator it = map->begin(); it != map->end() ; ++it) {
1482 list->append(cssValuePool().createValue(it->key, CSSPrimitiveValue::CSS_ STRING)); 1479 list->append(cssValuePool().createValue(it->key, CSSPrimitiveValue::CSS_ STRING));
1483 short number = propertyID == CSSPropertyCounterIncrement ? it->value.inc rementValue() : it->value.resetValue(); 1480 short number = propertyID == CSSPropertyCounterIncrement ? it->value.inc rementValue() : it->value.resetValue();
1484 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu e::CSS_NUMBER)); 1481 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu e::CSS_NUMBER));
1485 } 1482 }
1486 return list.release(); 1483 return list.release();
1487 } 1484 }
1488 1485
1489 static void logUnimplementedPropertyID(CSSPropertyID propertyID) 1486 static void logUnimplementedPropertyID(CSSPropertyID propertyID)
1490 { 1487 {
1491 DEFINE_STATIC_LOCAL(HashSet<CSSPropertyID>, propertyIDSet, ()); 1488 DEFINE_STATIC_LOCAL(HashSet<CSSPropertyID>, propertyIDSet, ());
1492 if (!propertyIDSet.add(propertyID).isNewEntry) 1489 if (!propertyIDSet.add(propertyID).isNewEntry)
1493 return; 1490 return;
1494 1491
1495 LOG_ERROR("WebKit does not yet implement getComputedStyle for '%s'.", getPro pertyName(propertyID)); 1492 LOG_ERROR("WebKit does not yet implement getComputedStyle for '%s'.", getPro pertyName(propertyID));
1496 } 1493 }
1497 1494
1498 static PassRefPtr<CSSValueList> valueForFontFamily(RenderStyle* style) 1495 static PassRefPtr<CSSValueList> valueForFontFamily(RenderStyle& style)
1499 { 1496 {
1500 const FontFamily& firstFamily = style->fontDescription().family(); 1497 const FontFamily& firstFamily = style.fontDescription().family();
1501 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 1498 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
1502 for (const FontFamily* family = &firstFamily; family; family = family->next( )) 1499 for (const FontFamily* family = &firstFamily; family; family = family->next( ))
1503 list->append(valueForFamily(family->family())); 1500 list->append(valueForFamily(family->family()));
1504 return list.release(); 1501 return list.release();
1505 } 1502 }
1506 1503
1507 static PassRefPtr<CSSPrimitiveValue> valueForLineHeight(RenderStyle* style, Rend erView* renderView) 1504 static PassRefPtr<CSSPrimitiveValue> valueForLineHeight(RenderStyle& style, Rend erView* renderView)
1508 { 1505 {
1509 Length length = style->lineHeight(); 1506 Length length = style.lineHeight();
1510 if (length.isNegative()) 1507 if (length.isNegative())
1511 return cssValuePool().createIdentifierValue(CSSValueNormal); 1508 return cssValuePool().createIdentifierValue(CSSValueNormal);
1512 1509
1513 return zoomAdjustedPixelValue(floatValueForLength(length, style->fontDescrip tion().specifiedSize(), renderView), style); 1510 return zoomAdjustedPixelValue(floatValueForLength(length, style.fontDescript ion().specifiedSize(), renderView), style);
1514 } 1511 }
1515 1512
1516 static PassRefPtr<CSSPrimitiveValue> valueForFontSize(RenderStyle* style) 1513 static PassRefPtr<CSSPrimitiveValue> valueForFontSize(RenderStyle& style)
1517 { 1514 {
1518 return zoomAdjustedPixelValue(style->fontDescription().computedPixelSize(), style); 1515 return zoomAdjustedPixelValue(style.fontDescription().computedPixelSize(), s tyle);
1519 } 1516 }
1520 1517
1521 static PassRefPtr<CSSPrimitiveValue> valueForFontStyle(RenderStyle* style) 1518 static PassRefPtr<CSSPrimitiveValue> valueForFontStyle(RenderStyle& style)
1522 { 1519 {
1523 if (style->fontDescription().italic()) 1520 if (style.fontDescription().italic())
1524 return cssValuePool().createIdentifierValue(CSSValueItalic); 1521 return cssValuePool().createIdentifierValue(CSSValueItalic);
1525 return cssValuePool().createIdentifierValue(CSSValueNormal); 1522 return cssValuePool().createIdentifierValue(CSSValueNormal);
1526 } 1523 }
1527 1524
1528 static PassRefPtr<CSSPrimitiveValue> valueForFontVariant(RenderStyle* style) 1525 static PassRefPtr<CSSPrimitiveValue> valueForFontVariant(RenderStyle& style)
1529 { 1526 {
1530 if (style->fontDescription().smallCaps()) 1527 if (style.fontDescription().smallCaps())
1531 return cssValuePool().createIdentifierValue(CSSValueSmallCaps); 1528 return cssValuePool().createIdentifierValue(CSSValueSmallCaps);
1532 return cssValuePool().createIdentifierValue(CSSValueNormal); 1529 return cssValuePool().createIdentifierValue(CSSValueNormal);
1533 } 1530 }
1534 1531
1535 static PassRefPtr<CSSPrimitiveValue> valueForFontWeight(RenderStyle* style) 1532 static PassRefPtr<CSSPrimitiveValue> valueForFontWeight(RenderStyle& style)
1536 { 1533 {
1537 switch (style->fontDescription().weight()) { 1534 switch (style.fontDescription().weight()) {
1538 case FontWeight100: 1535 case FontWeight100:
1539 return cssValuePool().createIdentifierValue(CSSValue100); 1536 return cssValuePool().createIdentifierValue(CSSValue100);
1540 case FontWeight200: 1537 case FontWeight200:
1541 return cssValuePool().createIdentifierValue(CSSValue200); 1538 return cssValuePool().createIdentifierValue(CSSValue200);
1542 case FontWeight300: 1539 case FontWeight300:
1543 return cssValuePool().createIdentifierValue(CSSValue300); 1540 return cssValuePool().createIdentifierValue(CSSValue300);
1544 case FontWeightNormal: 1541 case FontWeightNormal:
1545 return cssValuePool().createIdentifierValue(CSSValueNormal); 1542 return cssValuePool().createIdentifierValue(CSSValueNormal);
1546 case FontWeight500: 1543 case FontWeight500:
1547 return cssValuePool().createIdentifierValue(CSSValue500); 1544 return cssValuePool().createIdentifierValue(CSSValue500);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 else 1696 else
1700 list->append(cssValuePool().createIdentifierValue(CSSValueNo ne)); 1697 list->append(cssValuePool().createIdentifierValue(CSSValueNo ne));
1701 } 1698 }
1702 return list.release(); 1699 return list.release();
1703 } 1700 }
1704 case CSSPropertyBackgroundSize: 1701 case CSSPropertyBackgroundSize:
1705 case CSSPropertyWebkitBackgroundSize: 1702 case CSSPropertyWebkitBackgroundSize:
1706 case CSSPropertyWebkitMaskSize: { 1703 case CSSPropertyWebkitMaskSize: {
1707 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskSize ? style->maskLayers() : style->backgroundLayers(); 1704 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskSize ? style->maskLayers() : style->backgroundLayers();
1708 if (!layers->next()) 1705 if (!layers->next())
1709 return valueForFillSize(layers->size(), style.get()); 1706 return valueForFillSize(layers->size(), *style);
1710 1707
1711 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 1708 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
1712 for (const FillLayer* currLayer = layers; currLayer; currLayer = cur rLayer->next()) 1709 for (const FillLayer* currLayer = layers; currLayer; currLayer = cur rLayer->next())
1713 list->append(valueForFillSize(currLayer->size(), style.get())); 1710 list->append(valueForFillSize(currLayer->size(), *style));
1714 1711
1715 return list.release(); 1712 return list.release();
1716 } 1713 }
1717 case CSSPropertyBackgroundRepeat: 1714 case CSSPropertyBackgroundRepeat:
1718 case CSSPropertyWebkitMaskRepeat: { 1715 case CSSPropertyWebkitMaskRepeat: {
1719 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskRepeat ? style->maskLayers() : style->backgroundLayers(); 1716 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskRepeat ? style->maskLayers() : style->backgroundLayers();
1720 if (!layers->next()) 1717 if (!layers->next())
1721 return valueForFillRepeat(layers->repeatX(), layers->repeatY()); 1718 return valueForFillRepeat(layers->repeatX(), layers->repeatY());
1722 1719
1723 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 1720 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1782 EFillBox box = isClip ? currLayer->clip() : currLayer->origin(); 1779 EFillBox box = isClip ? currLayer->clip() : currLayer->origin();
1783 list->append(cssValuePool().createValue(box)); 1780 list->append(cssValuePool().createValue(box));
1784 } 1781 }
1785 1782
1786 return list.release(); 1783 return list.release();
1787 } 1784 }
1788 case CSSPropertyBackgroundPosition: 1785 case CSSPropertyBackgroundPosition:
1789 case CSSPropertyWebkitMaskPosition: { 1786 case CSSPropertyWebkitMaskPosition: {
1790 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskPositio n ? style->maskLayers() : style->backgroundLayers(); 1787 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskPositio n ? style->maskLayers() : style->backgroundLayers();
1791 if (!layers->next()) 1788 if (!layers->next())
1792 return createPositionListForLayer(propertyID, layers, style.get( )); 1789 return createPositionListForLayer(propertyID, layers, *style);
1793 1790
1794 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 1791 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
1795 for (const FillLayer* currLayer = layers; currLayer; currLayer = cur rLayer->next()) 1792 for (const FillLayer* currLayer = layers; currLayer; currLayer = cur rLayer->next())
1796 list->append(createPositionListForLayer(propertyID, currLayer, s tyle.get())); 1793 list->append(createPositionListForLayer(propertyID, currLayer, * style));
1797 return list.release(); 1794 return list.release();
1798 } 1795 }
1799 case CSSPropertyBackgroundPositionX: 1796 case CSSPropertyBackgroundPositionX:
1800 case CSSPropertyWebkitMaskPositionX: { 1797 case CSSPropertyWebkitMaskPositionX: {
1801 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskPositio nX ? style->maskLayers() : style->backgroundLayers(); 1798 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskPositio nX ? style->maskLayers() : style->backgroundLayers();
1802 if (!layers->next()) 1799 if (!layers->next())
1803 return cssValuePool().createValue(layers->xPosition()); 1800 return cssValuePool().createValue(layers->xPosition());
1804 1801
1805 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 1802 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
1806 for (const FillLayer* currLayer = layers; currLayer; currLayer = cur rLayer->next()) 1803 for (const FillLayer* currLayer = layers; currLayer; currLayer = cur rLayer->next())
(...skipping 12 matching lines...) Expand all
1819 list->append(cssValuePool().createValue(currLayer->yPosition())) ; 1816 list->append(cssValuePool().createValue(currLayer->yPosition())) ;
1820 1817
1821 return list.release(); 1818 return list.release();
1822 } 1819 }
1823 case CSSPropertyBorderCollapse: 1820 case CSSPropertyBorderCollapse:
1824 if (style->borderCollapse()) 1821 if (style->borderCollapse())
1825 return cssValuePool().createIdentifierValue(CSSValueCollapse); 1822 return cssValuePool().createIdentifierValue(CSSValueCollapse);
1826 return cssValuePool().createIdentifierValue(CSSValueSeparate); 1823 return cssValuePool().createIdentifierValue(CSSValueSeparate);
1827 case CSSPropertyBorderSpacing: { 1824 case CSSPropertyBorderSpacing: {
1828 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1825 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
1829 list->append(zoomAdjustedPixelValue(style->horizontalBorderSpacing() , style.get())); 1826 list->append(zoomAdjustedPixelValue(style->horizontalBorderSpacing() , *style));
1830 list->append(zoomAdjustedPixelValue(style->verticalBorderSpacing(), style.get())); 1827 list->append(zoomAdjustedPixelValue(style->verticalBorderSpacing(), *style));
1831 return list.release(); 1828 return list.release();
1832 } 1829 }
1833 case CSSPropertyWebkitBorderHorizontalSpacing: 1830 case CSSPropertyWebkitBorderHorizontalSpacing:
1834 return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), styl e.get()); 1831 return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), *sty le);
1835 case CSSPropertyWebkitBorderVerticalSpacing: 1832 case CSSPropertyWebkitBorderVerticalSpacing:
1836 return zoomAdjustedPixelValue(style->verticalBorderSpacing(), style. get()); 1833 return zoomAdjustedPixelValue(style->verticalBorderSpacing(), *style );
1837 case CSSPropertyBorderImageSource: 1834 case CSSPropertyBorderImageSource:
1838 if (style->borderImageSource()) 1835 if (style->borderImageSource())
1839 return style->borderImageSource()->cssValue(); 1836 return style->borderImageSource()->cssValue();
1840 return cssValuePool().createIdentifierValue(CSSValueNone); 1837 return cssValuePool().createIdentifierValue(CSSValueNone);
1841 case CSSPropertyBorderTopColor: 1838 case CSSPropertyBorderTopColor:
1842 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidCol or(style.get(), style->borderTopColor()); 1839 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidCol or(*style, style->borderTopColor());
1843 case CSSPropertyBorderRightColor: 1840 case CSSPropertyBorderRightColor:
1844 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBorderRightColor).rgb()) : currentColorOrValidC olor(style.get(), style->borderRightColor()); 1841 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBorderRightColor).rgb()) : currentColorOrValidC olor(*style, style->borderRightColor());
1845 case CSSPropertyBorderBottomColor: 1842 case CSSPropertyBorderBottomColor:
1846 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBorderBottomColor).rgb()) : currentColorOrValid Color(style.get(), style->borderBottomColor()); 1843 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBorderBottomColor).rgb()) : currentColorOrValid Color(*style, style->borderBottomColor());
1847 case CSSPropertyBorderLeftColor: 1844 case CSSPropertyBorderLeftColor:
1848 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBorderLeftColor).rgb()) : currentColorOrValidCo lor(style.get(), style->borderLeftColor()); 1845 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBorderLeftColor).rgb()) : currentColorOrValidCo lor(*style, style->borderLeftColor());
1849 case CSSPropertyBorderTopStyle: 1846 case CSSPropertyBorderTopStyle:
1850 return cssValuePool().createValue(style->borderTopStyle()); 1847 return cssValuePool().createValue(style->borderTopStyle());
1851 case CSSPropertyBorderRightStyle: 1848 case CSSPropertyBorderRightStyle:
1852 return cssValuePool().createValue(style->borderRightStyle()); 1849 return cssValuePool().createValue(style->borderRightStyle());
1853 case CSSPropertyBorderBottomStyle: 1850 case CSSPropertyBorderBottomStyle:
1854 return cssValuePool().createValue(style->borderBottomStyle()); 1851 return cssValuePool().createValue(style->borderBottomStyle());
1855 case CSSPropertyBorderLeftStyle: 1852 case CSSPropertyBorderLeftStyle:
1856 return cssValuePool().createValue(style->borderLeftStyle()); 1853 return cssValuePool().createValue(style->borderLeftStyle());
1857 case CSSPropertyBorderTopWidth: 1854 case CSSPropertyBorderTopWidth:
1858 return zoomAdjustedPixelValue(style->borderTopWidth(), style.get()); 1855 return zoomAdjustedPixelValue(style->borderTopWidth(), *style);
1859 case CSSPropertyBorderRightWidth: 1856 case CSSPropertyBorderRightWidth:
1860 return zoomAdjustedPixelValue(style->borderRightWidth(), style.get() ); 1857 return zoomAdjustedPixelValue(style->borderRightWidth(), *style);
1861 case CSSPropertyBorderBottomWidth: 1858 case CSSPropertyBorderBottomWidth:
1862 return zoomAdjustedPixelValue(style->borderBottomWidth(), style.get( )); 1859 return zoomAdjustedPixelValue(style->borderBottomWidth(), *style);
1863 case CSSPropertyBorderLeftWidth: 1860 case CSSPropertyBorderLeftWidth:
1864 return zoomAdjustedPixelValue(style->borderLeftWidth(), style.get()) ; 1861 return zoomAdjustedPixelValue(style->borderLeftWidth(), *style);
1865 case CSSPropertyBottom: 1862 case CSSPropertyBottom:
1866 return valueForPositionOffset(style.get(), CSSPropertyBottom, render er, m_node->document().renderView()); 1863 return valueForPositionOffset(*style, CSSPropertyBottom, renderer, m _node->document().renderView());
1867 case CSSPropertyWebkitBoxAlign: 1864 case CSSPropertyWebkitBoxAlign:
1868 return cssValuePool().createValue(style->boxAlign()); 1865 return cssValuePool().createValue(style->boxAlign());
1869 case CSSPropertyWebkitBoxDecorationBreak: 1866 case CSSPropertyWebkitBoxDecorationBreak:
1870 if (style->boxDecorationBreak() == DSLICE) 1867 if (style->boxDecorationBreak() == DSLICE)
1871 return cssValuePool().createIdentifierValue(CSSValueSlice); 1868 return cssValuePool().createIdentifierValue(CSSValueSlice);
1872 return cssValuePool().createIdentifierValue(CSSValueClone); 1869 return cssValuePool().createIdentifierValue(CSSValueClone);
1873 case CSSPropertyWebkitBoxDirection: 1870 case CSSPropertyWebkitBoxDirection:
1874 return cssValuePool().createValue(style->boxDirection()); 1871 return cssValuePool().createValue(style->boxDirection());
1875 case CSSPropertyWebkitBoxFlex: 1872 case CSSPropertyWebkitBoxFlex:
1876 return cssValuePool().createValue(style->boxFlex(), CSSPrimitiveValu e::CSS_NUMBER); 1873 return cssValuePool().createValue(style->boxFlex(), CSSPrimitiveValu e::CSS_NUMBER);
1877 case CSSPropertyWebkitBoxFlexGroup: 1874 case CSSPropertyWebkitBoxFlexGroup:
1878 return cssValuePool().createValue(style->boxFlexGroup(), CSSPrimitiv eValue::CSS_NUMBER); 1875 return cssValuePool().createValue(style->boxFlexGroup(), CSSPrimitiv eValue::CSS_NUMBER);
1879 case CSSPropertyWebkitBoxLines: 1876 case CSSPropertyWebkitBoxLines:
1880 return cssValuePool().createValue(style->boxLines()); 1877 return cssValuePool().createValue(style->boxLines());
1881 case CSSPropertyWebkitBoxOrdinalGroup: 1878 case CSSPropertyWebkitBoxOrdinalGroup:
1882 return cssValuePool().createValue(style->boxOrdinalGroup(), CSSPrimi tiveValue::CSS_NUMBER); 1879 return cssValuePool().createValue(style->boxOrdinalGroup(), CSSPrimi tiveValue::CSS_NUMBER);
1883 case CSSPropertyWebkitBoxOrient: 1880 case CSSPropertyWebkitBoxOrient:
1884 return cssValuePool().createValue(style->boxOrient()); 1881 return cssValuePool().createValue(style->boxOrient());
1885 case CSSPropertyWebkitBoxPack: 1882 case CSSPropertyWebkitBoxPack:
1886 return cssValuePool().createValue(style->boxPack()); 1883 return cssValuePool().createValue(style->boxPack());
1887 case CSSPropertyWebkitBoxReflect: 1884 case CSSPropertyWebkitBoxReflect:
1888 return valueForReflection(style->boxReflect(), style.get()); 1885 return valueForReflection(style->boxReflect(), *style);
1889 case CSSPropertyBoxShadow: 1886 case CSSPropertyBoxShadow:
1890 case CSSPropertyWebkitBoxShadow: 1887 case CSSPropertyWebkitBoxShadow:
1891 return valueForShadowList(style->boxShadow(), style.get(), true); 1888 return valueForShadowList(style->boxShadow(), *style, true);
1892 case CSSPropertyCaptionSide: 1889 case CSSPropertyCaptionSide:
1893 return cssValuePool().createValue(style->captionSide()); 1890 return cssValuePool().createValue(style->captionSide());
1894 case CSSPropertyClear: 1891 case CSSPropertyClear:
1895 return cssValuePool().createValue(style->clear()); 1892 return cssValuePool().createValue(style->clear());
1896 case CSSPropertyColor: 1893 case CSSPropertyColor:
1897 return cssValuePool().createColorValue(m_allowVisitedStyle ? style-> visitedDependentColor(CSSPropertyColor).rgb() : style->color().rgb()); 1894 return cssValuePool().createColorValue(m_allowVisitedStyle ? style-> visitedDependentColor(CSSPropertyColor).rgb() : style->color().rgb());
1898 case CSSPropertyWebkitPrintColorAdjust: 1895 case CSSPropertyWebkitPrintColorAdjust:
1899 return cssValuePool().createValue(style->printColorAdjust()); 1896 return cssValuePool().createValue(style->printColorAdjust());
1900 case CSSPropertyWebkitColumnAxis: 1897 case CSSPropertyWebkitColumnAxis:
1901 return cssValuePool().createValue(style->columnAxis()); 1898 return cssValuePool().createValue(style->columnAxis());
1902 case CSSPropertyWebkitColumnCount: 1899 case CSSPropertyWebkitColumnCount:
1903 if (style->hasAutoColumnCount()) 1900 if (style->hasAutoColumnCount())
1904 return cssValuePool().createIdentifierValue(CSSValueAuto); 1901 return cssValuePool().createIdentifierValue(CSSValueAuto);
1905 return cssValuePool().createValue(style->columnCount(), CSSPrimitive Value::CSS_NUMBER); 1902 return cssValuePool().createValue(style->columnCount(), CSSPrimitive Value::CSS_NUMBER);
1906 case CSSPropertyColumnFill: 1903 case CSSPropertyColumnFill:
1907 if (RuntimeEnabledFeatures::regionBasedColumnsEnabled()) 1904 if (RuntimeEnabledFeatures::regionBasedColumnsEnabled())
1908 return cssValuePool().createValue(style->columnFill()); 1905 return cssValuePool().createValue(style->columnFill());
1909 return 0; 1906 return 0;
1910 case CSSPropertyWebkitColumnGap: 1907 case CSSPropertyWebkitColumnGap:
1911 if (style->hasNormalColumnGap()) 1908 if (style->hasNormalColumnGap())
1912 return cssValuePool().createIdentifierValue(CSSValueNormal); 1909 return cssValuePool().createIdentifierValue(CSSValueNormal);
1913 return zoomAdjustedPixelValue(style->columnGap(), style.get()); 1910 return zoomAdjustedPixelValue(style->columnGap(), *style);
1914 case CSSPropertyWebkitColumnProgression: 1911 case CSSPropertyWebkitColumnProgression:
1915 return cssValuePool().createValue(style->columnProgression()); 1912 return cssValuePool().createValue(style->columnProgression());
1916 case CSSPropertyWebkitColumnRuleColor: 1913 case CSSPropertyWebkitColumnRuleColor:
1917 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor (style.get(), style->columnRuleColor()); 1914 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor (*style, style->columnRuleColor());
1918 case CSSPropertyWebkitColumnRuleStyle: 1915 case CSSPropertyWebkitColumnRuleStyle:
1919 return cssValuePool().createValue(style->columnRuleStyle()); 1916 return cssValuePool().createValue(style->columnRuleStyle());
1920 case CSSPropertyWebkitColumnRuleWidth: 1917 case CSSPropertyWebkitColumnRuleWidth:
1921 return zoomAdjustedPixelValue(style->columnRuleWidth(), style.get()) ; 1918 return zoomAdjustedPixelValue(style->columnRuleWidth(), *style);
1922 case CSSPropertyWebkitColumnSpan: 1919 case CSSPropertyWebkitColumnSpan:
1923 return cssValuePool().createIdentifierValue(style->columnSpan() ? CS SValueAll : CSSValueNone); 1920 return cssValuePool().createIdentifierValue(style->columnSpan() ? CS SValueAll : CSSValueNone);
1924 case CSSPropertyWebkitColumnBreakAfter: 1921 case CSSPropertyWebkitColumnBreakAfter:
1925 return cssValuePool().createValue(style->columnBreakAfter()); 1922 return cssValuePool().createValue(style->columnBreakAfter());
1926 case CSSPropertyWebkitColumnBreakBefore: 1923 case CSSPropertyWebkitColumnBreakBefore:
1927 return cssValuePool().createValue(style->columnBreakBefore()); 1924 return cssValuePool().createValue(style->columnBreakBefore());
1928 case CSSPropertyWebkitColumnBreakInside: 1925 case CSSPropertyWebkitColumnBreakInside:
1929 return cssValuePool().createValue(style->columnBreakInside()); 1926 return cssValuePool().createValue(style->columnBreakInside());
1930 case CSSPropertyWebkitColumnWidth: 1927 case CSSPropertyWebkitColumnWidth:
1931 if (style->hasAutoColumnWidth()) 1928 if (style->hasAutoColumnWidth())
1932 return cssValuePool().createIdentifierValue(CSSValueAuto); 1929 return cssValuePool().createIdentifierValue(CSSValueAuto);
1933 return zoomAdjustedPixelValue(style->columnWidth(), style.get()); 1930 return zoomAdjustedPixelValue(style->columnWidth(), *style);
1934 case CSSPropertyTabSize: 1931 case CSSPropertyTabSize:
1935 return cssValuePool().createValue(style->tabSize(), CSSPrimitiveValu e::CSS_NUMBER); 1932 return cssValuePool().createValue(style->tabSize(), CSSPrimitiveValu e::CSS_NUMBER);
1936 case CSSPropertyWebkitRegionBreakAfter: 1933 case CSSPropertyWebkitRegionBreakAfter:
1937 return cssValuePool().createValue(style->regionBreakAfter()); 1934 return cssValuePool().createValue(style->regionBreakAfter());
1938 case CSSPropertyWebkitRegionBreakBefore: 1935 case CSSPropertyWebkitRegionBreakBefore:
1939 return cssValuePool().createValue(style->regionBreakBefore()); 1936 return cssValuePool().createValue(style->regionBreakBefore());
1940 case CSSPropertyWebkitRegionBreakInside: 1937 case CSSPropertyWebkitRegionBreakInside:
1941 return cssValuePool().createValue(style->regionBreakInside()); 1938 return cssValuePool().createValue(style->regionBreakInside());
1942 case CSSPropertyCursor: { 1939 case CSSPropertyCursor: {
1943 RefPtr<CSSValueList> list; 1940 RefPtr<CSSValueList> list;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 case CSSPropertyJustifyContent: 1987 case CSSPropertyJustifyContent:
1991 return cssValuePool().createValue(style->justifyContent()); 1988 return cssValuePool().createValue(style->justifyContent());
1992 case CSSPropertyOrder: 1989 case CSSPropertyOrder:
1993 return cssValuePool().createValue(style->order(), CSSPrimitiveValue: :CSS_NUMBER); 1990 return cssValuePool().createValue(style->order(), CSSPrimitiveValue: :CSS_NUMBER);
1994 case CSSPropertyFloat: 1991 case CSSPropertyFloat:
1995 if (style->display() != NONE && style->hasOutOfFlowPosition()) 1992 if (style->display() != NONE && style->hasOutOfFlowPosition())
1996 return cssValuePool().createIdentifierValue(CSSValueNone); 1993 return cssValuePool().createIdentifierValue(CSSValueNone);
1997 return cssValuePool().createValue(style->floating()); 1994 return cssValuePool().createValue(style->floating());
1998 case CSSPropertyFont: { 1995 case CSSPropertyFont: {
1999 RefPtr<CSSFontValue> computedFont = CSSFontValue::create(); 1996 RefPtr<CSSFontValue> computedFont = CSSFontValue::create();
2000 computedFont->style = valueForFontStyle(style.get()); 1997 computedFont->style = valueForFontStyle(*style);
2001 computedFont->variant = valueForFontVariant(style.get()); 1998 computedFont->variant = valueForFontVariant(*style);
2002 computedFont->weight = valueForFontWeight(style.get()); 1999 computedFont->weight = valueForFontWeight(*style);
2003 computedFont->size = valueForFontSize(style.get()); 2000 computedFont->size = valueForFontSize(*style);
2004 computedFont->lineHeight = valueForLineHeight(style.get(), m_node->d ocument().renderView()); 2001 computedFont->lineHeight = valueForLineHeight(*style, m_node->docume nt().renderView());
2005 computedFont->family = valueForFontFamily(style.get()); 2002 computedFont->family = valueForFontFamily(*style);
2006 return computedFont.release(); 2003 return computedFont.release();
2007 } 2004 }
2008 case CSSPropertyFontFamily: { 2005 case CSSPropertyFontFamily: {
2009 RefPtr<CSSValueList> fontFamilyList = valueForFontFamily(style.get() ); 2006 RefPtr<CSSValueList> fontFamilyList = valueForFontFamily(*style);
2010 // If there's only a single family, return that as a CSSPrimitiveVal ue. 2007 // If there's only a single family, return that as a CSSPrimitiveVal ue.
2011 // NOTE: Gecko always returns this as a comma-separated CSSPrimitive Value string. 2008 // NOTE: Gecko always returns this as a comma-separated CSSPrimitive Value string.
2012 if (fontFamilyList->length() == 1) 2009 if (fontFamilyList->length() == 1)
2013 return fontFamilyList->item(0); 2010 return fontFamilyList->item(0);
2014 return fontFamilyList.release(); 2011 return fontFamilyList.release();
2015 } 2012 }
2016 case CSSPropertyFontSize: 2013 case CSSPropertyFontSize:
2017 return valueForFontSize(style.get()); 2014 return valueForFontSize(*style);
2018 case CSSPropertyFontStyle: 2015 case CSSPropertyFontStyle:
2019 return valueForFontStyle(style.get()); 2016 return valueForFontStyle(*style);
2020 case CSSPropertyFontVariant: 2017 case CSSPropertyFontVariant:
2021 return valueForFontVariant(style.get()); 2018 return valueForFontVariant(*style);
2022 case CSSPropertyFontWeight: 2019 case CSSPropertyFontWeight:
2023 return valueForFontWeight(style.get()); 2020 return valueForFontWeight(*style);
2024 case CSSPropertyWebkitFontFeatureSettings: { 2021 case CSSPropertyWebkitFontFeatureSettings: {
2025 const FontFeatureSettings* featureSettings = style->fontDescription( ).featureSettings(); 2022 const FontFeatureSettings* featureSettings = style->fontDescription( ).featureSettings();
2026 if (!featureSettings || !featureSettings->size()) 2023 if (!featureSettings || !featureSettings->size())
2027 return cssValuePool().createIdentifierValue(CSSValueNormal); 2024 return cssValuePool().createIdentifierValue(CSSValueNormal);
2028 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 2025 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
2029 for (unsigned i = 0; i < featureSettings->size(); ++i) { 2026 for (unsigned i = 0; i < featureSettings->size(); ++i) {
2030 const FontFeature& feature = featureSettings->at(i); 2027 const FontFeature& feature = featureSettings->at(i);
2031 RefPtr<CSSFontFeatureValue> featureValue = CSSFontFeatureValue:: create(feature.tag(), feature.value()); 2028 RefPtr<CSSFontFeatureValue> featureValue = CSSFontFeatureValue:: create(feature.tag(), feature.value());
2032 list->append(featureValue.release()); 2029 list->append(featureValue.release());
2033 } 2030 }
2034 return list.release(); 2031 return list.release();
2035 } 2032 }
2036 case CSSPropertyGridAutoFlow: 2033 case CSSPropertyGridAutoFlow:
2037 return cssValuePool().createValue(style->gridAutoFlow()); 2034 return cssValuePool().createValue(style->gridAutoFlow());
2038 2035
2039 // Specs mention that getComputedStyle() should return the used value of the property instead of the computed 2036 // Specs mention that getComputedStyle() should return the used value of the property instead of the computed
2040 // one for grid-definition-{rows|columns} but not for the grid-auto-{row s|columns} as things like 2037 // one for grid-definition-{rows|columns} but not for the grid-auto-{row s|columns} as things like
2041 // grid-auto-columns: 2fr; cannot be resolved to a value in pixels as th e '2fr' means very different things 2038 // grid-auto-columns: 2fr; cannot be resolved to a value in pixels as th e '2fr' means very different things
2042 // depending on the size of the explicit grid or the number of implicit tracks added to the grid. See 2039 // depending on the size of the explicit grid or the number of implicit tracks added to the grid. See
2043 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html 2040 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html
2044 case CSSPropertyGridAutoColumns: 2041 case CSSPropertyGridAutoColumns:
2045 return specifiedValueForGridTrackSize(style->gridAutoColumns(), styl e.get(), m_node->document().renderView()); 2042 return specifiedValueForGridTrackSize(style->gridAutoColumns(), *sty le, m_node->document().renderView());
2046 case CSSPropertyGridAutoRows: 2043 case CSSPropertyGridAutoRows:
2047 return specifiedValueForGridTrackSize(style->gridAutoRows(), style.g et(), m_node->document().renderView()); 2044 return specifiedValueForGridTrackSize(style->gridAutoRows(), *style, m_node->document().renderView());
2048 2045
2049 case CSSPropertyGridDefinitionColumns: 2046 case CSSPropertyGridDefinitionColumns:
2050 return valueForGridTrackList(ForColumns, renderer, style.get(), m_no de->document().renderView()); 2047 return valueForGridTrackList(ForColumns, renderer, *style, m_node->d ocument().renderView());
2051 case CSSPropertyGridDefinitionRows: 2048 case CSSPropertyGridDefinitionRows:
2052 return valueForGridTrackList(ForRows, renderer, style.get(), m_node- >document().renderView()); 2049 return valueForGridTrackList(ForRows, renderer, *style, m_node->docu ment().renderView());
2053 2050
2054 case CSSPropertyGridColumnStart: 2051 case CSSPropertyGridColumnStart:
2055 return valueForGridPosition(style->gridColumnStart()); 2052 return valueForGridPosition(style->gridColumnStart());
2056 case CSSPropertyGridColumnEnd: 2053 case CSSPropertyGridColumnEnd:
2057 return valueForGridPosition(style->gridColumnEnd()); 2054 return valueForGridPosition(style->gridColumnEnd());
2058 case CSSPropertyGridRowStart: 2055 case CSSPropertyGridRowStart:
2059 return valueForGridPosition(style->gridRowStart()); 2056 return valueForGridPosition(style->gridRowStart());
2060 case CSSPropertyGridRowEnd: 2057 case CSSPropertyGridRowEnd:
2061 return valueForGridPosition(style->gridRowEnd()); 2058 return valueForGridPosition(style->gridRowEnd());
2062 case CSSPropertyGridColumn: 2059 case CSSPropertyGridColumn:
(...skipping 10 matching lines...) Expand all
2073 } 2070 }
2074 2071
2075 return CSSGridTemplateValue::create(style->namedGridArea(), style->n amedGridAreaRowCount(), style->namedGridAreaColumnCount()); 2072 return CSSGridTemplateValue::create(style->namedGridArea(), style->n amedGridAreaRowCount(), style->namedGridAreaColumnCount());
2076 2073
2077 case CSSPropertyHeight: 2074 case CSSPropertyHeight:
2078 if (renderer) { 2075 if (renderer) {
2079 // According to http://www.w3.org/TR/CSS2/visudet.html#the-heigh t-property, 2076 // According to http://www.w3.org/TR/CSS2/visudet.html#the-heigh t-property,
2080 // the "height" property does not apply for non-replaced inline elements. 2077 // the "height" property does not apply for non-replaced inline elements.
2081 if (!renderer->isReplaced() && renderer->isInline()) 2078 if (!renderer->isReplaced() && renderer->isInline())
2082 return cssValuePool().createIdentifierValue(CSSValueAuto); 2079 return cssValuePool().createIdentifierValue(CSSValueAuto);
2083 return zoomAdjustedPixelValue(sizingBox(renderer).height(), styl e.get()); 2080 return zoomAdjustedPixelValue(sizingBox(renderer).height(), *sty le);
2084 } 2081 }
2085 return zoomAdjustedPixelValueForLength(style->height(), style.get()) ; 2082 return zoomAdjustedPixelValueForLength(style->height(), *style);
2086 case CSSPropertyWebkitHighlight: 2083 case CSSPropertyWebkitHighlight:
2087 if (style->highlight() == nullAtom) 2084 if (style->highlight() == nullAtom)
2088 return cssValuePool().createIdentifierValue(CSSValueNone); 2085 return cssValuePool().createIdentifierValue(CSSValueNone);
2089 return cssValuePool().createValue(style->highlight(), CSSPrimitiveVa lue::CSS_STRING); 2086 return cssValuePool().createValue(style->highlight(), CSSPrimitiveVa lue::CSS_STRING);
2090 case CSSPropertyWebkitHyphenateCharacter: 2087 case CSSPropertyWebkitHyphenateCharacter:
2091 if (style->hyphenationString().isNull()) 2088 if (style->hyphenationString().isNull())
2092 return cssValuePool().createIdentifierValue(CSSValueAuto); 2089 return cssValuePool().createIdentifierValue(CSSValueAuto);
2093 return cssValuePool().createValue(style->hyphenationString(), CSSPri mitiveValue::CSS_STRING); 2090 return cssValuePool().createValue(style->hyphenationString(), CSSPri mitiveValue::CSS_STRING);
2094 case CSSPropertyWebkitBorderFit: 2091 case CSSPropertyWebkitBorderFit:
2095 if (style->borderFit() == BorderFitBorder) 2092 if (style->borderFit() == BorderFitBorder)
2096 return cssValuePool().createIdentifierValue(CSSValueBorder); 2093 return cssValuePool().createIdentifierValue(CSSValueBorder);
2097 return cssValuePool().createIdentifierValue(CSSValueLines); 2094 return cssValuePool().createIdentifierValue(CSSValueLines);
2098 case CSSPropertyImageRendering: 2095 case CSSPropertyImageRendering:
2099 return CSSPrimitiveValue::create(style->imageRendering()); 2096 return CSSPrimitiveValue::create(style->imageRendering());
2100 case CSSPropertyIsolation: 2097 case CSSPropertyIsolation:
2101 return cssValuePool().createValue(style->isolation()); 2098 return cssValuePool().createValue(style->isolation());
2102 case CSSPropertyLeft: 2099 case CSSPropertyLeft:
2103 return valueForPositionOffset(style.get(), CSSPropertyLeft, renderer , m_node->document().renderView()); 2100 return valueForPositionOffset(*style, CSSPropertyLeft, renderer, m_n ode->document().renderView());
2104 case CSSPropertyLetterSpacing: 2101 case CSSPropertyLetterSpacing:
2105 if (!style->letterSpacing()) 2102 if (!style->letterSpacing())
2106 return cssValuePool().createIdentifierValue(CSSValueNormal); 2103 return cssValuePool().createIdentifierValue(CSSValueNormal);
2107 return zoomAdjustedPixelValue(style->letterSpacing(), style.get()); 2104 return zoomAdjustedPixelValue(style->letterSpacing(), *style);
2108 case CSSPropertyWebkitLineClamp: 2105 case CSSPropertyWebkitLineClamp:
2109 if (style->lineClamp().isNone()) 2106 if (style->lineClamp().isNone())
2110 return cssValuePool().createIdentifierValue(CSSValueNone); 2107 return cssValuePool().createIdentifierValue(CSSValueNone);
2111 return cssValuePool().createValue(style->lineClamp().value(), style- >lineClamp().isPercentage() ? CSSPrimitiveValue::CSS_PERCENTAGE : CSSPrimitiveVa lue::CSS_NUMBER); 2108 return cssValuePool().createValue(style->lineClamp().value(), style- >lineClamp().isPercentage() ? CSSPrimitiveValue::CSS_PERCENTAGE : CSSPrimitiveVa lue::CSS_NUMBER);
2112 case CSSPropertyLineHeight: 2109 case CSSPropertyLineHeight:
2113 return valueForLineHeight(style.get(), m_node->document().renderView ()); 2110 return valueForLineHeight(*style, m_node->document().renderView());
2114 case CSSPropertyListStyleImage: 2111 case CSSPropertyListStyleImage:
2115 if (style->listStyleImage()) 2112 if (style->listStyleImage())
2116 return style->listStyleImage()->cssValue(); 2113 return style->listStyleImage()->cssValue();
2117 return cssValuePool().createIdentifierValue(CSSValueNone); 2114 return cssValuePool().createIdentifierValue(CSSValueNone);
2118 case CSSPropertyListStylePosition: 2115 case CSSPropertyListStylePosition:
2119 return cssValuePool().createValue(style->listStylePosition()); 2116 return cssValuePool().createValue(style->listStylePosition());
2120 case CSSPropertyListStyleType: 2117 case CSSPropertyListStyleType:
2121 return cssValuePool().createValue(style->listStyleType()); 2118 return cssValuePool().createValue(style->listStyleType());
2122 case CSSPropertyWebkitLocale: 2119 case CSSPropertyWebkitLocale:
2123 if (style->locale().isNull()) 2120 if (style->locale().isNull())
2124 return cssValuePool().createIdentifierValue(CSSValueAuto); 2121 return cssValuePool().createIdentifierValue(CSSValueAuto);
2125 return cssValuePool().createValue(style->locale(), CSSPrimitiveValue ::CSS_STRING); 2122 return cssValuePool().createValue(style->locale(), CSSPrimitiveValue ::CSS_STRING);
2126 case CSSPropertyMarginTop: { 2123 case CSSPropertyMarginTop: {
2127 Length marginTop = style->marginTop(); 2124 Length marginTop = style->marginTop();
2128 if (marginTop.isFixed() || !renderer || !renderer->isBox()) 2125 if (marginTop.isFixed() || !renderer || !renderer->isBox())
2129 return zoomAdjustedPixelValueForLength(marginTop, style.get()); 2126 return zoomAdjustedPixelValueForLength(marginTop, *style);
2130 return zoomAdjustedPixelValue(toRenderBox(renderer)->marginTop(), st yle.get()); 2127 return zoomAdjustedPixelValue(toRenderBox(renderer)->marginTop(), *s tyle);
2131 } 2128 }
2132 case CSSPropertyMarginRight: { 2129 case CSSPropertyMarginRight: {
2133 Length marginRight = style->marginRight(); 2130 Length marginRight = style->marginRight();
2134 if (marginRight.isFixed() || !renderer || !renderer->isBox()) 2131 if (marginRight.isFixed() || !renderer || !renderer->isBox())
2135 return zoomAdjustedPixelValueForLength(marginRight, style.get()) ; 2132 return zoomAdjustedPixelValueForLength(marginRight, *style);
2136 float value; 2133 float value;
2137 if (marginRight.isPercent() || marginRight.isViewportPercentage()) { 2134 if (marginRight.isPercent() || marginRight.isViewportPercentage()) {
2138 // RenderBox gives a marginRight() that is the distance between the right-edge of the child box 2135 // RenderBox gives a marginRight() that is the distance between the right-edge of the child box
2139 // and the right-edge of the containing box, when display == BLO CK. Let's calculate the absolute 2136 // and the right-edge of the containing box, when display == BLO CK. Let's calculate the absolute
2140 // value of the specified margin-right % instead of relying on R enderBox's marginRight() value. 2137 // value of the specified margin-right % instead of relying on R enderBox's marginRight() value.
2141 value = minimumValueForLength(marginRight, toRenderBox(renderer) ->containingBlockLogicalWidthForContent(), m_node->document().renderView()); 2138 value = minimumValueForLength(marginRight, toRenderBox(renderer) ->containingBlockLogicalWidthForContent(), m_node->document().renderView());
2142 } else { 2139 } else {
2143 value = toRenderBox(renderer)->marginRight(); 2140 value = toRenderBox(renderer)->marginRight();
2144 } 2141 }
2145 return zoomAdjustedPixelValue(value, style.get()); 2142 return zoomAdjustedPixelValue(value, *style);
2146 } 2143 }
2147 case CSSPropertyMarginBottom: { 2144 case CSSPropertyMarginBottom: {
2148 Length marginBottom = style->marginBottom(); 2145 Length marginBottom = style->marginBottom();
2149 if (marginBottom.isFixed() || !renderer || !renderer->isBox()) 2146 if (marginBottom.isFixed() || !renderer || !renderer->isBox())
2150 return zoomAdjustedPixelValueForLength(marginBottom, style.get() ); 2147 return zoomAdjustedPixelValueForLength(marginBottom, *style);
2151 return zoomAdjustedPixelValue(toRenderBox(renderer)->marginBottom(), style.get()); 2148 return zoomAdjustedPixelValue(toRenderBox(renderer)->marginBottom(), *style);
2152 } 2149 }
2153 case CSSPropertyMarginLeft: { 2150 case CSSPropertyMarginLeft: {
2154 Length marginLeft = style->marginLeft(); 2151 Length marginLeft = style->marginLeft();
2155 if (marginLeft.isFixed() || !renderer || !renderer->isBox()) 2152 if (marginLeft.isFixed() || !renderer || !renderer->isBox())
2156 return zoomAdjustedPixelValueForLength(marginLeft, style.get()); 2153 return zoomAdjustedPixelValueForLength(marginLeft, *style);
2157 return zoomAdjustedPixelValue(toRenderBox(renderer)->marginLeft(), s tyle.get()); 2154 return zoomAdjustedPixelValue(toRenderBox(renderer)->marginLeft(), * style);
2158 } 2155 }
2159 case CSSPropertyWebkitUserModify: 2156 case CSSPropertyWebkitUserModify:
2160 return cssValuePool().createValue(style->userModify()); 2157 return cssValuePool().createValue(style->userModify());
2161 case CSSPropertyMaxHeight: { 2158 case CSSPropertyMaxHeight: {
2162 const Length& maxHeight = style->maxHeight(); 2159 const Length& maxHeight = style->maxHeight();
2163 if (maxHeight.isUndefined()) 2160 if (maxHeight.isUndefined())
2164 return cssValuePool().createIdentifierValue(CSSValueNone); 2161 return cssValuePool().createIdentifierValue(CSSValueNone);
2165 return zoomAdjustedPixelValueForLength(maxHeight, style.get()); 2162 return zoomAdjustedPixelValueForLength(maxHeight, *style);
2166 } 2163 }
2167 case CSSPropertyMaxWidth: { 2164 case CSSPropertyMaxWidth: {
2168 const Length& maxWidth = style->maxWidth(); 2165 const Length& maxWidth = style->maxWidth();
2169 if (maxWidth.isUndefined()) 2166 if (maxWidth.isUndefined())
2170 return cssValuePool().createIdentifierValue(CSSValueNone); 2167 return cssValuePool().createIdentifierValue(CSSValueNone);
2171 return zoomAdjustedPixelValueForLength(maxWidth, style.get()); 2168 return zoomAdjustedPixelValueForLength(maxWidth, *style);
2172 } 2169 }
2173 case CSSPropertyMinHeight: 2170 case CSSPropertyMinHeight:
2174 // FIXME: For flex-items, min-height:auto should compute to min-cont ent. 2171 // FIXME: For flex-items, min-height:auto should compute to min-cont ent.
2175 if (style->minHeight().isAuto()) 2172 if (style->minHeight().isAuto())
2176 return zoomAdjustedPixelValue(0, style.get()); 2173 return zoomAdjustedPixelValue(0, *style);
2177 return zoomAdjustedPixelValueForLength(style->minHeight(), style.get ()); 2174 return zoomAdjustedPixelValueForLength(style->minHeight(), *style);
2178 case CSSPropertyMinWidth: 2175 case CSSPropertyMinWidth:
2179 // FIXME: For flex-items, min-width:auto should compute to min-conte nt. 2176 // FIXME: For flex-items, min-width:auto should compute to min-conte nt.
2180 if (style->minWidth().isAuto()) 2177 if (style->minWidth().isAuto())
2181 return zoomAdjustedPixelValue(0, style.get()); 2178 return zoomAdjustedPixelValue(0, *style);
2182 return zoomAdjustedPixelValueForLength(style->minWidth(), style.get( )); 2179 return zoomAdjustedPixelValueForLength(style->minWidth(), *style);
2183 case CSSPropertyObjectFit: 2180 case CSSPropertyObjectFit:
2184 return cssValuePool().createValue(style->objectFit()); 2181 return cssValuePool().createValue(style->objectFit());
2185 case CSSPropertyObjectPosition: 2182 case CSSPropertyObjectPosition:
2186 return cssValuePool().createValue( 2183 return cssValuePool().createValue(
2187 Pair::create( 2184 Pair::create(
2188 zoomAdjustedPixelValueForLength(style->objectPosition().x(), style.get()), 2185 zoomAdjustedPixelValueForLength(style->objectPosition().x(), *style),
2189 zoomAdjustedPixelValueForLength(style->objectPosition().y(), style.get()), 2186 zoomAdjustedPixelValueForLength(style->objectPosition().y(), *style),
2190 Pair::KeepIdenticalValues)); 2187 Pair::KeepIdenticalValues));
2191 case CSSPropertyOpacity: 2188 case CSSPropertyOpacity:
2192 return cssValuePool().createValue(style->opacity(), CSSPrimitiveValu e::CSS_NUMBER); 2189 return cssValuePool().createValue(style->opacity(), CSSPrimitiveValu e::CSS_NUMBER);
2193 case CSSPropertyOrphans: 2190 case CSSPropertyOrphans:
2194 if (style->hasAutoOrphans()) 2191 if (style->hasAutoOrphans())
2195 return cssValuePool().createIdentifierValue(CSSValueAuto); 2192 return cssValuePool().createIdentifierValue(CSSValueAuto);
2196 return cssValuePool().createValue(style->orphans(), CSSPrimitiveValu e::CSS_NUMBER); 2193 return cssValuePool().createValue(style->orphans(), CSSPrimitiveValu e::CSS_NUMBER);
2197 case CSSPropertyOutlineColor: 2194 case CSSPropertyOutlineColor:
2198 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor (style.get(), style->outlineColor()); 2195 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor (*style, style->outlineColor());
2199 case CSSPropertyOutlineOffset: 2196 case CSSPropertyOutlineOffset:
2200 return zoomAdjustedPixelValue(style->outlineOffset(), style.get()); 2197 return zoomAdjustedPixelValue(style->outlineOffset(), *style);
2201 case CSSPropertyOutlineStyle: 2198 case CSSPropertyOutlineStyle:
2202 if (style->outlineStyleIsAuto()) 2199 if (style->outlineStyleIsAuto())
2203 return cssValuePool().createIdentifierValue(CSSValueAuto); 2200 return cssValuePool().createIdentifierValue(CSSValueAuto);
2204 return cssValuePool().createValue(style->outlineStyle()); 2201 return cssValuePool().createValue(style->outlineStyle());
2205 case CSSPropertyOutlineWidth: 2202 case CSSPropertyOutlineWidth:
2206 return zoomAdjustedPixelValue(style->outlineWidth(), style.get()); 2203 return zoomAdjustedPixelValue(style->outlineWidth(), *style);
2207 case CSSPropertyOverflow: 2204 case CSSPropertyOverflow:
2208 return cssValuePool().createValue(max(style->overflowX(), style->ove rflowY())); 2205 return cssValuePool().createValue(max(style->overflowX(), style->ove rflowY()));
2209 case CSSPropertyOverflowWrap: 2206 case CSSPropertyOverflowWrap:
2210 return cssValuePool().createValue(style->overflowWrap()); 2207 return cssValuePool().createValue(style->overflowWrap());
2211 case CSSPropertyOverflowX: 2208 case CSSPropertyOverflowX:
2212 return cssValuePool().createValue(style->overflowX()); 2209 return cssValuePool().createValue(style->overflowX());
2213 case CSSPropertyOverflowY: 2210 case CSSPropertyOverflowY:
2214 return cssValuePool().createValue(style->overflowY()); 2211 return cssValuePool().createValue(style->overflowY());
2215 case CSSPropertyPaddingTop: { 2212 case CSSPropertyPaddingTop: {
2216 Length paddingTop = style->paddingTop(); 2213 Length paddingTop = style->paddingTop();
2217 if (paddingTop.isFixed() || !renderer || !renderer->isBox()) 2214 if (paddingTop.isFixed() || !renderer || !renderer->isBox())
2218 return zoomAdjustedPixelValueForLength(paddingTop, style.get()); 2215 return zoomAdjustedPixelValueForLength(paddingTop, *style);
2219 return zoomAdjustedPixelValue(toRenderBox(renderer)->computedCSSPadd ingTop(), style.get()); 2216 return zoomAdjustedPixelValue(toRenderBox(renderer)->computedCSSPadd ingTop(), *style);
2220 } 2217 }
2221 case CSSPropertyPaddingRight: { 2218 case CSSPropertyPaddingRight: {
2222 Length paddingRight = style->paddingRight(); 2219 Length paddingRight = style->paddingRight();
2223 if (paddingRight.isFixed() || !renderer || !renderer->isBox()) 2220 if (paddingRight.isFixed() || !renderer || !renderer->isBox())
2224 return zoomAdjustedPixelValueForLength(paddingRight, style.get() ); 2221 return zoomAdjustedPixelValueForLength(paddingRight, *style);
2225 return zoomAdjustedPixelValue(toRenderBox(renderer)->computedCSSPadd ingRight(), style.get()); 2222 return zoomAdjustedPixelValue(toRenderBox(renderer)->computedCSSPadd ingRight(), *style);
2226 } 2223 }
2227 case CSSPropertyPaddingBottom: { 2224 case CSSPropertyPaddingBottom: {
2228 Length paddingBottom = style->paddingBottom(); 2225 Length paddingBottom = style->paddingBottom();
2229 if (paddingBottom.isFixed() || !renderer || !renderer->isBox()) 2226 if (paddingBottom.isFixed() || !renderer || !renderer->isBox())
2230 return zoomAdjustedPixelValueForLength(paddingBottom, style.get( )); 2227 return zoomAdjustedPixelValueForLength(paddingBottom, *style);
2231 return zoomAdjustedPixelValue(toRenderBox(renderer)->computedCSSPadd ingBottom(), style.get()); 2228 return zoomAdjustedPixelValue(toRenderBox(renderer)->computedCSSPadd ingBottom(), *style);
2232 } 2229 }
2233 case CSSPropertyPaddingLeft: { 2230 case CSSPropertyPaddingLeft: {
2234 Length paddingLeft = style->paddingLeft(); 2231 Length paddingLeft = style->paddingLeft();
2235 if (paddingLeft.isFixed() || !renderer || !renderer->isBox()) 2232 if (paddingLeft.isFixed() || !renderer || !renderer->isBox())
2236 return zoomAdjustedPixelValueForLength(paddingLeft, style.get()) ; 2233 return zoomAdjustedPixelValueForLength(paddingLeft, *style);
2237 return zoomAdjustedPixelValue(toRenderBox(renderer)->computedCSSPadd ingLeft(), style.get()); 2234 return zoomAdjustedPixelValue(toRenderBox(renderer)->computedCSSPadd ingLeft(), *style);
2238 } 2235 }
2239 case CSSPropertyPageBreakAfter: 2236 case CSSPropertyPageBreakAfter:
2240 return cssValuePool().createValue(style->pageBreakAfter()); 2237 return cssValuePool().createValue(style->pageBreakAfter());
2241 case CSSPropertyPageBreakBefore: 2238 case CSSPropertyPageBreakBefore:
2242 return cssValuePool().createValue(style->pageBreakBefore()); 2239 return cssValuePool().createValue(style->pageBreakBefore());
2243 case CSSPropertyPageBreakInside: { 2240 case CSSPropertyPageBreakInside: {
2244 EPageBreak pageBreak = style->pageBreakInside(); 2241 EPageBreak pageBreak = style->pageBreakInside();
2245 ASSERT(pageBreak != PBALWAYS); 2242 ASSERT(pageBreak != PBALWAYS);
2246 if (pageBreak == PBALWAYS) 2243 if (pageBreak == PBALWAYS)
2247 return 0; 2244 return 0;
2248 return cssValuePool().createValue(style->pageBreakInside()); 2245 return cssValuePool().createValue(style->pageBreakInside());
2249 } 2246 }
2250 case CSSPropertyPosition: 2247 case CSSPropertyPosition:
2251 return cssValuePool().createValue(style->position()); 2248 return cssValuePool().createValue(style->position());
2252 case CSSPropertyRight: 2249 case CSSPropertyRight:
2253 return valueForPositionOffset(style.get(), CSSPropertyRight, rendere r, m_node->document().renderView()); 2250 return valueForPositionOffset(*style, CSSPropertyRight, renderer, m_ node->document().renderView());
2254 case CSSPropertyWebkitRubyPosition: 2251 case CSSPropertyWebkitRubyPosition:
2255 return cssValuePool().createValue(style->rubyPosition()); 2252 return cssValuePool().createValue(style->rubyPosition());
2256 case CSSPropertyTableLayout: 2253 case CSSPropertyTableLayout:
2257 return cssValuePool().createValue(style->tableLayout()); 2254 return cssValuePool().createValue(style->tableLayout());
2258 case CSSPropertyTextAlign: 2255 case CSSPropertyTextAlign:
2259 return cssValuePool().createValue(style->textAlign()); 2256 return cssValuePool().createValue(style->textAlign());
2260 case CSSPropertyTextAlignLast: 2257 case CSSPropertyTextAlignLast:
2261 return cssValuePool().createValue(style->textAlignLast()); 2258 return cssValuePool().createValue(style->textAlignLast());
2262 case CSSPropertyTextDecoration: 2259 case CSSPropertyTextDecoration:
2263 return valuesForShorthandProperty(textDecorationShorthand()); 2260 return valuesForShorthandProperty(textDecorationShorthand());
2264 case CSSPropertyTextDecorationLine: 2261 case CSSPropertyTextDecorationLine:
2265 return renderTextDecorationFlagsToCSSValue(style->textDecoration()); 2262 return renderTextDecorationFlagsToCSSValue(style->textDecoration());
2266 case CSSPropertyTextDecorationStyle: 2263 case CSSPropertyTextDecorationStyle:
2267 return valueForTextDecorationStyle(style->textDecorationStyle()); 2264 return valueForTextDecorationStyle(style->textDecorationStyle());
2268 case CSSPropertyTextDecorationColor: 2265 case CSSPropertyTextDecorationColor:
2269 return currentColorOrValidColor(style.get(), style->textDecorationCo lor()); 2266 return currentColorOrValidColor(*style, style->textDecorationColor() );
2270 case CSSPropertyTextJustify: 2267 case CSSPropertyTextJustify:
2271 return cssValuePool().createValue(style->textJustify()); 2268 return cssValuePool().createValue(style->textJustify());
2272 case CSSPropertyTextUnderlinePosition: 2269 case CSSPropertyTextUnderlinePosition:
2273 return cssValuePool().createValue(style->textUnderlinePosition()); 2270 return cssValuePool().createValue(style->textUnderlinePosition());
2274 case CSSPropertyWebkitTextDecorationsInEffect: 2271 case CSSPropertyWebkitTextDecorationsInEffect:
2275 return renderTextDecorationFlagsToCSSValue(style->textDecorationsInE ffect()); 2272 return renderTextDecorationFlagsToCSSValue(style->textDecorationsInE ffect());
2276 case CSSPropertyWebkitTextFillColor: 2273 case CSSPropertyWebkitTextFillColor:
2277 return currentColorOrValidColor(style.get(), style->textFillColor()) ; 2274 return currentColorOrValidColor(*style, style->textFillColor());
2278 case CSSPropertyWebkitTextEmphasisColor: 2275 case CSSPropertyWebkitTextEmphasisColor:
2279 return currentColorOrValidColor(style.get(), style->textEmphasisColo r()); 2276 return currentColorOrValidColor(*style, style->textEmphasisColor());
2280 case CSSPropertyWebkitTextEmphasisPosition: 2277 case CSSPropertyWebkitTextEmphasisPosition:
2281 return cssValuePool().createValue(style->textEmphasisPosition()); 2278 return cssValuePool().createValue(style->textEmphasisPosition());
2282 case CSSPropertyWebkitTextEmphasisStyle: 2279 case CSSPropertyWebkitTextEmphasisStyle:
2283 switch (style->textEmphasisMark()) { 2280 switch (style->textEmphasisMark()) {
2284 case TextEmphasisMarkNone: 2281 case TextEmphasisMarkNone:
2285 return cssValuePool().createIdentifierValue(CSSValueNone); 2282 return cssValuePool().createIdentifierValue(CSSValueNone);
2286 case TextEmphasisMarkCustom: 2283 case TextEmphasisMarkCustom:
2287 return cssValuePool().createValue(style->textEmphasisCustomMark( ), CSSPrimitiveValue::CSS_STRING); 2284 return cssValuePool().createValue(style->textEmphasisCustomMark( ), CSSPrimitiveValue::CSS_STRING);
2288 case TextEmphasisMarkAuto: 2285 case TextEmphasisMarkAuto:
2289 ASSERT_NOT_REACHED(); 2286 ASSERT_NOT_REACHED();
2290 // Fall through 2287 // Fall through
2291 case TextEmphasisMarkDot: 2288 case TextEmphasisMarkDot:
2292 case TextEmphasisMarkCircle: 2289 case TextEmphasisMarkCircle:
2293 case TextEmphasisMarkDoubleCircle: 2290 case TextEmphasisMarkDoubleCircle:
2294 case TextEmphasisMarkTriangle: 2291 case TextEmphasisMarkTriangle:
2295 case TextEmphasisMarkSesame: { 2292 case TextEmphasisMarkSesame: {
2296 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ; 2293 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ;
2297 list->append(cssValuePool().createValue(style->textEmphasisFill( ))); 2294 list->append(cssValuePool().createValue(style->textEmphasisFill( )));
2298 list->append(cssValuePool().createValue(style->textEmphasisMark( ))); 2295 list->append(cssValuePool().createValue(style->textEmphasisMark( )));
2299 return list.release(); 2296 return list.release();
2300 } 2297 }
2301 } 2298 }
2302 case CSSPropertyTextIndent: { 2299 case CSSPropertyTextIndent: {
2303 RefPtr<CSSValue> textIndent = zoomAdjustedPixelValueForLength(style- >textIndent(), style.get()); 2300 RefPtr<CSSValue> textIndent = zoomAdjustedPixelValueForLength(style- >textIndent(), *style);
2304 if (RuntimeEnabledFeatures::css3TextEnabled() && style->textIndentLi ne() == TextIndentEachLine) { 2301 if (RuntimeEnabledFeatures::css3TextEnabled() && style->textIndentLi ne() == TextIndentEachLine) {
2305 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ; 2302 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ;
2306 list->append(textIndent.release()); 2303 list->append(textIndent.release());
2307 list->append(cssValuePool().createIdentifierValue(CSSValueEachLi ne)); 2304 list->append(cssValuePool().createIdentifierValue(CSSValueEachLi ne));
2308 return list.release(); 2305 return list.release();
2309 } 2306 }
2310 return textIndent.release(); 2307 return textIndent.release();
2311 } 2308 }
2312 case CSSPropertyTextShadow: 2309 case CSSPropertyTextShadow:
2313 return valueForShadowList(style->textShadow(), style.get(), false); 2310 return valueForShadowList(style->textShadow(), *style, false);
2314 case CSSPropertyTextRendering: 2311 case CSSPropertyTextRendering:
2315 return cssValuePool().createValue(style->fontDescription().textRende ringMode()); 2312 return cssValuePool().createValue(style->fontDescription().textRende ringMode());
2316 case CSSPropertyTextOverflow: 2313 case CSSPropertyTextOverflow:
2317 if (style->textOverflow()) 2314 if (style->textOverflow())
2318 return cssValuePool().createIdentifierValue(CSSValueEllipsis); 2315 return cssValuePool().createIdentifierValue(CSSValueEllipsis);
2319 return cssValuePool().createIdentifierValue(CSSValueClip); 2316 return cssValuePool().createIdentifierValue(CSSValueClip);
2320 case CSSPropertyWebkitTextSecurity: 2317 case CSSPropertyWebkitTextSecurity:
2321 return cssValuePool().createValue(style->textSecurity()); 2318 return cssValuePool().createValue(style->textSecurity());
2322 case CSSPropertyWebkitTextStrokeColor: 2319 case CSSPropertyWebkitTextStrokeColor:
2323 return currentColorOrValidColor(style.get(), style->textStrokeColor( )); 2320 return currentColorOrValidColor(*style, style->textStrokeColor());
2324 case CSSPropertyWebkitTextStrokeWidth: 2321 case CSSPropertyWebkitTextStrokeWidth:
2325 return zoomAdjustedPixelValue(style->textStrokeWidth(), style.get()) ; 2322 return zoomAdjustedPixelValue(style->textStrokeWidth(), *style);
2326 case CSSPropertyTextTransform: 2323 case CSSPropertyTextTransform:
2327 return cssValuePool().createValue(style->textTransform()); 2324 return cssValuePool().createValue(style->textTransform());
2328 case CSSPropertyTop: 2325 case CSSPropertyTop:
2329 return valueForPositionOffset(style.get(), CSSPropertyTop, renderer, m_node->document().renderView()); 2326 return valueForPositionOffset(*style, CSSPropertyTop, renderer, m_no de->document().renderView());
2330 case CSSPropertyTouchAction: 2327 case CSSPropertyTouchAction:
2331 return cssValuePool().createValue(style->touchAction()); 2328 return cssValuePool().createValue(style->touchAction());
2332 case CSSPropertyTouchActionDelay: 2329 case CSSPropertyTouchActionDelay:
2333 return cssValuePool().createValue(style->touchActionDelay()); 2330 return cssValuePool().createValue(style->touchActionDelay());
2334 case CSSPropertyUnicodeBidi: 2331 case CSSPropertyUnicodeBidi:
2335 return cssValuePool().createValue(style->unicodeBidi()); 2332 return cssValuePool().createValue(style->unicodeBidi());
2336 case CSSPropertyVerticalAlign: 2333 case CSSPropertyVerticalAlign:
2337 switch (style->verticalAlign()) { 2334 switch (style->verticalAlign()) {
2338 case BASELINE: 2335 case BASELINE:
2339 return cssValuePool().createIdentifierValue(CSSValueBaseline ); 2336 return cssValuePool().createIdentifierValue(CSSValueBaseline );
(...skipping 25 matching lines...) Expand all
2365 case CSSPropertyWidows: 2362 case CSSPropertyWidows:
2366 if (style->hasAutoWidows()) 2363 if (style->hasAutoWidows())
2367 return cssValuePool().createIdentifierValue(CSSValueAuto); 2364 return cssValuePool().createIdentifierValue(CSSValueAuto);
2368 return cssValuePool().createValue(style->widows(), CSSPrimitiveValue ::CSS_NUMBER); 2365 return cssValuePool().createValue(style->widows(), CSSPrimitiveValue ::CSS_NUMBER);
2369 case CSSPropertyWidth: 2366 case CSSPropertyWidth:
2370 if (renderer) { 2367 if (renderer) {
2371 // According to http://www.w3.org/TR/CSS2/visudet.html#the-width -property, 2368 // According to http://www.w3.org/TR/CSS2/visudet.html#the-width -property,
2372 // the "width" property does not apply for non-replaced inline e lements. 2369 // the "width" property does not apply for non-replaced inline e lements.
2373 if (!renderer->isReplaced() && renderer->isInline()) 2370 if (!renderer->isReplaced() && renderer->isInline())
2374 return cssValuePool().createIdentifierValue(CSSValueAuto); 2371 return cssValuePool().createIdentifierValue(CSSValueAuto);
2375 return zoomAdjustedPixelValue(sizingBox(renderer).width(), style .get()); 2372 return zoomAdjustedPixelValue(sizingBox(renderer).width(), *styl e);
2376 } 2373 }
2377 return zoomAdjustedPixelValueForLength(style->width(), style.get()); 2374 return zoomAdjustedPixelValueForLength(style->width(), *style);
2378 case CSSPropertyWordBreak: 2375 case CSSPropertyWordBreak:
2379 return cssValuePool().createValue(style->wordBreak()); 2376 return cssValuePool().createValue(style->wordBreak());
2380 case CSSPropertyWordSpacing: 2377 case CSSPropertyWordSpacing:
2381 return zoomAdjustedPixelValue(style->wordSpacing(), style.get()); 2378 return zoomAdjustedPixelValue(style->wordSpacing(), *style);
2382 case CSSPropertyWordWrap: 2379 case CSSPropertyWordWrap:
2383 return cssValuePool().createValue(style->overflowWrap()); 2380 return cssValuePool().createValue(style->overflowWrap());
2384 case CSSPropertyWebkitLineBreak: 2381 case CSSPropertyWebkitLineBreak:
2385 return cssValuePool().createValue(style->lineBreak()); 2382 return cssValuePool().createValue(style->lineBreak());
2386 case CSSPropertyResize: 2383 case CSSPropertyResize:
2387 return cssValuePool().createValue(style->resize()); 2384 return cssValuePool().createValue(style->resize());
2388 case CSSPropertyWebkitFontKerning: 2385 case CSSPropertyWebkitFontKerning:
2389 return cssValuePool().createValue(style->fontDescription().kerning() ); 2386 return cssValuePool().createValue(style->fontDescription().kerning() );
2390 case CSSPropertyWebkitFontSmoothing: 2387 case CSSPropertyWebkitFontSmoothing:
2391 return cssValuePool().createValue(style->fontDescription().fontSmoot hing()); 2388 return cssValuePool().createValue(style->fontDescription().fontSmoot hing());
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 } 2539 }
2543 case CSSPropertyWebkitAppearance: 2540 case CSSPropertyWebkitAppearance:
2544 return cssValuePool().createValue(style->appearance()); 2541 return cssValuePool().createValue(style->appearance());
2545 case CSSPropertyWebkitAspectRatio: 2542 case CSSPropertyWebkitAspectRatio:
2546 if (!style->hasAspectRatio()) 2543 if (!style->hasAspectRatio())
2547 return cssValuePool().createIdentifierValue(CSSValueNone); 2544 return cssValuePool().createIdentifierValue(CSSValueNone);
2548 return CSSAspectRatioValue::create(style->aspectRatioNumerator(), st yle->aspectRatioDenominator()); 2545 return CSSAspectRatioValue::create(style->aspectRatioNumerator(), st yle->aspectRatioDenominator());
2549 case CSSPropertyWebkitBackfaceVisibility: 2546 case CSSPropertyWebkitBackfaceVisibility:
2550 return cssValuePool().createIdentifierValue((style->backfaceVisibili ty() == BackfaceVisibilityHidden) ? CSSValueHidden : CSSValueVisible); 2547 return cssValuePool().createIdentifierValue((style->backfaceVisibili ty() == BackfaceVisibilityHidden) ? CSSValueHidden : CSSValueVisible);
2551 case CSSPropertyWebkitBorderImage: 2548 case CSSPropertyWebkitBorderImage:
2552 return valueForNinePieceImage(style->borderImage(), style.get()); 2549 return valueForNinePieceImage(style->borderImage(), *style);
2553 case CSSPropertyBorderImageOutset: 2550 case CSSPropertyBorderImageOutset:
2554 return valueForNinePieceImageQuad(style->borderImage().outset(), sty le.get()); 2551 return valueForNinePieceImageQuad(style->borderImage().outset(), *st yle);
2555 case CSSPropertyBorderImageRepeat: 2552 case CSSPropertyBorderImageRepeat:
2556 return valueForNinePieceImageRepeat(style->borderImage()); 2553 return valueForNinePieceImageRepeat(style->borderImage());
2557 case CSSPropertyBorderImageSlice: 2554 case CSSPropertyBorderImageSlice:
2558 return valueForNinePieceImageSlice(style->borderImage()); 2555 return valueForNinePieceImageSlice(style->borderImage());
2559 case CSSPropertyBorderImageWidth: 2556 case CSSPropertyBorderImageWidth:
2560 return valueForNinePieceImageQuad(style->borderImage().borderSlices( ), style.get()); 2557 return valueForNinePieceImageQuad(style->borderImage().borderSlices( ), *style);
2561 case CSSPropertyWebkitMaskBoxImage: 2558 case CSSPropertyWebkitMaskBoxImage:
2562 return valueForNinePieceImage(style->maskBoxImage(), style.get()); 2559 return valueForNinePieceImage(style->maskBoxImage(), *style);
2563 case CSSPropertyWebkitMaskBoxImageOutset: 2560 case CSSPropertyWebkitMaskBoxImageOutset:
2564 return valueForNinePieceImageQuad(style->maskBoxImage().outset(), st yle.get()); 2561 return valueForNinePieceImageQuad(style->maskBoxImage().outset(), *s tyle);
2565 case CSSPropertyWebkitMaskBoxImageRepeat: 2562 case CSSPropertyWebkitMaskBoxImageRepeat:
2566 return valueForNinePieceImageRepeat(style->maskBoxImage()); 2563 return valueForNinePieceImageRepeat(style->maskBoxImage());
2567 case CSSPropertyWebkitMaskBoxImageSlice: 2564 case CSSPropertyWebkitMaskBoxImageSlice:
2568 return valueForNinePieceImageSlice(style->maskBoxImage()); 2565 return valueForNinePieceImageSlice(style->maskBoxImage());
2569 case CSSPropertyWebkitMaskBoxImageWidth: 2566 case CSSPropertyWebkitMaskBoxImageWidth:
2570 return valueForNinePieceImageQuad(style->maskBoxImage().borderSlices (), style.get()); 2567 return valueForNinePieceImageQuad(style->maskBoxImage().borderSlices (), *style);
2571 case CSSPropertyWebkitMaskBoxImageSource: 2568 case CSSPropertyWebkitMaskBoxImageSource:
2572 if (style->maskBoxImageSource()) 2569 if (style->maskBoxImageSource())
2573 return style->maskBoxImageSource()->cssValue(); 2570 return style->maskBoxImageSource()->cssValue();
2574 return cssValuePool().createIdentifierValue(CSSValueNone); 2571 return cssValuePool().createIdentifierValue(CSSValueNone);
2575 case CSSPropertyWebkitFontSizeDelta: 2572 case CSSPropertyWebkitFontSizeDelta:
2576 // Not a real style property -- used by the editing engine -- so has no computed value. 2573 // Not a real style property -- used by the editing engine -- so has no computed value.
2577 break; 2574 break;
2578 case CSSPropertyWebkitMarginBottomCollapse: 2575 case CSSPropertyWebkitMarginBottomCollapse:
2579 case CSSPropertyWebkitMarginAfterCollapse: 2576 case CSSPropertyWebkitMarginAfterCollapse:
2580 return cssValuePool().createValue(style->marginAfterCollapse()); 2577 return cssValuePool().createValue(style->marginAfterCollapse());
2581 case CSSPropertyWebkitMarginTopCollapse: 2578 case CSSPropertyWebkitMarginTopCollapse:
2582 case CSSPropertyWebkitMarginBeforeCollapse: 2579 case CSSPropertyWebkitMarginBeforeCollapse:
2583 return cssValuePool().createValue(style->marginBeforeCollapse()); 2580 return cssValuePool().createValue(style->marginBeforeCollapse());
2584 case CSSPropertyWebkitPerspective: 2581 case CSSPropertyWebkitPerspective:
2585 if (!style->hasPerspective()) 2582 if (!style->hasPerspective())
2586 return cssValuePool().createIdentifierValue(CSSValueNone); 2583 return cssValuePool().createIdentifierValue(CSSValueNone);
2587 return zoomAdjustedPixelValue(style->perspective(), style.get()); 2584 return zoomAdjustedPixelValue(style->perspective(), *style);
2588 case CSSPropertyWebkitPerspectiveOrigin: { 2585 case CSSPropertyWebkitPerspectiveOrigin: {
2589 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 2586 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
2590 if (renderer) { 2587 if (renderer) {
2591 LayoutRect box; 2588 LayoutRect box;
2592 if (renderer->isBox()) 2589 if (renderer->isBox())
2593 box = toRenderBox(renderer)->borderBoxRect(); 2590 box = toRenderBox(renderer)->borderBoxRect();
2594 2591
2595 RenderView* renderView = m_node->document().renderView(); 2592 RenderView* renderView = m_node->document().renderView();
2596 list->append(zoomAdjustedPixelValue(minimumValueForLength(style- >perspectiveOriginX(), box.width(), renderView), style.get())); 2593 list->append(zoomAdjustedPixelValue(minimumValueForLength(style- >perspectiveOriginX(), box.width(), renderView), *style));
2597 list->append(zoomAdjustedPixelValue(minimumValueForLength(style- >perspectiveOriginY(), box.height(), renderView), style.get())); 2594 list->append(zoomAdjustedPixelValue(minimumValueForLength(style- >perspectiveOriginY(), box.height(), renderView), *style));
2598 } 2595 }
2599 else { 2596 else {
2600 list->append(zoomAdjustedPixelValueForLength(style->perspectiveO riginX(), style.get())); 2597 list->append(zoomAdjustedPixelValueForLength(style->perspectiveO riginX(), *style));
2601 list->append(zoomAdjustedPixelValueForLength(style->perspectiveO riginY(), style.get())); 2598 list->append(zoomAdjustedPixelValueForLength(style->perspectiveO riginY(), *style));
2602 2599
2603 } 2600 }
2604 return list.release(); 2601 return list.release();
2605 } 2602 }
2606 case CSSPropertyWebkitRtlOrdering: 2603 case CSSPropertyWebkitRtlOrdering:
2607 return cssValuePool().createIdentifierValue(style->rtlOrdering() ? C SSValueVisual : CSSValueLogical); 2604 return cssValuePool().createIdentifierValue(style->rtlOrdering() ? C SSValueVisual : CSSValueLogical);
2608 case CSSPropertyWebkitTapHighlightColor: 2605 case CSSPropertyWebkitTapHighlightColor:
2609 return currentColorOrValidColor(style.get(), style->tapHighlightColo r()); 2606 return currentColorOrValidColor(*style, style->tapHighlightColor());
2610 case CSSPropertyWebkitUserDrag: 2607 case CSSPropertyWebkitUserDrag:
2611 return cssValuePool().createValue(style->userDrag()); 2608 return cssValuePool().createValue(style->userDrag());
2612 case CSSPropertyWebkitUserSelect: 2609 case CSSPropertyWebkitUserSelect:
2613 return cssValuePool().createValue(style->userSelect()); 2610 return cssValuePool().createValue(style->userSelect());
2614 case CSSPropertyBorderBottomLeftRadius: 2611 case CSSPropertyBorderBottomLeftRadius:
2615 return valueForBorderRadiusCorner(style->borderBottomLeftRadius(), s tyle.get()); 2612 return valueForBorderRadiusCorner(style->borderBottomLeftRadius(), * style);
2616 case CSSPropertyBorderBottomRightRadius: 2613 case CSSPropertyBorderBottomRightRadius:
2617 return valueForBorderRadiusCorner(style->borderBottomRightRadius(), style.get()); 2614 return valueForBorderRadiusCorner(style->borderBottomRightRadius(), *style);
2618 case CSSPropertyBorderTopLeftRadius: 2615 case CSSPropertyBorderTopLeftRadius:
2619 return valueForBorderRadiusCorner(style->borderTopLeftRadius(), styl e.get()); 2616 return valueForBorderRadiusCorner(style->borderTopLeftRadius(), *sty le);
2620 case CSSPropertyBorderTopRightRadius: 2617 case CSSPropertyBorderTopRightRadius:
2621 return valueForBorderRadiusCorner(style->borderTopRightRadius(), sty le.get()); 2618 return valueForBorderRadiusCorner(style->borderTopRightRadius(), *st yle);
2622 case CSSPropertyClip: { 2619 case CSSPropertyClip: {
2623 if (!style->hasClip()) 2620 if (!style->hasClip())
2624 return cssValuePool().createIdentifierValue(CSSValueAuto); 2621 return cssValuePool().createIdentifierValue(CSSValueAuto);
2625 RefPtr<Rect> rect = Rect::create(); 2622 RefPtr<Rect> rect = Rect::create();
2626 rect->setTop(zoomAdjustedPixelValue(style->clip().top().value(), sty le.get())); 2623 rect->setTop(zoomAdjustedPixelValue(style->clip().top().value(), *st yle));
2627 rect->setRight(zoomAdjustedPixelValue(style->clip().right().value(), style.get())); 2624 rect->setRight(zoomAdjustedPixelValue(style->clip().right().value(), *style));
2628 rect->setBottom(zoomAdjustedPixelValue(style->clip().bottom().value( ), style.get())); 2625 rect->setBottom(zoomAdjustedPixelValue(style->clip().bottom().value( ), *style));
2629 rect->setLeft(zoomAdjustedPixelValue(style->clip().left().value(), s tyle.get())); 2626 rect->setLeft(zoomAdjustedPixelValue(style->clip().left().value(), * style));
2630 return cssValuePool().createValue(rect.release()); 2627 return cssValuePool().createValue(rect.release());
2631 } 2628 }
2632 case CSSPropertySpeak: 2629 case CSSPropertySpeak:
2633 return cssValuePool().createValue(style->speak()); 2630 return cssValuePool().createValue(style->speak());
2634 case CSSPropertyWebkitTransform: 2631 case CSSPropertyWebkitTransform:
2635 return computedTransform(renderer, style.get()); 2632 return computedTransform(renderer, *style);
2636 case CSSPropertyWebkitTransformOrigin: { 2633 case CSSPropertyWebkitTransformOrigin: {
2637 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 2634 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
2638 if (renderer) { 2635 if (renderer) {
2639 LayoutRect box; 2636 LayoutRect box;
2640 if (renderer->isBox()) 2637 if (renderer->isBox())
2641 box = toRenderBox(renderer)->borderBoxRect(); 2638 box = toRenderBox(renderer)->borderBoxRect();
2642 2639
2643 RenderView* renderView = m_node->document().renderView(); 2640 RenderView* renderView = m_node->document().renderView();
2644 list->append(zoomAdjustedPixelValue(minimumValueForLength(style- >transformOriginX(), box.width(), renderView), style.get())); 2641 list->append(zoomAdjustedPixelValue(minimumValueForLength(style- >transformOriginX(), box.width(), renderView), *style));
2645 list->append(zoomAdjustedPixelValue(minimumValueForLength(style- >transformOriginY(), box.height(), renderView), style.get())); 2642 list->append(zoomAdjustedPixelValue(minimumValueForLength(style- >transformOriginY(), box.height(), renderView), *style));
2646 if (style->transformOriginZ() != 0) 2643 if (style->transformOriginZ() != 0)
2647 list->append(zoomAdjustedPixelValue(style->transformOriginZ( ), style.get())); 2644 list->append(zoomAdjustedPixelValue(style->transformOriginZ( ), *style));
2648 } else { 2645 } else {
2649 list->append(zoomAdjustedPixelValueForLength(style->transformOri ginX(), style.get())); 2646 list->append(zoomAdjustedPixelValueForLength(style->transformOri ginX(), *style));
2650 list->append(zoomAdjustedPixelValueForLength(style->transformOri ginY(), style.get())); 2647 list->append(zoomAdjustedPixelValueForLength(style->transformOri ginY(), *style));
2651 if (style->transformOriginZ() != 0) 2648 if (style->transformOriginZ() != 0)
2652 list->append(zoomAdjustedPixelValue(style->transformOriginZ( ), style.get())); 2649 list->append(zoomAdjustedPixelValue(style->transformOriginZ( ), *style));
2653 } 2650 }
2654 return list.release(); 2651 return list.release();
2655 } 2652 }
2656 case CSSPropertyWebkitTransformStyle: 2653 case CSSPropertyWebkitTransformStyle:
2657 return cssValuePool().createIdentifierValue((style->transformStyle3D () == TransformStyle3DPreserve3D) ? CSSValuePreserve3d : CSSValueFlat); 2654 return cssValuePool().createIdentifierValue((style->transformStyle3D () == TransformStyle3DPreserve3D) ? CSSValuePreserve3d : CSSValueFlat);
2658 case CSSPropertyTransitionDelay: 2655 case CSSPropertyTransitionDelay:
2659 case CSSPropertyWebkitTransitionDelay: 2656 case CSSPropertyWebkitTransitionDelay:
2660 return valueForAnimationDelay(style->transitions()); 2657 return valueForAnimationDelay(style->transitions());
2661 case CSSPropertyTransitionDuration: 2658 case CSSPropertyTransitionDuration:
2662 case CSSPropertyWebkitTransitionDuration: 2659 case CSSPropertyWebkitTransitionDuration:
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
2704 return CSSPrimitiveValue::create(style->lineAlign()); 2701 return CSSPrimitiveValue::create(style->lineAlign());
2705 case CSSPropertyWebkitWritingMode: 2702 case CSSPropertyWebkitWritingMode:
2706 return cssValuePool().createValue(style->writingMode()); 2703 return cssValuePool().createValue(style->writingMode());
2707 case CSSPropertyWebkitTextCombine: 2704 case CSSPropertyWebkitTextCombine:
2708 return cssValuePool().createValue(style->textCombine()); 2705 return cssValuePool().createValue(style->textCombine());
2709 case CSSPropertyWebkitTextOrientation: 2706 case CSSPropertyWebkitTextOrientation:
2710 return CSSPrimitiveValue::create(style->textOrientation()); 2707 return CSSPrimitiveValue::create(style->textOrientation());
2711 case CSSPropertyWebkitLineBoxContain: 2708 case CSSPropertyWebkitLineBoxContain:
2712 return createLineBoxContainValue(style->lineBoxContain()); 2709 return createLineBoxContainValue(style->lineBoxContain());
2713 case CSSPropertyContent: 2710 case CSSPropertyContent:
2714 return valueForContentData(style.get()); 2711 return valueForContentData(*style);
2715 case CSSPropertyCounterIncrement: 2712 case CSSPropertyCounterIncrement:
2716 return valueForCounterDirectives(style.get(), propertyID); 2713 return valueForCounterDirectives(*style, propertyID);
2717 case CSSPropertyCounterReset: 2714 case CSSPropertyCounterReset:
2718 return valueForCounterDirectives(style.get(), propertyID); 2715 return valueForCounterDirectives(*style, propertyID);
2719 case CSSPropertyWebkitClipPath: 2716 case CSSPropertyWebkitClipPath:
2720 if (ClipPathOperation* operation = style->clipPath()) { 2717 if (ClipPathOperation* operation = style->clipPath()) {
2721 if (operation->getOperationType() == ClipPathOperation::SHAPE) 2718 if (operation->getOperationType() == ClipPathOperation::SHAPE)
2722 return valueForBasicShape(style.get(), static_cast<ShapeClip PathOperation*>(operation)->basicShape()); 2719 return valueForBasicShape(*style, static_cast<ShapeClipPathO peration*>(operation)->basicShape());
2723 if (operation->getOperationType() == ClipPathOperation::REFERENC E) { 2720 if (operation->getOperationType() == ClipPathOperation::REFERENC E) {
2724 ReferenceClipPathOperation* referenceOperation = static_cast <ReferenceClipPathOperation*>(operation); 2721 ReferenceClipPathOperation* referenceOperation = static_cast <ReferenceClipPathOperation*>(operation);
2725 return CSSPrimitiveValue::create(referenceOperation->url(), CSSPrimitiveValue::CSS_URI); 2722 return CSSPrimitiveValue::create(referenceOperation->url(), CSSPrimitiveValue::CSS_URI);
2726 } 2723 }
2727 } 2724 }
2728 return cssValuePool().createIdentifierValue(CSSValueNone); 2725 return cssValuePool().createIdentifierValue(CSSValueNone);
2729 case CSSPropertyWebkitFlowInto: 2726 case CSSPropertyWebkitFlowInto:
2730 if (style->flowThread().isNull()) 2727 if (style->flowThread().isNull())
2731 return cssValuePool().createIdentifierValue(CSSValueNone); 2728 return cssValuePool().createIdentifierValue(CSSValueNone);
2732 return cssValuePool().createValue(style->flowThread(), CSSPrimitiveV alue::CSS_STRING); 2729 return cssValuePool().createValue(style->flowThread(), CSSPrimitiveV alue::CSS_STRING);
(...skipping 15 matching lines...) Expand all
2748 if (!style->shapeInside()) 2745 if (!style->shapeInside())
2749 return cssValuePool().createIdentifierValue(CSSValueAuto); 2746 return cssValuePool().createIdentifierValue(CSSValueAuto);
2750 if (style->shapeInside()->type() == ShapeValue::Outside) 2747 if (style->shapeInside()->type() == ShapeValue::Outside)
2751 return cssValuePool().createIdentifierValue(CSSValueOutsideShape ); 2748 return cssValuePool().createIdentifierValue(CSSValueOutsideShape );
2752 if (style->shapeInside()->type() == ShapeValue::Image) { 2749 if (style->shapeInside()->type() == ShapeValue::Image) {
2753 if (style->shapeInside()->image()) 2750 if (style->shapeInside()->image())
2754 return style->shapeInside()->image()->cssValue(); 2751 return style->shapeInside()->image()->cssValue();
2755 return cssValuePool().createIdentifierValue(CSSValueNone); 2752 return cssValuePool().createIdentifierValue(CSSValueNone);
2756 } 2753 }
2757 ASSERT(style->shapeInside()->type() == ShapeValue::Shape); 2754 ASSERT(style->shapeInside()->type() == ShapeValue::Shape);
2758 return valueForBasicShape(style.get(), style->shapeInside()->shape() ); 2755 return valueForBasicShape(*style, style->shapeInside()->shape());
2759 case CSSPropertyShapeOutside: 2756 case CSSPropertyShapeOutside:
2760 if (!style->shapeOutside()) 2757 if (!style->shapeOutside())
2761 return cssValuePool().createIdentifierValue(CSSValueAuto); 2758 return cssValuePool().createIdentifierValue(CSSValueAuto);
2762 if (style->shapeOutside()->type() == ShapeValue::Image) { 2759 if (style->shapeOutside()->type() == ShapeValue::Image) {
2763 if (style->shapeOutside()->image()) 2760 if (style->shapeOutside()->image())
2764 return style->shapeOutside()->image()->cssValue(); 2761 return style->shapeOutside()->image()->cssValue();
2765 return cssValuePool().createIdentifierValue(CSSValueNone); 2762 return cssValuePool().createIdentifierValue(CSSValueNone);
2766 } 2763 }
2767 ASSERT(style->shapeOutside()->type() == ShapeValue::Shape); 2764 ASSERT(style->shapeOutside()->type() == ShapeValue::Shape);
2768 return valueForBasicShape(style.get(), style->shapeOutside()->shape( )); 2765 return valueForBasicShape(*style, style->shapeOutside()->shape());
2769 case CSSPropertyWebkitWrapThrough: 2766 case CSSPropertyWebkitWrapThrough:
2770 return cssValuePool().createValue(style->wrapThrough()); 2767 return cssValuePool().createValue(style->wrapThrough());
2771 case CSSPropertyWebkitFilter: 2768 case CSSPropertyWebkitFilter:
2772 return valueForFilter(renderer, style.get()); 2769 return valueForFilter(renderer, *style);
2773 case CSSPropertyMixBlendMode: 2770 case CSSPropertyMixBlendMode:
2774 return cssValuePool().createValue(style->blendMode()); 2771 return cssValuePool().createValue(style->blendMode());
2775 2772
2776 case CSSPropertyBackgroundBlendMode: { 2773 case CSSPropertyBackgroundBlendMode: {
2777 const FillLayer* layers = style->backgroundLayers(); 2774 const FillLayer* layers = style->backgroundLayers();
2778 if (!layers->next()) 2775 if (!layers->next())
2779 return cssValuePool().createValue(layers->blendMode()); 2776 return cssValuePool().createValue(layers->blendMode());
2780 2777
2781 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 2778 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
2782 for (const FillLayer* currLayer = layers; currLayer; currLayer = cur rLayer->next()) 2779 for (const FillLayer* currLayer = layers; currLayer; currLayer = cur rLayer->next())
(...skipping 13 matching lines...) Expand all
2796 } 2793 }
2797 return value.release(); 2794 return value.release();
2798 } 2795 }
2799 case CSSPropertyBorderBottom: 2796 case CSSPropertyBorderBottom:
2800 return valuesForShorthandProperty(borderBottomShorthand()); 2797 return valuesForShorthandProperty(borderBottomShorthand());
2801 case CSSPropertyBorderColor: 2798 case CSSPropertyBorderColor:
2802 return valuesForSidesShorthand(borderColorShorthand()); 2799 return valuesForSidesShorthand(borderColorShorthand());
2803 case CSSPropertyBorderLeft: 2800 case CSSPropertyBorderLeft:
2804 return valuesForShorthandProperty(borderLeftShorthand()); 2801 return valuesForShorthandProperty(borderLeftShorthand());
2805 case CSSPropertyBorderImage: 2802 case CSSPropertyBorderImage:
2806 return valueForNinePieceImage(style->borderImage(), style.get()); 2803 return valueForNinePieceImage(style->borderImage(), *style);
2807 case CSSPropertyBorderRadius: 2804 case CSSPropertyBorderRadius:
2808 return valueForBorderRadiusShorthand(style.get()); 2805 return valueForBorderRadiusShorthand(*style);
2809 case CSSPropertyBorderRight: 2806 case CSSPropertyBorderRight:
2810 return valuesForShorthandProperty(borderRightShorthand()); 2807 return valuesForShorthandProperty(borderRightShorthand());
2811 case CSSPropertyBorderStyle: 2808 case CSSPropertyBorderStyle:
2812 return valuesForSidesShorthand(borderStyleShorthand()); 2809 return valuesForSidesShorthand(borderStyleShorthand());
2813 case CSSPropertyBorderTop: 2810 case CSSPropertyBorderTop:
2814 return valuesForShorthandProperty(borderTopShorthand()); 2811 return valuesForShorthandProperty(borderTopShorthand());
2815 case CSSPropertyBorderWidth: 2812 case CSSPropertyBorderWidth:
2816 return valuesForSidesShorthand(borderWidthShorthand()); 2813 return valuesForSidesShorthand(borderWidthShorthand());
2817 case CSSPropertyWebkitColumnRule: 2814 case CSSPropertyWebkitColumnRule:
2818 return valuesForShorthandProperty(webkitColumnRuleShorthand()); 2815 return valuesForShorthandProperty(webkitColumnRuleShorthand());
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
3240 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3237 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3241 CSSPropertyB ackgroundClip }; 3238 CSSPropertyB ackgroundClip };
3242 3239
3243 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 3240 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
3244 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3241 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3245 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3242 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3246 return list.release(); 3243 return list.release();
3247 } 3244 }
3248 3245
3249 } // namespace WebCore 3246 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.h ('k') | Source/core/css/CSSValuePool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698