OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } else { | 66 } else { |
67 setInlineStyleProperty(CSSPropertyLeft, static_cast<float>(cue->position
()), CSSPrimitiveValue::CSS_PERCENTAGE); | 67 setInlineStyleProperty(CSSPropertyLeft, static_cast<float>(cue->position
()), CSSPrimitiveValue::CSS_PERCENTAGE); |
68 setInlineStyleProperty(CSSPropertyTop, static_cast<float>(cue->line()),
CSSPrimitiveValue::CSS_PERCENTAGE); | 68 setInlineStyleProperty(CSSPropertyTop, static_cast<float>(cue->line()),
CSSPrimitiveValue::CSS_PERCENTAGE); |
69 | 69 |
70 if (cue->getWritingDirection() == TextTrackCue::Horizontal) | 70 if (cue->getWritingDirection() == TextTrackCue::Horizontal) |
71 setInlineStyleProperty(CSSPropertyWidth, size, CSSPrimitiveValue::CS
S_PERCENTAGE); | 71 setInlineStyleProperty(CSSPropertyWidth, size, CSSPrimitiveValue::CS
S_PERCENTAGE); |
72 else | 72 else |
73 setInlineStyleProperty(CSSPropertyHeight, size, CSSPrimitiveValue::
CSS_PERCENTAGE); | 73 setInlineStyleProperty(CSSPropertyHeight, size, CSSPrimitiveValue::
CSS_PERCENTAGE); |
74 } | 74 } |
75 | 75 |
76 if (cue->foregroundColor().isValid()) | 76 if (cue->foregroundColor().alpha()) |
77 setInlineStyleProperty(CSSPropertyColor, cue->foregroundColor().serializ
ed()); | 77 setInlineStyleProperty(CSSPropertyColor, cue->foregroundColor().serializ
ed()); |
78 | 78 |
79 if (cue->backgroundColor().isValid()) | 79 if (cue->backgroundColor().alpha()) |
80 cue->element()->setInlineStyleProperty(CSSPropertyBackgroundColor, cue->
backgroundColor().serialized()); | 80 cue->element()->setInlineStyleProperty(CSSPropertyBackgroundColor, cue->
backgroundColor().serialized()); |
81 | 81 |
82 if (cue->getWritingDirection() == TextTrackCue::Horizontal) | 82 if (cue->getWritingDirection() == TextTrackCue::Horizontal) |
83 setInlineStyleProperty(CSSPropertyHeight, CSSValueAuto); | 83 setInlineStyleProperty(CSSPropertyHeight, CSSValueAuto); |
84 else | 84 else |
85 setInlineStyleProperty(CSSPropertyWidth, CSSValueAuto); | 85 setInlineStyleProperty(CSSPropertyWidth, CSSValueAuto); |
86 | 86 |
87 if (cue->baseFontSizeRelativeToVideoHeight()) { | 87 if (cue->baseFontSizeRelativeToVideoHeight()) { |
88 double fontSize = videoSize.height() * cue->baseFontSizeRelativeToVideoH
eight() / 100; | 88 double fontSize = videoSize.height() * cue->baseFontSizeRelativeToVideoH
eight() / 100; |
89 if (cue->fontSizeMultiplier()) | 89 if (cue->fontSizeMultiplier()) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 if (m_foregroundColor != other->foregroundColor()) | 158 if (m_foregroundColor != other->foregroundColor()) |
159 return false; | 159 return false; |
160 if (m_backgroundColor != other->backgroundColor()) | 160 if (m_backgroundColor != other->backgroundColor()) |
161 return false; | 161 return false; |
162 | 162 |
163 return TextTrackCue::operator==(cue); | 163 return TextTrackCue::operator==(cue); |
164 } | 164 } |
165 | 165 |
166 } // namespace WebCore | 166 } // namespace WebCore |
167 | 167 |
OLD | NEW |