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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 #include "bindings/core/v8/ExceptionMessages.h" | 33 #include "bindings/core/v8/ExceptionMessages.h" |
34 #include "bindings/core/v8/ExceptionState.h" | 34 #include "bindings/core/v8/ExceptionState.h" |
35 #include "core/dom/ClientRect.h" | 35 #include "core/dom/ClientRect.h" |
36 #include "core/dom/DOMTokenList.h" | 36 #include "core/dom/DOMTokenList.h" |
37 #include "core/dom/ElementTraversal.h" | 37 #include "core/dom/ElementTraversal.h" |
38 #include "core/dom/ExceptionCode.h" | 38 #include "core/dom/ExceptionCode.h" |
39 #include "core/html/HTMLDivElement.h" | 39 #include "core/html/HTMLDivElement.h" |
40 #include "core/html/track/vtt/VTTParser.h" | 40 #include "core/html/track/vtt/VTTParser.h" |
41 #include "core/html/track/vtt/VTTScanner.h" | 41 #include "core/html/track/vtt/VTTScanner.h" |
| 42 #include "public/platform/Platform.h" |
42 #include "wtf/MathExtras.h" | 43 #include "wtf/MathExtras.h" |
43 | 44 |
44 #define VTT_LOG_LEVEL 3 | 45 #define VTT_LOG_LEVEL 3 |
45 | 46 |
46 namespace blink { | 47 namespace blink { |
47 | 48 |
48 // The following values default values are defined within the WebVTT Regions | 49 // The following values default values are defined within the WebVTT Regions |
49 // Spec. | 50 // Spec. |
50 // https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/region.html | 51 // https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/region.html |
51 | 52 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 84 } |
84 | 85 |
85 VTTRegion::VTTRegion() | 86 VTTRegion::VTTRegion() |
86 : m_id(emptyString), | 87 : m_id(emptyString), |
87 m_width(defaultWidth), | 88 m_width(defaultWidth), |
88 m_lines(defaultHeightInLines), | 89 m_lines(defaultHeightInLines), |
89 m_regionAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY)), | 90 m_regionAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY)), |
90 m_viewportAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY)), | 91 m_viewportAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY)), |
91 m_scroll(defaultScroll), | 92 m_scroll(defaultScroll), |
92 m_currentTop(0), | 93 m_currentTop(0), |
93 m_scrollTimer(this, &VTTRegion::scrollTimerFired) {} | 94 m_scrollTimer(Platform::current()->currentThread()->getWebTaskRunner(), |
| 95 this, |
| 96 &VTTRegion::scrollTimerFired) {} |
94 | 97 |
95 VTTRegion::~VTTRegion() {} | 98 VTTRegion::~VTTRegion() {} |
96 | 99 |
97 void VTTRegion::setId(const String& id) { | 100 void VTTRegion::setId(const String& id) { |
98 m_id = id; | 101 m_id = id; |
99 } | 102 } |
100 | 103 |
101 void VTTRegion::setWidth(double value, ExceptionState& exceptionState) { | 104 void VTTRegion::setWidth(double value, ExceptionState& exceptionState) { |
102 if (isNonPercentage(value, "width", exceptionState)) | 105 if (isNonPercentage(value, "width", exceptionState)) |
103 return; | 106 return; |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 stopTimer(); | 412 stopTimer(); |
410 displayLastVTTCueBox(); | 413 displayLastVTTCueBox(); |
411 } | 414 } |
412 | 415 |
413 DEFINE_TRACE(VTTRegion) { | 416 DEFINE_TRACE(VTTRegion) { |
414 visitor->trace(m_cueContainer); | 417 visitor->trace(m_cueContainer); |
415 visitor->trace(m_regionDisplayTree); | 418 visitor->trace(m_regionDisplayTree); |
416 } | 419 } |
417 | 420 |
418 } // namespace blink | 421 } // namespace blink |
OLD | NEW |