| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void VTTRegion::setTrack(TextTrack* track) | 87 void VTTRegion::setTrack(TextTrack* track) |
| 88 { | 88 { |
| 89 m_track = track; | 89 m_track = track; |
| 90 } | 90 } |
| 91 | 91 |
| 92 void VTTRegion::setId(const String& id) | 92 void VTTRegion::setId(const String& id) |
| 93 { | 93 { |
| 94 m_id = id; | 94 m_id = id; |
| 95 } | 95 } |
| 96 | 96 |
| 97 void VTTRegion::setWidth(double value, ExceptionState& es) | 97 void VTTRegion::setWidth(double value, ExceptionState& exceptionState) |
| 98 { | 98 { |
| 99 if (std::isinf(value) || std::isnan(value)) { | 99 if (std::isinf(value) || std::isnan(value)) { |
| 100 es.throwUninformativeAndGenericTypeError(); | 100 exceptionState.throwUninformativeAndGenericTypeError(); |
| 101 return; | 101 return; |
| 102 } | 102 } |
| 103 | 103 |
| 104 if (value < 0 || value > 100) { | 104 if (value < 0 || value > 100) { |
| 105 es.throwUninformativeAndGenericDOMException(IndexSizeError); | 105 exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 106 return; | 106 return; |
| 107 } | 107 } |
| 108 | 108 |
| 109 m_width = value; | 109 m_width = value; |
| 110 } | 110 } |
| 111 | 111 |
| 112 void VTTRegion::setHeight(long value, ExceptionState& es) | 112 void VTTRegion::setHeight(long value, ExceptionState& exceptionState) |
| 113 { | 113 { |
| 114 if (value < 0) { | 114 if (value < 0) { |
| 115 es.throwUninformativeAndGenericDOMException(IndexSizeError); | 115 exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 116 return; | 116 return; |
| 117 } | 117 } |
| 118 | 118 |
| 119 m_heightInLines = value; | 119 m_heightInLines = value; |
| 120 } | 120 } |
| 121 | 121 |
| 122 void VTTRegion::setRegionAnchorX(double value, ExceptionState& es) | 122 void VTTRegion::setRegionAnchorX(double value, ExceptionState& exceptionState) |
| 123 { | 123 { |
| 124 if (std::isinf(value) || std::isnan(value)) { | 124 if (std::isinf(value) || std::isnan(value)) { |
| 125 es.throwUninformativeAndGenericTypeError(); | 125 exceptionState.throwUninformativeAndGenericTypeError(); |
| 126 return; | 126 return; |
| 127 } | 127 } |
| 128 | 128 |
| 129 if (value < 0 || value > 100) { | 129 if (value < 0 || value > 100) { |
| 130 es.throwUninformativeAndGenericDOMException(IndexSizeError); | 130 exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 131 return; | 131 return; |
| 132 } | 132 } |
| 133 | 133 |
| 134 m_regionAnchor.setX(value); | 134 m_regionAnchor.setX(value); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void VTTRegion::setRegionAnchorY(double value, ExceptionState& es) | 137 void VTTRegion::setRegionAnchorY(double value, ExceptionState& exceptionState) |
| 138 { | 138 { |
| 139 if (std::isinf(value) || std::isnan(value)) { | 139 if (std::isinf(value) || std::isnan(value)) { |
| 140 es.throwUninformativeAndGenericTypeError(); | 140 exceptionState.throwUninformativeAndGenericTypeError(); |
| 141 return; | 141 return; |
| 142 } | 142 } |
| 143 | 143 |
| 144 if (value < 0 || value > 100) { | 144 if (value < 0 || value > 100) { |
| 145 es.throwUninformativeAndGenericDOMException(IndexSizeError); | 145 exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 146 return; | 146 return; |
| 147 } | 147 } |
| 148 | 148 |
| 149 m_regionAnchor.setY(value); | 149 m_regionAnchor.setY(value); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void VTTRegion::setViewportAnchorX(double value, ExceptionState& es) | 152 void VTTRegion::setViewportAnchorX(double value, ExceptionState& exceptionState) |
| 153 { | 153 { |
| 154 if (std::isinf(value) || std::isnan(value)) { | 154 if (std::isinf(value) || std::isnan(value)) { |
| 155 es.throwUninformativeAndGenericTypeError(); | 155 exceptionState.throwUninformativeAndGenericTypeError(); |
| 156 return; | 156 return; |
| 157 } | 157 } |
| 158 | 158 |
| 159 if (value < 0 || value > 100) { | 159 if (value < 0 || value > 100) { |
| 160 es.throwUninformativeAndGenericDOMException(IndexSizeError); | 160 exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 161 return; | 161 return; |
| 162 } | 162 } |
| 163 | 163 |
| 164 m_viewportAnchor.setX(value); | 164 m_viewportAnchor.setX(value); |
| 165 } | 165 } |
| 166 | 166 |
| 167 void VTTRegion::setViewportAnchorY(double value, ExceptionState& es) | 167 void VTTRegion::setViewportAnchorY(double value, ExceptionState& exceptionState) |
| 168 { | 168 { |
| 169 if (std::isinf(value) || std::isnan(value)) { | 169 if (std::isinf(value) || std::isnan(value)) { |
| 170 es.throwUninformativeAndGenericTypeError(); | 170 exceptionState.throwUninformativeAndGenericTypeError(); |
| 171 return; | 171 return; |
| 172 } | 172 } |
| 173 | 173 |
| 174 if (value < 0 || value > 100) { | 174 if (value < 0 || value > 100) { |
| 175 es.throwUninformativeAndGenericDOMException(IndexSizeError); | 175 exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 176 return; | 176 return; |
| 177 } | 177 } |
| 178 | 178 |
| 179 m_viewportAnchor.setY(value); | 179 m_viewportAnchor.setY(value); |
| 180 } | 180 } |
| 181 | 181 |
| 182 const AtomicString VTTRegion::scroll() const | 182 const AtomicString VTTRegion::scroll() const |
| 183 { | 183 { |
| 184 DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicS
tring::ConstructFromLiteral)); | 184 DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicS
tring::ConstructFromLiteral)); |
| 185 | 185 |
| 186 if (m_scroll) | 186 if (m_scroll) |
| 187 return upScrollValueKeyword; | 187 return upScrollValueKeyword; |
| 188 | 188 |
| 189 return ""; | 189 return ""; |
| 190 } | 190 } |
| 191 | 191 |
| 192 void VTTRegion::setScroll(const AtomicString& value, ExceptionState& es) | 192 void VTTRegion::setScroll(const AtomicString& value, ExceptionState& exceptionSt
ate) |
| 193 { | 193 { |
| 194 DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicS
tring::ConstructFromLiteral)); | 194 DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicS
tring::ConstructFromLiteral)); |
| 195 | 195 |
| 196 if (value != emptyString() && value != upScrollValueKeyword) { | 196 if (value != emptyString() && value != upScrollValueKeyword) { |
| 197 es.throwUninformativeAndGenericDOMException(SyntaxError); | 197 exceptionState.throwUninformativeAndGenericDOMException(SyntaxError); |
| 198 return; | 198 return; |
| 199 } | 199 } |
| 200 | 200 |
| 201 m_scroll = value == upScrollValueKeyword; | 201 m_scroll = value == upScrollValueKeyword; |
| 202 } | 202 } |
| 203 | 203 |
| 204 void VTTRegion::updateParametersFromRegion(VTTRegion* region) | 204 void VTTRegion::updateParametersFromRegion(VTTRegion* region) |
| 205 { | 205 { |
| 206 m_heightInLines = region->height(); | 206 m_heightInLines = region->height(); |
| 207 m_width = region->width(); | 207 m_width = region->width(); |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 | 494 |
| 495 void VTTRegion::scrollTimerFired(Timer<VTTRegion>*) | 495 void VTTRegion::scrollTimerFired(Timer<VTTRegion>*) |
| 496 { | 496 { |
| 497 LOG(Media, "VTTRegion::scrollTimerFired"); | 497 LOG(Media, "VTTRegion::scrollTimerFired"); |
| 498 | 498 |
| 499 stopTimer(); | 499 stopTimer(); |
| 500 displayLastTextTrackCueBox(); | 500 displayLastTextTrackCueBox(); |
| 501 } | 501 } |
| 502 | 502 |
| 503 } // namespace WebCore | 503 } // namespace WebCore |
| OLD | NEW |