1 | /*
|
---|
2 | * Copyright (C) 1999 Lars Knoll ([email protected])
|
---|
3 | * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
|
---|
4 | * Copyright (C) 2012 Google Inc. All rights reserved.
|
---|
5 | *
|
---|
6 | * This library is free software; you can redistribute it and/or
|
---|
7 | * modify it under the terms of the GNU Library General Public
|
---|
8 | * License as published by the Free Software Foundation; either
|
---|
9 | * version 2 of the License, or (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This library is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | * Library General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU Library General Public License
|
---|
17 | * along with this library; see the file COPYING.LIB. If not, write to
|
---|
18 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
---|
19 | * Boston, MA 02110-1301, USA.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #pragma once
|
---|
23 |
|
---|
24 | #include "CSSPropertyNames.h"
|
---|
25 | #include <wtf/FastMalloc.h>
|
---|
26 | #include <wtf/Noncopyable.h>
|
---|
27 |
|
---|
28 | namespace WebCore {
|
---|
29 |
|
---|
30 | class Animation;
|
---|
31 | class CSSValue;
|
---|
32 | class FillLayer;
|
---|
33 | class LengthBox;
|
---|
34 | class NinePieceImage;
|
---|
35 | class Quad;
|
---|
36 | class RenderStyle;
|
---|
37 | class StyleImage;
|
---|
38 |
|
---|
39 | namespace Style {
|
---|
40 | class BuilderState;
|
---|
41 | }
|
---|
42 |
|
---|
43 | class CSSToStyleMap {
|
---|
44 | WTF_MAKE_NONCOPYABLE(CSSToStyleMap);
|
---|
45 | WTF_MAKE_FAST_ALLOCATED;
|
---|
46 |
|
---|
47 | public:
|
---|
48 | CSSToStyleMap(Style::BuilderState&);
|
---|
49 |
|
---|
50 | void mapFillAttachment(CSSPropertyID, FillLayer&, const CSSValue&);
|
---|
51 | void mapFillClip(CSSPropertyID, FillLayer&, const CSSValue&);
|
---|
52 | void mapFillComposite(CSSPropertyID, FillLayer&, const CSSValue&);
|
---|
53 | void mapFillBlendMode(CSSPropertyID, FillLayer&, const CSSValue&);
|
---|
54 | void mapFillOrigin(CSSPropertyID, FillLayer&, const CSSValue&);
|
---|
55 | void mapFillImage(CSSPropertyID, FillLayer&, CSSValue&);
|
---|
56 | void mapFillRepeatX(CSSPropertyID, FillLayer&, const CSSValue&);
|
---|
57 | void mapFillRepeatY(CSSPropertyID, FillLayer&, const CSSValue&);
|
---|
58 | void mapFillSize(CSSPropertyID, FillLayer&, const CSSValue&);
|
---|
59 | void mapFillXPosition(CSSPropertyID, FillLayer&, const CSSValue&);
|
---|
60 | void mapFillYPosition(CSSPropertyID, FillLayer&, const CSSValue&);
|
---|
61 | void mapFillMaskMode(CSSPropertyID, FillLayer&, const CSSValue&);
|
---|
62 |
|
---|
63 | void mapAnimationDelay(Animation&, const CSSValue&);
|
---|
64 | void mapAnimationDirection(Animation&, const CSSValue&);
|
---|
65 | void mapAnimationDuration(Animation&, const CSSValue&);
|
---|
66 | void mapAnimationFillMode(Animation&, const CSSValue&);
|
---|
67 | void mapAnimationIterationCount(Animation&, const CSSValue&);
|
---|
68 | void mapAnimationName(Animation&, const CSSValue&);
|
---|
69 | void mapAnimationPlayState(Animation&, const CSSValue&);
|
---|
70 | void mapAnimationProperty(Animation&, const CSSValue&);
|
---|
71 | void mapAnimationTimingFunction(Animation&, const CSSValue&);
|
---|
72 | void mapAnimationCompositeOperation(Animation&, const CSSValue&);
|
---|
73 |
|
---|
74 | void mapNinePieceImage(CSSValue*, NinePieceImage&);
|
---|
75 | void mapNinePieceImageSlice(CSSValue&, NinePieceImage&);
|
---|
76 | void mapNinePieceImageWidth(CSSValue&, NinePieceImage&);
|
---|
77 | LengthBox mapNinePieceImageQuad(CSSValue&);
|
---|
78 | void mapNinePieceImageRepeat(CSSValue&, NinePieceImage&);
|
---|
79 |
|
---|
80 | private:
|
---|
81 | RenderStyle* style() const;
|
---|
82 | bool useSVGZoomRules() const;
|
---|
83 | RefPtr<StyleImage> styleImage(CSSValue&);
|
---|
84 | LengthBox mapNinePieceImageQuad(Quad*);
|
---|
85 |
|
---|
86 | // FIXME: This type can merge into BuilderState.
|
---|
87 | Style::BuilderState& m_builderState;
|
---|
88 | };
|
---|
89 |
|
---|
90 | } // namespace WebCore
|
---|