OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> | 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 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 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Lesser General Public License for more details. | 15 * Lesser General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Lesser General Public | 17 * You should have received a copy of the GNU Lesser General Public |
18 * License along with this library; if not, write to the Free Software | 18 * License along with this library; if not, write to the Free Software |
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
20 * 02110-1301 USA | 20 * 02110-1301 USA |
21 */ | 21 */ |
22 | 22 |
23 #include "config.h" | 23 #include "config.h" |
24 #include "CSSComputedStyleDeclaration.h" | 24 #include "CSSComputedStyleDeclaration.h" |
25 | 25 |
26 #include "AnimationController.h" | |
27 #include "CSSBorderImageValue.h" | 26 #include "CSSBorderImageValue.h" |
28 #include "CSSMutableStyleDeclaration.h" | 27 #include "CSSMutableStyleDeclaration.h" |
29 #include "CSSPrimitiveValue.h" | 28 #include "CSSPrimitiveValue.h" |
30 #include "CSSPrimitiveValueMappings.h" | 29 #include "CSSPrimitiveValueMappings.h" |
31 #include "CSSPropertyNames.h" | 30 #include "CSSPropertyNames.h" |
32 #include "CSSReflectValue.h" | 31 #include "CSSReflectValue.h" |
33 #include "CSSTimingFunctionValue.h" | 32 #include "CSSTimingFunctionValue.h" |
34 #include "CSSValueList.h" | 33 #include "CSSValueList.h" |
35 #include "CachedImage.h" | 34 #include "CachedImage.h" |
36 #include "Document.h" | 35 #include "Document.h" |
37 #include "ExceptionCode.h" | 36 #include "ExceptionCode.h" |
38 #include "Pair.h" | 37 #include "Pair.h" |
39 #include "Rect.h" | 38 #include "Rect.h" |
40 #include "RenderBox.h" | 39 #include "RenderBox.h" |
41 #include "RenderLayer.h" | |
42 #include "ShadowValue.h" | 40 #include "ShadowValue.h" |
43 #include "WebKitCSSTransformValue.h" | 41 #include "WebKitCSSTransformValue.h" |
44 | 42 |
45 | |
46 #if ENABLE(DASHBOARD_SUPPORT) | 43 #if ENABLE(DASHBOARD_SUPPORT) |
47 #include "DashboardRegion.h" | 44 #include "DashboardRegion.h" |
48 #endif | 45 #endif |
49 | 46 |
50 namespace WebCore { | 47 namespace WebCore { |
51 | 48 |
52 // List of all properties we know how to compute, omitting shorthands. | 49 // List of all properties we know how to compute, omitting shorthands. |
53 static const int computedProperties[] = { | 50 static const int computedProperties[] = { |
54 CSSPropertyBackgroundAttachment, | 51 CSSPropertyBackgroundAttachment, |
55 CSSPropertyBackgroundColor, | 52 CSSPropertyBackgroundColor, |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 | 394 |
398 static IntRect sizingBox(RenderObject* renderer) | 395 static IntRect sizingBox(RenderObject* renderer) |
399 { | 396 { |
400 if (!renderer->isBox()) | 397 if (!renderer->isBox()) |
401 return IntRect(); | 398 return IntRect(); |
402 | 399 |
403 RenderBox* box = toRenderBox(renderer); | 400 RenderBox* box = toRenderBox(renderer); |
404 return box->style()->boxSizing() == CONTENT_BOX ? box->contentBoxRect() : bo
x->borderBoxRect(); | 401 return box->style()->boxSizing() == CONTENT_BOX ? box->contentBoxRect() : bo
x->borderBoxRect(); |
405 } | 402 } |
406 | 403 |
407 static inline bool hasCompositedLayer(RenderObject* renderer) | 404 static PassRefPtr<CSSValue> computedTransform(RenderObject* renderer) |
408 { | 405 { |
409 return renderer && renderer->hasLayer() && toRenderBoxModelObject(renderer)-
>layer()->isComposited(); | 406 if (!renderer || renderer->style()->transform().operations().isEmpty()) |
410 } | |
411 | |
412 static PassRefPtr<CSSValue> computedTransform(RenderObject* renderer, const Rend
erStyle* style) | |
413 { | |
414 if (!renderer || style->transform().operations().isEmpty()) | |
415 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 407 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
416 | 408 |
417 IntRect box = sizingBox(renderer); | 409 IntRect box = sizingBox(renderer); |
418 | 410 |
419 TransformationMatrix transform; | 411 TransformationMatrix transform; |
420 style->applyTransform(transform, box.size(), RenderStyle::ExcludeTransformOr
igin); | 412 renderer->style()->applyTransform(transform, box.size(), false); |
421 | 413 |
422 RefPtr<WebKitCSSTransformValue> transformVal = WebKitCSSTransformValue::crea
te(WebKitCSSTransformValue::MatrixTransformOperation); | 414 RefPtr<WebKitCSSTransformValue> transformVal = WebKitCSSTransformValue::crea
te(WebKitCSSTransformValue::MatrixTransformOperation); |
423 | 415 |
424 transformVal->append(CSSPrimitiveValue::create(transform.a(), CSSPrimitiveVa
lue::CSS_NUMBER)); | 416 transformVal->append(CSSPrimitiveValue::create(transform.a(), CSSPrimitiveVa
lue::CSS_NUMBER)); |
425 transformVal->append(CSSPrimitiveValue::create(transform.b(), CSSPrimitiveVa
lue::CSS_NUMBER)); | 417 transformVal->append(CSSPrimitiveValue::create(transform.b(), CSSPrimitiveVa
lue::CSS_NUMBER)); |
426 transformVal->append(CSSPrimitiveValue::create(transform.c(), CSSPrimitiveVa
lue::CSS_NUMBER)); | 418 transformVal->append(CSSPrimitiveValue::create(transform.c(), CSSPrimitiveVa
lue::CSS_NUMBER)); |
427 transformVal->append(CSSPrimitiveValue::create(transform.d(), CSSPrimitiveVa
lue::CSS_NUMBER)); | 419 transformVal->append(CSSPrimitiveValue::create(transform.d(), CSSPrimitiveVa
lue::CSS_NUMBER)); |
428 transformVal->append(CSSPrimitiveValue::create(transform.e(), CSSPrimitiveVa
lue::CSS_NUMBER)); | 420 transformVal->append(CSSPrimitiveValue::create(transform.e(), CSSPrimitiveVa
lue::CSS_NUMBER)); |
429 transformVal->append(CSSPrimitiveValue::create(transform.f(), CSSPrimitiveVa
lue::CSS_NUMBER)); | 421 transformVal->append(CSSPrimitiveValue::create(transform.f(), CSSPrimitiveVa
lue::CSS_NUMBER)); |
430 | 422 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 Node* node = m_node.get(); | 508 Node* node = m_node.get(); |
517 if (!node) | 509 if (!node) |
518 return 0; | 510 return 0; |
519 | 511 |
520 // Make sure our layout is up to date before we allow a query on these attri
butes. | 512 // Make sure our layout is up to date before we allow a query on these attri
butes. |
521 if (updateLayout) | 513 if (updateLayout) |
522 node->document()->updateLayoutIgnorePendingStylesheets(); | 514 node->document()->updateLayoutIgnorePendingStylesheets(); |
523 | 515 |
524 RenderObject* renderer = node->renderer(); | 516 RenderObject* renderer = node->renderer(); |
525 | 517 |
526 RefPtr<RenderStyle> style; | 518 RenderStyle* style = node->computedStyle(); |
527 if (renderer && hasCompositedLayer(renderer) && AnimationController::support
sAcceleratedAnimationOfProperty(static_cast<CSSPropertyID>(propertyID))) | |
528 style = renderer->animation()->getAnimatedStyleForRenderer(renderer); | |
529 else | |
530 style = node->computedStyle(); | |
531 if (!style) | 519 if (!style) |
532 return 0; | 520 return 0; |
533 | 521 |
534 switch (static_cast<CSSPropertyID>(propertyID)) { | 522 switch (static_cast<CSSPropertyID>(propertyID)) { |
535 case CSSPropertyInvalid: | 523 case CSSPropertyInvalid: |
536 break; | 524 break; |
537 | 525 |
538 case CSSPropertyBackgroundColor: | 526 case CSSPropertyBackgroundColor: |
539 return CSSPrimitiveValue::createColor(style->backgroundColor().rgb()
); | 527 return CSSPrimitiveValue::createColor(style->backgroundColor().rgb()
); |
540 case CSSPropertyBackgroundImage: | 528 case CSSPropertyBackgroundImage: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 568 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
581 list->append(CSSPrimitiveValue::create(style->horizontalBorderSpacin
g(), CSSPrimitiveValue::CSS_PX)); | 569 list->append(CSSPrimitiveValue::create(style->horizontalBorderSpacin
g(), CSSPrimitiveValue::CSS_PX)); |
582 list->append(CSSPrimitiveValue::create(style->verticalBorderSpacing(
), CSSPrimitiveValue::CSS_PX)); | 570 list->append(CSSPrimitiveValue::create(style->verticalBorderSpacing(
), CSSPrimitiveValue::CSS_PX)); |
583 return list.release(); | 571 return list.release(); |
584 } | 572 } |
585 case CSSPropertyWebkitBorderHorizontalSpacing: | 573 case CSSPropertyWebkitBorderHorizontalSpacing: |
586 return CSSPrimitiveValue::create(style->horizontalBorderSpacing(), C
SSPrimitiveValue::CSS_PX); | 574 return CSSPrimitiveValue::create(style->horizontalBorderSpacing(), C
SSPrimitiveValue::CSS_PX); |
587 case CSSPropertyWebkitBorderVerticalSpacing: | 575 case CSSPropertyWebkitBorderVerticalSpacing: |
588 return CSSPrimitiveValue::create(style->verticalBorderSpacing(), CSS
PrimitiveValue::CSS_PX); | 576 return CSSPrimitiveValue::create(style->verticalBorderSpacing(), CSS
PrimitiveValue::CSS_PX); |
589 case CSSPropertyBorderTopColor: | 577 case CSSPropertyBorderTopColor: |
590 return currentColorOrValidColor(style.get(), style->borderTopColor()
); | 578 return currentColorOrValidColor(style, style->borderTopColor()); |
591 case CSSPropertyBorderRightColor: | 579 case CSSPropertyBorderRightColor: |
592 return currentColorOrValidColor(style.get(), style->borderRightColor
()); | 580 return currentColorOrValidColor(style, style->borderRightColor()); |
593 case CSSPropertyBorderBottomColor: | 581 case CSSPropertyBorderBottomColor: |
594 return currentColorOrValidColor(style.get(), style->borderBottomColo
r()); | 582 return currentColorOrValidColor(style, style->borderBottomColor()); |
595 case CSSPropertyBorderLeftColor: | 583 case CSSPropertyBorderLeftColor: |
596 return currentColorOrValidColor(style.get(), style->borderLeftColor(
)); | 584 return currentColorOrValidColor(style, style->borderLeftColor()); |
597 case CSSPropertyBorderTopStyle: | 585 case CSSPropertyBorderTopStyle: |
598 return CSSPrimitiveValue::create(style->borderTopStyle()); | 586 return CSSPrimitiveValue::create(style->borderTopStyle()); |
599 case CSSPropertyBorderRightStyle: | 587 case CSSPropertyBorderRightStyle: |
600 return CSSPrimitiveValue::create(style->borderRightStyle()); | 588 return CSSPrimitiveValue::create(style->borderRightStyle()); |
601 case CSSPropertyBorderBottomStyle: | 589 case CSSPropertyBorderBottomStyle: |
602 return CSSPrimitiveValue::create(style->borderBottomStyle()); | 590 return CSSPrimitiveValue::create(style->borderBottomStyle()); |
603 case CSSPropertyBorderLeftStyle: | 591 case CSSPropertyBorderLeftStyle: |
604 return CSSPrimitiveValue::create(style->borderLeftStyle()); | 592 return CSSPrimitiveValue::create(style->borderLeftStyle()); |
605 case CSSPropertyBorderTopWidth: | 593 case CSSPropertyBorderTopWidth: |
606 return CSSPrimitiveValue::create(style->borderTopWidth(), CSSPrimiti
veValue::CSS_PX); | 594 return CSSPrimitiveValue::create(style->borderTopWidth(), CSSPrimiti
veValue::CSS_PX); |
607 case CSSPropertyBorderRightWidth: | 595 case CSSPropertyBorderRightWidth: |
608 return CSSPrimitiveValue::create(style->borderRightWidth(), CSSPrimi
tiveValue::CSS_PX); | 596 return CSSPrimitiveValue::create(style->borderRightWidth(), CSSPrimi
tiveValue::CSS_PX); |
609 case CSSPropertyBorderBottomWidth: | 597 case CSSPropertyBorderBottomWidth: |
610 return CSSPrimitiveValue::create(style->borderBottomWidth(), CSSPrim
itiveValue::CSS_PX); | 598 return CSSPrimitiveValue::create(style->borderBottomWidth(), CSSPrim
itiveValue::CSS_PX); |
611 case CSSPropertyBorderLeftWidth: | 599 case CSSPropertyBorderLeftWidth: |
612 return CSSPrimitiveValue::create(style->borderLeftWidth(), CSSPrimit
iveValue::CSS_PX); | 600 return CSSPrimitiveValue::create(style->borderLeftWidth(), CSSPrimit
iveValue::CSS_PX); |
613 case CSSPropertyBottom: | 601 case CSSPropertyBottom: |
614 return getPositionOffsetValue(style.get(), CSSPropertyBottom); | 602 return getPositionOffsetValue(style, CSSPropertyBottom); |
615 case CSSPropertyWebkitBoxAlign: | 603 case CSSPropertyWebkitBoxAlign: |
616 return CSSPrimitiveValue::create(style->boxAlign()); | 604 return CSSPrimitiveValue::create(style->boxAlign()); |
617 case CSSPropertyWebkitBoxDirection: | 605 case CSSPropertyWebkitBoxDirection: |
618 return CSSPrimitiveValue::create(style->boxDirection()); | 606 return CSSPrimitiveValue::create(style->boxDirection()); |
619 case CSSPropertyWebkitBoxFlex: | 607 case CSSPropertyWebkitBoxFlex: |
620 return CSSPrimitiveValue::create(style->boxFlex(), CSSPrimitiveValue
::CSS_NUMBER); | 608 return CSSPrimitiveValue::create(style->boxFlex(), CSSPrimitiveValue
::CSS_NUMBER); |
621 case CSSPropertyWebkitBoxFlexGroup: | 609 case CSSPropertyWebkitBoxFlexGroup: |
622 return CSSPrimitiveValue::create(style->boxFlexGroup(), CSSPrimitive
Value::CSS_NUMBER); | 610 return CSSPrimitiveValue::create(style->boxFlexGroup(), CSSPrimitive
Value::CSS_NUMBER); |
623 case CSSPropertyWebkitBoxLines: | 611 case CSSPropertyWebkitBoxLines: |
624 return CSSPrimitiveValue::create(style->boxLines()); | 612 return CSSPrimitiveValue::create(style->boxLines()); |
(...skipping 21 matching lines...) Expand all Loading... |
646 return CSSPrimitiveValue::createColor(style->color().rgb()); | 634 return CSSPrimitiveValue::createColor(style->color().rgb()); |
647 case CSSPropertyWebkitColumnCount: | 635 case CSSPropertyWebkitColumnCount: |
648 if (style->hasAutoColumnCount()) | 636 if (style->hasAutoColumnCount()) |
649 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 637 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
650 return CSSPrimitiveValue::create(style->columnCount(), CSSPrimitiveV
alue::CSS_NUMBER); | 638 return CSSPrimitiveValue::create(style->columnCount(), CSSPrimitiveV
alue::CSS_NUMBER); |
651 case CSSPropertyWebkitColumnGap: | 639 case CSSPropertyWebkitColumnGap: |
652 if (style->hasNormalColumnGap()) | 640 if (style->hasNormalColumnGap()) |
653 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 641 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); |
654 return CSSPrimitiveValue::create(style->columnGap(), CSSPrimitiveVal
ue::CSS_NUMBER); | 642 return CSSPrimitiveValue::create(style->columnGap(), CSSPrimitiveVal
ue::CSS_NUMBER); |
655 case CSSPropertyWebkitColumnRuleColor: | 643 case CSSPropertyWebkitColumnRuleColor: |
656 return currentColorOrValidColor(style.get(), style->columnRuleColor(
)); | 644 return currentColorOrValidColor(style, style->columnRuleColor()); |
657 case CSSPropertyWebkitColumnRuleStyle: | 645 case CSSPropertyWebkitColumnRuleStyle: |
658 return CSSPrimitiveValue::create(style->columnRuleStyle()); | 646 return CSSPrimitiveValue::create(style->columnRuleStyle()); |
659 case CSSPropertyWebkitColumnRuleWidth: | 647 case CSSPropertyWebkitColumnRuleWidth: |
660 return CSSPrimitiveValue::create(style->columnRuleWidth(), CSSPrimit
iveValue::CSS_PX); | 648 return CSSPrimitiveValue::create(style->columnRuleWidth(), CSSPrimit
iveValue::CSS_PX); |
661 case CSSPropertyWebkitColumnBreakAfter: | 649 case CSSPropertyWebkitColumnBreakAfter: |
662 return CSSPrimitiveValue::create(style->columnBreakAfter()); | 650 return CSSPrimitiveValue::create(style->columnBreakAfter()); |
663 case CSSPropertyWebkitColumnBreakBefore: | 651 case CSSPropertyWebkitColumnBreakBefore: |
664 return CSSPrimitiveValue::create(style->columnBreakBefore()); | 652 return CSSPrimitiveValue::create(style->columnBreakBefore()); |
665 case CSSPropertyWebkitColumnBreakInside: | 653 case CSSPropertyWebkitColumnBreakInside: |
666 return CSSPrimitiveValue::create(style->columnBreakInside()); | 654 return CSSPrimitiveValue::create(style->columnBreakInside()); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 return CSSPrimitiveValue::create(style->height()); | 723 return CSSPrimitiveValue::create(style->height()); |
736 case CSSPropertyWebkitHighlight: | 724 case CSSPropertyWebkitHighlight: |
737 if (style->highlight() == nullAtom) | 725 if (style->highlight() == nullAtom) |
738 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 726 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
739 return CSSPrimitiveValue::create(style->highlight(), CSSPrimitiveVal
ue::CSS_STRING); | 727 return CSSPrimitiveValue::create(style->highlight(), CSSPrimitiveVal
ue::CSS_STRING); |
740 case CSSPropertyWebkitBorderFit: | 728 case CSSPropertyWebkitBorderFit: |
741 if (style->borderFit() == BorderFitBorder) | 729 if (style->borderFit() == BorderFitBorder) |
742 return CSSPrimitiveValue::createIdentifier(CSSValueBorder); | 730 return CSSPrimitiveValue::createIdentifier(CSSValueBorder); |
743 return CSSPrimitiveValue::createIdentifier(CSSValueLines); | 731 return CSSPrimitiveValue::createIdentifier(CSSValueLines); |
744 case CSSPropertyLeft: | 732 case CSSPropertyLeft: |
745 return getPositionOffsetValue(style.get(), CSSPropertyLeft); | 733 return getPositionOffsetValue(style, CSSPropertyLeft); |
746 case CSSPropertyLetterSpacing: | 734 case CSSPropertyLetterSpacing: |
747 if (!style->letterSpacing()) | 735 if (!style->letterSpacing()) |
748 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 736 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); |
749 return CSSPrimitiveValue::create(style->letterSpacing(), CSSPrimitiv
eValue::CSS_PX); | 737 return CSSPrimitiveValue::create(style->letterSpacing(), CSSPrimitiv
eValue::CSS_PX); |
750 case CSSPropertyWebkitLineClamp: | 738 case CSSPropertyWebkitLineClamp: |
751 if (style->lineClamp() == -1) | 739 if (style->lineClamp() == -1) |
752 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 740 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
753 return CSSPrimitiveValue::create(style->lineClamp(), CSSPrimitiveVal
ue::CSS_PERCENTAGE); | 741 return CSSPrimitiveValue::create(style->lineClamp(), CSSPrimitiveVal
ue::CSS_PERCENTAGE); |
754 case CSSPropertyLineHeight: { | 742 case CSSPropertyLineHeight: { |
755 Length length = style->lineHeight(); | 743 Length length = style->lineHeight(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 } | 840 } |
853 case CSSPropertyMinHeight: | 841 case CSSPropertyMinHeight: |
854 return CSSPrimitiveValue::create(style->minHeight()); | 842 return CSSPrimitiveValue::create(style->minHeight()); |
855 case CSSPropertyMinWidth: | 843 case CSSPropertyMinWidth: |
856 return CSSPrimitiveValue::create(style->minWidth()); | 844 return CSSPrimitiveValue::create(style->minWidth()); |
857 case CSSPropertyOpacity: | 845 case CSSPropertyOpacity: |
858 return CSSPrimitiveValue::create(style->opacity(), CSSPrimitiveValue
::CSS_NUMBER); | 846 return CSSPrimitiveValue::create(style->opacity(), CSSPrimitiveValue
::CSS_NUMBER); |
859 case CSSPropertyOrphans: | 847 case CSSPropertyOrphans: |
860 return CSSPrimitiveValue::create(style->orphans(), CSSPrimitiveValue
::CSS_NUMBER); | 848 return CSSPrimitiveValue::create(style->orphans(), CSSPrimitiveValue
::CSS_NUMBER); |
861 case CSSPropertyOutlineColor: | 849 case CSSPropertyOutlineColor: |
862 return currentColorOrValidColor(style.get(), style->outlineColor()); | 850 return currentColorOrValidColor(style, style->outlineColor()); |
863 case CSSPropertyOutlineStyle: | 851 case CSSPropertyOutlineStyle: |
864 if (style->outlineStyleIsAuto()) | 852 if (style->outlineStyleIsAuto()) |
865 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 853 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
866 return CSSPrimitiveValue::create(style->outlineStyle()); | 854 return CSSPrimitiveValue::create(style->outlineStyle()); |
867 case CSSPropertyOutlineWidth: | 855 case CSSPropertyOutlineWidth: |
868 return CSSPrimitiveValue::create(style->outlineWidth(), CSSPrimitive
Value::CSS_PX); | 856 return CSSPrimitiveValue::create(style->outlineWidth(), CSSPrimitive
Value::CSS_PX); |
869 case CSSPropertyOverflow: | 857 case CSSPropertyOverflow: |
870 return CSSPrimitiveValue::create(max(style->overflowX(), style->over
flowY())); | 858 return CSSPrimitiveValue::create(max(style->overflowX(), style->over
flowY())); |
871 case CSSPropertyOverflowX: | 859 case CSSPropertyOverflowX: |
872 return CSSPrimitiveValue::create(style->overflowX()); | 860 return CSSPrimitiveValue::create(style->overflowX()); |
(...skipping 22 matching lines...) Expand all Loading... |
895 case CSSPropertyPageBreakInside: { | 883 case CSSPropertyPageBreakInside: { |
896 EPageBreak pageBreak = style->pageBreakInside(); | 884 EPageBreak pageBreak = style->pageBreakInside(); |
897 ASSERT(pageBreak != PBALWAYS); | 885 ASSERT(pageBreak != PBALWAYS); |
898 if (pageBreak == PBALWAYS) | 886 if (pageBreak == PBALWAYS) |
899 return 0; | 887 return 0; |
900 return CSSPrimitiveValue::create(style->pageBreakInside()); | 888 return CSSPrimitiveValue::create(style->pageBreakInside()); |
901 } | 889 } |
902 case CSSPropertyPosition: | 890 case CSSPropertyPosition: |
903 return CSSPrimitiveValue::create(style->position()); | 891 return CSSPrimitiveValue::create(style->position()); |
904 case CSSPropertyRight: | 892 case CSSPropertyRight: |
905 return getPositionOffsetValue(style.get(), CSSPropertyRight); | 893 return getPositionOffsetValue(style, CSSPropertyRight); |
906 case CSSPropertyTableLayout: | 894 case CSSPropertyTableLayout: |
907 return CSSPrimitiveValue::create(style->tableLayout()); | 895 return CSSPrimitiveValue::create(style->tableLayout()); |
908 case CSSPropertyTextAlign: | 896 case CSSPropertyTextAlign: |
909 return CSSPrimitiveValue::create(style->textAlign()); | 897 return CSSPrimitiveValue::create(style->textAlign()); |
910 case CSSPropertyTextDecoration: { | 898 case CSSPropertyTextDecoration: { |
911 String string; | 899 String string; |
912 if (style->textDecoration() & UNDERLINE) | 900 if (style->textDecoration() & UNDERLINE) |
913 string += "underline"; | 901 string += "underline"; |
914 if (style->textDecoration() & OVERLINE) { | 902 if (style->textDecoration() & OVERLINE) { |
915 if (string.length()) | 903 if (string.length()) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 if (style->textDecorationsInEffect() & BLINK) { | 935 if (style->textDecorationsInEffect() & BLINK) { |
948 if (string.length()) | 936 if (string.length()) |
949 string += " "; | 937 string += " "; |
950 string += "blink"; | 938 string += "blink"; |
951 } | 939 } |
952 if (!string.length()) | 940 if (!string.length()) |
953 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 941 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
954 return CSSPrimitiveValue::create(string, CSSPrimitiveValue::CSS_STRI
NG); | 942 return CSSPrimitiveValue::create(string, CSSPrimitiveValue::CSS_STRI
NG); |
955 } | 943 } |
956 case CSSPropertyWebkitTextFillColor: | 944 case CSSPropertyWebkitTextFillColor: |
957 return currentColorOrValidColor(style.get(), style->textFillColor())
; | 945 return currentColorOrValidColor(style, style->textFillColor()); |
958 case CSSPropertyTextIndent: | 946 case CSSPropertyTextIndent: |
959 return CSSPrimitiveValue::create(style->textIndent()); | 947 return CSSPrimitiveValue::create(style->textIndent()); |
960 case CSSPropertyTextShadow: | 948 case CSSPropertyTextShadow: |
961 return valueForShadow(style->textShadow()); | 949 return valueForShadow(style->textShadow()); |
962 case CSSPropertyWebkitTextSecurity: | 950 case CSSPropertyWebkitTextSecurity: |
963 return CSSPrimitiveValue::create(style->textSecurity()); | 951 return CSSPrimitiveValue::create(style->textSecurity()); |
964 case CSSPropertyWebkitTextSizeAdjust: | 952 case CSSPropertyWebkitTextSizeAdjust: |
965 if (style->textSizeAdjust()) | 953 if (style->textSizeAdjust()) |
966 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 954 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
967 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 955 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
968 case CSSPropertyWebkitTextStrokeColor: | 956 case CSSPropertyWebkitTextStrokeColor: |
969 return currentColorOrValidColor(style.get(), style->textStrokeColor(
)); | 957 return currentColorOrValidColor(style, style->textStrokeColor()); |
970 case CSSPropertyWebkitTextStrokeWidth: | 958 case CSSPropertyWebkitTextStrokeWidth: |
971 return CSSPrimitiveValue::create(style->textStrokeWidth(), CSSPrimit
iveValue::CSS_PX); | 959 return CSSPrimitiveValue::create(style->textStrokeWidth(), CSSPrimit
iveValue::CSS_PX); |
972 case CSSPropertyTextTransform: | 960 case CSSPropertyTextTransform: |
973 return CSSPrimitiveValue::create(style->textTransform()); | 961 return CSSPrimitiveValue::create(style->textTransform()); |
974 case CSSPropertyTop: | 962 case CSSPropertyTop: |
975 return getPositionOffsetValue(style.get(), CSSPropertyTop); | 963 return getPositionOffsetValue(style, CSSPropertyTop); |
976 case CSSPropertyUnicodeBidi: | 964 case CSSPropertyUnicodeBidi: |
977 return CSSPrimitiveValue::create(style->unicodeBidi()); | 965 return CSSPrimitiveValue::create(style->unicodeBidi()); |
978 case CSSPropertyVerticalAlign: | 966 case CSSPropertyVerticalAlign: |
979 switch (style->verticalAlign()) { | 967 switch (style->verticalAlign()) { |
980 case BASELINE: | 968 case BASELINE: |
981 return CSSPrimitiveValue::createIdentifier(CSSValueBaseline)
; | 969 return CSSPrimitiveValue::createIdentifier(CSSValueBaseline)
; |
982 case MIDDLE: | 970 case MIDDLE: |
983 return CSSPrimitiveValue::createIdentifier(CSSValueMiddle); | 971 return CSSPrimitiveValue::createIdentifier(CSSValueMiddle); |
984 case SUB: | 972 case SUB: |
985 return CSSPrimitiveValue::createIdentifier(CSSValueSub); | 973 return CSSPrimitiveValue::createIdentifier(CSSValueSub); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 RefPtr<Rect> rect = Rect::create(); | 1135 RefPtr<Rect> rect = Rect::create(); |
1148 rect->setTop(CSSPrimitiveValue::create(style->clip().top().value
(), CSSPrimitiveValue::CSS_PX)); | 1136 rect->setTop(CSSPrimitiveValue::create(style->clip().top().value
(), CSSPrimitiveValue::CSS_PX)); |
1149 rect->setRight(CSSPrimitiveValue::create(style->clip().right().v
alue(), CSSPrimitiveValue::CSS_PX)); | 1137 rect->setRight(CSSPrimitiveValue::create(style->clip().right().v
alue(), CSSPrimitiveValue::CSS_PX)); |
1150 rect->setBottom(CSSPrimitiveValue::create(style->clip().bottom()
.value(), CSSPrimitiveValue::CSS_PX)); | 1138 rect->setBottom(CSSPrimitiveValue::create(style->clip().bottom()
.value(), CSSPrimitiveValue::CSS_PX)); |
1151 rect->setLeft(CSSPrimitiveValue::create(style->clip().left().val
ue(), CSSPrimitiveValue::CSS_PX)); | 1139 rect->setLeft(CSSPrimitiveValue::create(style->clip().left().val
ue(), CSSPrimitiveValue::CSS_PX)); |
1152 return CSSPrimitiveValue::create(rect.release()); | 1140 return CSSPrimitiveValue::create(rect.release()); |
1153 } | 1141 } |
1154 return 0; | 1142 return 0; |
1155 } | 1143 } |
1156 case CSSPropertyWebkitTransform: | 1144 case CSSPropertyWebkitTransform: |
1157 return computedTransform(renderer, style.get()); | 1145 return computedTransform(renderer); |
1158 case CSSPropertyWebkitTransformOrigin: { | 1146 case CSSPropertyWebkitTransformOrigin: { |
1159 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 1147 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
1160 if (renderer) { | 1148 if (renderer) { |
1161 IntRect box = sizingBox(renderer); | 1149 IntRect box = sizingBox(renderer); |
1162 list->append(CSSPrimitiveValue::create(style->transformOriginX()
.calcMinValue(box.width()), CSSPrimitiveValue::CSS_PX)); | 1150 list->append(CSSPrimitiveValue::create(style->transformOriginX()
.calcMinValue(box.width()), CSSPrimitiveValue::CSS_PX)); |
1163 list->append(CSSPrimitiveValue::create(style->transformOriginY()
.calcMinValue(box.height()), CSSPrimitiveValue::CSS_PX)); | 1151 list->append(CSSPrimitiveValue::create(style->transformOriginY()
.calcMinValue(box.height()), CSSPrimitiveValue::CSS_PX)); |
1164 } else { | 1152 } else { |
1165 list->append(CSSPrimitiveValue::create(style->transformOriginX()
)); | 1153 list->append(CSSPrimitiveValue::create(style->transformOriginX()
)); |
1166 list->append(CSSPrimitiveValue::create(style->transformOriginY()
)); | 1154 list->append(CSSPrimitiveValue::create(style->transformOriginY()
)); |
1167 } | 1155 } |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1373 return copyPropertiesInSet(computedProperties, numComputedProperties); | 1361 return copyPropertiesInSet(computedProperties, numComputedProperties); |
1374 } | 1362 } |
1375 | 1363 |
1376 PassRefPtr<CSSMutableStyleDeclaration> CSSComputedStyleDeclaration::makeMutable(
) | 1364 PassRefPtr<CSSMutableStyleDeclaration> CSSComputedStyleDeclaration::makeMutable(
) |
1377 { | 1365 { |
1378 return copy(); | 1366 return copy(); |
1379 } | 1367 } |
1380 | 1368 |
1381 } // namespace WebCore | 1369 } // namespace WebCore |
1382 | 1370 |
OLD | NEW |