| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 static const String& verticalGrowingRightKeyword() | 87 static const String& verticalGrowingRightKeyword() |
| 88 { | 88 { |
| 89 DEFINE_STATIC_LOCAL(const String, verticallr, ("lr")); | 89 DEFINE_STATIC_LOCAL(const String, verticallr, ("lr")); |
| 90 return verticallr; | 90 return verticallr; |
| 91 } | 91 } |
| 92 | 92 |
| 93 // ---------------------------- | 93 // ---------------------------- |
| 94 | 94 |
| 95 TextTrackCueBox::TextTrackCueBox(Document* document, TextTrackCue* cue) | 95 TextTrackCueBox::TextTrackCueBox(Document& document, TextTrackCue* cue) |
| 96 : HTMLDivElement(divTag, document) | 96 : HTMLDivElement(divTag, document) |
| 97 , m_cue(cue) | 97 , m_cue(cue) |
| 98 { | 98 { |
| 99 setPart(textTrackCueBoxShadowPseudoId()); | 99 setPart(textTrackCueBoxShadowPseudoId()); |
| 100 } | 100 } |
| 101 | 101 |
| 102 TextTrackCue* TextTrackCueBox::getCue() const | 102 TextTrackCue* TextTrackCueBox::getCue() const |
| 103 { | 103 { |
| 104 return m_cue; | 104 return m_cue; |
| 105 } | 105 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 , m_cueSize(100) | 197 , m_cueSize(100) |
| 198 , m_cueIndex(invalidCueIndex) | 198 , m_cueIndex(invalidCueIndex) |
| 199 , m_writingDirection(Horizontal) | 199 , m_writingDirection(Horizontal) |
| 200 , m_cueAlignment(Middle) | 200 , m_cueAlignment(Middle) |
| 201 , m_webVTTNodeTree(0) | 201 , m_webVTTNodeTree(0) |
| 202 , m_track(0) | 202 , m_track(0) |
| 203 , m_scriptExecutionContext(context) | 203 , m_scriptExecutionContext(context) |
| 204 , m_isActive(false) | 204 , m_isActive(false) |
| 205 , m_pauseOnExit(false) | 205 , m_pauseOnExit(false) |
| 206 , m_snapToLines(true) | 206 , m_snapToLines(true) |
| 207 , m_cueBackgroundBox(HTMLDivElement::create(toDocument(context))) | 207 , m_cueBackgroundBox(HTMLDivElement::create(*toDocument(context))) |
| 208 , m_displayTreeShouldChange(true) | 208 , m_displayTreeShouldChange(true) |
| 209 , m_displayDirection(CSSValueLtr) | 209 , m_displayDirection(CSSValueLtr) |
| 210 { | 210 { |
| 211 ASSERT(m_scriptExecutionContext->isDocument()); | 211 ASSERT(m_scriptExecutionContext->isDocument()); |
| 212 ScriptWrappable::init(this); | 212 ScriptWrappable::init(this); |
| 213 | 213 |
| 214 // 4. If the text track cue writing direction is horizontal, then let | 214 // 4. If the text track cue writing direction is horizontal, then let |
| 215 // writing-mode be 'horizontal-tb'. Otherwise, if the text track cue writing | 215 // writing-mode be 'horizontal-tb'. Otherwise, if the text track cue writing |
| 216 // direction is vertical growing left, then let writing-mode be | 216 // direction is vertical growing left, then let writing-mode be |
| 217 // 'vertical-rl'. Otherwise, the text track cue writing direction is | 217 // 'vertical-rl'. Otherwise, the text track cue writing direction is |
| 218 // vertical growing right; let writing-mode be 'vertical-lr'. | 218 // vertical growing right; let writing-mode be 'vertical-lr'. |
| 219 m_displayWritingModeMap[Horizontal] = CSSValueHorizontalTb; | 219 m_displayWritingModeMap[Horizontal] = CSSValueHorizontalTb; |
| 220 m_displayWritingModeMap[VerticalGrowingLeft] = CSSValueVerticalRl; | 220 m_displayWritingModeMap[VerticalGrowingLeft] = CSSValueVerticalRl; |
| 221 m_displayWritingModeMap[VerticalGrowingRight] = CSSValueVerticalLr; | 221 m_displayWritingModeMap[VerticalGrowingRight] = CSSValueVerticalLr; |
| 222 } | 222 } |
| 223 | 223 |
| 224 TextTrackCue::~TextTrackCue() | 224 TextTrackCue::~TextTrackCue() |
| 225 { | 225 { |
| 226 displayTreeInternal()->remove(ASSERT_NO_EXCEPTION); | 226 displayTreeInternal()->remove(ASSERT_NO_EXCEPTION); |
| 227 } | 227 } |
| 228 | 228 |
| 229 PassRefPtr<TextTrackCueBox> TextTrackCue::createDisplayTree() | 229 PassRefPtr<TextTrackCueBox> TextTrackCue::createDisplayTree() |
| 230 { | 230 { |
| 231 return TextTrackCueBox::create(ownerDocument(), this); | 231 ASSERT(ownerDocument()); |
| 232 return TextTrackCueBox::create(*ownerDocument(), this); |
| 232 } | 233 } |
| 233 | 234 |
| 234 PassRefPtr<TextTrackCueBox> TextTrackCue::displayTreeInternal() | 235 PassRefPtr<TextTrackCueBox> TextTrackCue::displayTreeInternal() |
| 235 { | 236 { |
| 236 if (!m_displayTree) | 237 if (!m_displayTree) |
| 237 m_displayTree = createDisplayTree(); | 238 m_displayTree = createDisplayTree(); |
| 238 return m_displayTree; | 239 return m_displayTree; |
| 239 } | 240 } |
| 240 | 241 |
| 241 void TextTrackCue::cueWillChange() | 242 void TextTrackCue::cueWillChange() |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1183 return false; | 1184 return false; |
| 1184 if (m_cueSize != cue.size()) | 1185 if (m_cueSize != cue.size()) |
| 1185 return false; | 1186 return false; |
| 1186 if (align() != cue.align()) | 1187 if (align() != cue.align()) |
| 1187 return false; | 1188 return false; |
| 1188 | 1189 |
| 1189 return true; | 1190 return true; |
| 1190 } | 1191 } |
| 1191 | 1192 |
| 1192 } // namespace WebCore | 1193 } // namespace WebCore |
| OLD | NEW |