OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 class MeterShadowElement : public HTMLDivElement { | 42 class MeterShadowElement : public HTMLDivElement { |
43 public: | 43 public: |
44 MeterShadowElement(Document*); | 44 MeterShadowElement(Document*); |
45 HTMLMeterElement* meterElement() const; | 45 HTMLMeterElement* meterElement() const; |
46 | 46 |
47 private: | 47 private: |
48 virtual bool rendererIsNeeded(const NodeRenderingContext&); | 48 virtual bool rendererIsNeeded(const NodeRenderingContext&); |
49 }; | 49 }; |
50 | 50 |
51 class MeterInnerElement : public MeterShadowElement { | 51 class MeterInnerElement FINAL : public MeterShadowElement { |
52 public: | 52 public: |
53 MeterInnerElement(Document*); | 53 MeterInnerElement(Document*); |
54 static PassRefPtr<MeterInnerElement> create(Document*); | 54 static PassRefPtr<MeterInnerElement> create(Document*); |
55 | 55 |
56 private: | 56 private: |
57 virtual bool rendererIsNeeded(const NodeRenderingContext&) OVERRIDE; | 57 virtual bool rendererIsNeeded(const NodeRenderingContext&) OVERRIDE; |
58 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE; | 58 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE; |
59 }; | 59 }; |
60 | 60 |
61 inline PassRefPtr<MeterInnerElement> MeterInnerElement::create(Document* documen
t) | 61 inline PassRefPtr<MeterInnerElement> MeterInnerElement::create(Document* documen
t) |
62 { | 62 { |
63 return adoptRef(new MeterInnerElement(document)); | 63 return adoptRef(new MeterInnerElement(document)); |
64 } | 64 } |
65 | 65 |
66 class MeterBarElement : public MeterShadowElement { | 66 class MeterBarElement FINAL : public MeterShadowElement { |
67 public: | 67 public: |
68 MeterBarElement(Document* document) | 68 MeterBarElement(Document* document) |
69 : MeterShadowElement(document) | 69 : MeterShadowElement(document) |
70 { | 70 { |
71 DEFINE_STATIC_LOCAL(AtomicString, pseudoId, ("-webkit-meter-bar", Atomic
String::ConstructFromLiteral)); | 71 DEFINE_STATIC_LOCAL(AtomicString, pseudoId, ("-webkit-meter-bar", Atomic
String::ConstructFromLiteral)); |
72 setPseudo(pseudoId); | 72 setPseudo(pseudoId); |
73 } | 73 } |
74 | 74 |
75 static PassRefPtr<MeterBarElement> create(Document*); | 75 static PassRefPtr<MeterBarElement> create(Document*); |
76 }; | 76 }; |
77 | 77 |
78 inline PassRefPtr<MeterBarElement> MeterBarElement::create(Document* document) | 78 inline PassRefPtr<MeterBarElement> MeterBarElement::create(Document* document) |
79 { | 79 { |
80 return adoptRef(new MeterBarElement(document)); | 80 return adoptRef(new MeterBarElement(document)); |
81 } | 81 } |
82 | 82 |
83 class MeterValueElement : public MeterShadowElement { | 83 class MeterValueElement FINAL : public MeterShadowElement { |
84 public: | 84 public: |
85 MeterValueElement(Document* document) | 85 MeterValueElement(Document* document) |
86 : MeterShadowElement(document) | 86 : MeterShadowElement(document) |
87 { | 87 { |
88 updatePseudo(); | 88 updatePseudo(); |
89 } | 89 } |
90 | 90 |
91 static PassRefPtr<MeterValueElement> create(Document*); | 91 static PassRefPtr<MeterValueElement> create(Document*); |
92 void setWidthPercentage(double); | 92 void setWidthPercentage(double); |
93 void updatePseudo() { setPseudo(valuePseudoId()); } | 93 void updatePseudo() { setPseudo(valuePseudoId()); } |
94 | 94 |
95 private: | 95 private: |
96 const AtomicString& valuePseudoId() const; | 96 const AtomicString& valuePseudoId() const; |
97 }; | 97 }; |
98 | 98 |
99 inline PassRefPtr<MeterValueElement> MeterValueElement::create(Document* documen
t) | 99 inline PassRefPtr<MeterValueElement> MeterValueElement::create(Document* documen
t) |
100 { | 100 { |
101 return adoptRef(new MeterValueElement(document)); | 101 return adoptRef(new MeterValueElement(document)); |
102 } | 102 } |
103 | 103 |
104 } | 104 } |
105 | 105 |
106 #endif // MeterShadowElement_h | 106 #endif // MeterShadowElement_h |
OLD | NEW |