OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef HTMLDimension_h | 31 #ifndef HTMLDimension_h |
32 #define HTMLDimension_h | 32 #define HTMLDimension_h |
33 | 33 |
34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
| 35 #include "wtf/Allocator.h" |
35 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
36 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
37 | 38 |
38 namespace blink { | 39 namespace blink { |
39 | 40 |
40 // This class corresponds to a dimension as described in HTML5 by the | 41 // This class corresponds to a dimension as described in HTML5 by the |
41 // "rules for parsing a list of dimensions" (section 2.4.4.6). | 42 // "rules for parsing a list of dimensions" (section 2.4.4.6). |
42 class HTMLDimension { | 43 class HTMLDimension { |
| 44 ALLOW_ONLY_INLINE_ALLOCATION(); |
43 public: | 45 public: |
44 enum HTMLDimensionType { | 46 enum HTMLDimensionType { |
45 Relative, Percentage, Absolute | 47 Relative, Percentage, Absolute |
46 }; | 48 }; |
47 | 49 |
48 HTMLDimension() | 50 HTMLDimension() |
49 : m_type(Absolute) | 51 : m_type(Absolute) |
50 , m_value(0) | 52 , m_value(0) |
51 { | 53 { |
52 } | 54 } |
(...skipping 21 matching lines...) Expand all Loading... |
74 private: | 76 private: |
75 HTMLDimensionType m_type; | 77 HTMLDimensionType m_type; |
76 double m_value; | 78 double m_value; |
77 }; | 79 }; |
78 | 80 |
79 CORE_EXPORT Vector<HTMLDimension> parseListOfDimensions(const String&); | 81 CORE_EXPORT Vector<HTMLDimension> parseListOfDimensions(const String&); |
80 | 82 |
81 } // namespace blink | 83 } // namespace blink |
82 | 84 |
83 #endif // HTMLDimension_h | 85 #endif // HTMLDimension_h |
OLD | NEW |