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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 } | 43 } |
44 | 44 |
45 ImageCandidate(const String& source, unsigned start, unsigned length, float
scaleFactor) | 45 ImageCandidate(const String& source, unsigned start, unsigned length, float
scaleFactor) |
46 : m_string(source.createView(start, length)) | 46 : m_string(source.createView(start, length)) |
47 , m_scaleFactor(scaleFactor) | 47 , m_scaleFactor(scaleFactor) |
48 { | 48 { |
49 } | 49 } |
50 | 50 |
51 String toString() const | 51 String toString() const |
52 { | 52 { |
53 return m_string.toString(); | 53 return String(m_string.toString()); |
| 54 } |
| 55 |
| 56 AtomicString toAtomicString() const |
| 57 { |
| 58 return AtomicString(m_string.toString()); |
54 } | 59 } |
55 | 60 |
56 inline float scaleFactor() const | 61 inline float scaleFactor() const |
57 { | 62 { |
58 return m_scaleFactor; | 63 return m_scaleFactor; |
59 } | 64 } |
60 | 65 |
61 inline bool isEmpty() const | 66 inline bool isEmpty() const |
62 { | 67 { |
63 return m_string.isEmpty(); | 68 return m_string.isEmpty(); |
64 } | 69 } |
65 | 70 |
66 private: | 71 private: |
67 StringView m_string; | 72 StringView m_string; |
68 float m_scaleFactor; | 73 float m_scaleFactor; |
69 }; | 74 }; |
70 | 75 |
71 ImageCandidate bestFitSourceForSrcsetAttribute(float deviceScaleFactor, const St
ring& srcsetAttribute); | 76 ImageCandidate bestFitSourceForSrcsetAttribute(float deviceScaleFactor, const St
ring& srcsetAttribute); |
72 | 77 |
73 ImageCandidate bestFitSourceForImageAttributes(float deviceScaleFactor, const St
ring& srcAttribute, const String& srcsetAttribute); | 78 ImageCandidate bestFitSourceForImageAttributes(float deviceScaleFactor, const St
ring& srcAttribute, const String& srcsetAttribute); |
74 | 79 |
75 String bestFitSourceForImageAttributes(float deviceScaleFactor, const String& sr
cAttribute, ImageCandidate& srcsetImageCandidate); | 80 String bestFitSourceForImageAttributes(float deviceScaleFactor, const String& sr
cAttribute, ImageCandidate& srcsetImageCandidate); |
76 | 81 |
77 } | 82 } |
78 | 83 |
79 #endif | 84 #endif |
OLD | NEW |