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

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

Issue 20112002: Have const StyleResolverState return const RenderStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSToStyleMap.h ('k') | Source/core/css/resolver/FontBuilder.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 23 matching lines...) Expand all
34 #include "core/css/CSSPrimitiveValueMappings.h" 34 #include "core/css/CSSPrimitiveValueMappings.h"
35 #include "core/css/CSSTimingFunctionValue.h" 35 #include "core/css/CSSTimingFunctionValue.h"
36 #include "core/css/Pair.h" 36 #include "core/css/Pair.h"
37 #include "core/css/Rect.h" 37 #include "core/css/Rect.h"
38 #include "core/css/resolver/StyleResolverState.h" 38 #include "core/css/resolver/StyleResolverState.h"
39 #include "core/platform/animation/CSSAnimationData.h" 39 #include "core/platform/animation/CSSAnimationData.h"
40 #include "core/rendering/style/FillLayer.h" 40 #include "core/rendering/style/FillLayer.h"
41 41
42 namespace WebCore { 42 namespace WebCore {
43 43
44 RenderStyle* CSSToStyleMap::style() const 44 const RenderStyle* CSSToStyleMap::style() const
45 { 45 {
46 return m_state.style(); 46 return m_state.style();
47 } 47 }
48 48
49 RenderStyle* CSSToStyleMap::rootElementStyle() const 49 const RenderStyle* CSSToStyleMap::rootElementStyle() const
50 { 50 {
51 return m_state.rootElementStyle(); 51 return m_state.rootElementStyle();
52 } 52 }
53 53
54 bool CSSToStyleMap::useSVGZoomRules() const 54 bool CSSToStyleMap::useSVGZoomRules() const
55 { 55 {
56 return m_state.useSVGZoomRules(); 56 return m_state.useSVGZoomRules();
57 } 57 }
58 58
59 PassRefPtr<StyleImage> CSSToStyleMap::styleImage(CSSPropertyID propertyId, CSSVa lue* value) 59 PassRefPtr<StyleImage> CSSToStyleMap::styleImage(CSSPropertyID propertyId, CSSVa lue* value)
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 if (value->isCubicBezierTimingFunctionValue()) { 496 if (value->isCubicBezierTimingFunctionValue()) {
497 CSSCubicBezierTimingFunctionValue* cubicTimingFunction = static_cast<CSS CubicBezierTimingFunctionValue*>(value); 497 CSSCubicBezierTimingFunctionValue* cubicTimingFunction = static_cast<CSS CubicBezierTimingFunctionValue*>(value);
498 animation->setTimingFunction(CubicBezierTimingFunction::create(cubicTimi ngFunction->x1(), cubicTimingFunction->y1(), cubicTimingFunction->x2(), cubicTim ingFunction->y2())); 498 animation->setTimingFunction(CubicBezierTimingFunction::create(cubicTimi ngFunction->x1(), cubicTimingFunction->y1(), cubicTimingFunction->x2(), cubicTim ingFunction->y2()));
499 } else if (value->isStepsTimingFunctionValue()) { 499 } else if (value->isStepsTimingFunctionValue()) {
500 CSSStepsTimingFunctionValue* stepsTimingFunction = static_cast<CSSStepsT imingFunctionValue*>(value); 500 CSSStepsTimingFunctionValue* stepsTimingFunction = static_cast<CSSStepsT imingFunctionValue*>(value);
501 animation->setTimingFunction(StepsTimingFunction::create(stepsTimingFunc tion->numberOfSteps(), stepsTimingFunction->stepAtStart())); 501 animation->setTimingFunction(StepsTimingFunction::create(stepsTimingFunc tion->numberOfSteps(), stepsTimingFunction->stepAtStart()));
502 } else if (value->isLinearTimingFunctionValue()) 502 } else if (value->isLinearTimingFunctionValue())
503 animation->setTimingFunction(LinearTimingFunction::create()); 503 animation->setTimingFunction(LinearTimingFunction::create());
504 } 504 }
505 505
506 void CSSToStyleMap::mapNinePieceImage(CSSPropertyID property, CSSValue* value, N inePieceImage& image) 506 void CSSToStyleMap::mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID p roperty, CSSValue* value, NinePieceImage& image)
507 { 507 {
508 // If we're not a value list, then we are "none" and don't need to alter the empty image at all. 508 // If we're not a value list, then we are "none" and don't need to alter the empty image at all.
509 if (!value || !value->isValueList()) 509 if (!value || !value->isValueList())
510 return; 510 return;
511 511
512 // Retrieve the border image value. 512 // Retrieve the border image value.
513 CSSValueList* borderImage = toCSSValueList(value); 513 CSSValueList* borderImage = toCSSValueList(value);
514 514
515 // Set the image (this kicks off the load). 515 // Set the image (this kicks off the load).
516 CSSPropertyID imageProperty; 516 CSSPropertyID imageProperty;
(...skipping 28 matching lines...) Expand all
545 // Set the appropriate rules for stretch/round/repeat of the slices. 545 // Set the appropriate rules for stretch/round/repeat of the slices.
546 mapNinePieceImageRepeat(current, image); 546 mapNinePieceImageRepeat(current, image);
547 } 547 }
548 } 548 }
549 549
550 if (property == CSSPropertyWebkitBorderImage) { 550 if (property == CSSPropertyWebkitBorderImage) {
551 // We have to preserve the legacy behavior of -webkit-border-image and m ake the border slices 551 // We have to preserve the legacy behavior of -webkit-border-image and m ake the border slices
552 // also set the border widths. We don't need to worry about percentages, since we don't even support 552 // also set the border widths. We don't need to worry about percentages, since we don't even support
553 // those on real borders yet. 553 // those on real borders yet.
554 if (image.borderSlices().top().isFixed()) 554 if (image.borderSlices().top().isFixed())
555 style()->setBorderTopWidth(image.borderSlices().top().value()); 555 mutableStyle->setBorderTopWidth(image.borderSlices().top().value());
556 if (image.borderSlices().right().isFixed()) 556 if (image.borderSlices().right().isFixed())
557 style()->setBorderRightWidth(image.borderSlices().right().value()); 557 mutableStyle->setBorderRightWidth(image.borderSlices().right().value ());
558 if (image.borderSlices().bottom().isFixed()) 558 if (image.borderSlices().bottom().isFixed())
559 style()->setBorderBottomWidth(image.borderSlices().bottom().value()) ; 559 mutableStyle->setBorderBottomWidth(image.borderSlices().bottom().val ue());
560 if (image.borderSlices().left().isFixed()) 560 if (image.borderSlices().left().isFixed())
561 style()->setBorderLeftWidth(image.borderSlices().left().value()); 561 mutableStyle->setBorderLeftWidth(image.borderSlices().left().value() );
562 } 562 }
563 } 563 }
564 564
565 void CSSToStyleMap::mapNinePieceImageSlice(CSSValue* value, NinePieceImage& imag e) const 565 void CSSToStyleMap::mapNinePieceImageSlice(CSSValue* value, NinePieceImage& imag e) const
566 { 566 {
567 if (!value || !value->isBorderImageSliceValue()) 567 if (!value || !value->isBorderImageSliceValue())
568 return; 568 return;
569 569
570 // Retrieve the border image value. 570 // Retrieve the border image value.
571 CSSBorderImageSliceValue* borderImageSlice = static_cast<CSSBorderImageSlice Value*>(value); 571 CSSBorderImageSliceValue* borderImageSlice = static_cast<CSSBorderImageSlice Value*>(value);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 verticalRule = SpaceImageRule; 682 verticalRule = SpaceImageRule;
683 break; 683 break;
684 default: // CSSValueRepeat 684 default: // CSSValueRepeat
685 verticalRule = RepeatImageRule; 685 verticalRule = RepeatImageRule;
686 break; 686 break;
687 } 687 }
688 image.setVerticalRule(verticalRule); 688 image.setVerticalRule(verticalRule);
689 } 689 }
690 690
691 }; 691 };
OLDNEW
« no previous file with comments | « Source/core/css/CSSToStyleMap.h ('k') | Source/core/css/resolver/FontBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698