| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } | 101 } |
| 102 | 102 |
| 103 void TextTrackRegion::setWidth(double value, ExceptionState& es) | 103 void TextTrackRegion::setWidth(double value, ExceptionState& es) |
| 104 { | 104 { |
| 105 if (std::isinf(value) || std::isnan(value)) { | 105 if (std::isinf(value) || std::isnan(value)) { |
| 106 es.throwTypeError(); | 106 es.throwTypeError(); |
| 107 return; | 107 return; |
| 108 } | 108 } |
| 109 | 109 |
| 110 if (value < 0 || value > 100) { | 110 if (value < 0 || value > 100) { |
| 111 es.throwDOMException(IndexSizeError); | 111 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 112 return; | 112 return; |
| 113 } | 113 } |
| 114 | 114 |
| 115 m_width = value; | 115 m_width = value; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void TextTrackRegion::setHeight(long value, ExceptionState& es) | 118 void TextTrackRegion::setHeight(long value, ExceptionState& es) |
| 119 { | 119 { |
| 120 if (value < 0) { | 120 if (value < 0) { |
| 121 es.throwDOMException(IndexSizeError); | 121 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 122 return; | 122 return; |
| 123 } | 123 } |
| 124 | 124 |
| 125 m_heightInLines = value; | 125 m_heightInLines = value; |
| 126 } | 126 } |
| 127 | 127 |
| 128 void TextTrackRegion::setRegionAnchorX(double value, ExceptionState& es) | 128 void TextTrackRegion::setRegionAnchorX(double value, ExceptionState& es) |
| 129 { | 129 { |
| 130 if (std::isinf(value) || std::isnan(value)) { | 130 if (std::isinf(value) || std::isnan(value)) { |
| 131 es.throwTypeError(); | 131 es.throwTypeError(); |
| 132 return; | 132 return; |
| 133 } | 133 } |
| 134 | 134 |
| 135 if (value < 0 || value > 100) { | 135 if (value < 0 || value > 100) { |
| 136 es.throwDOMException(IndexSizeError); | 136 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 137 return; | 137 return; |
| 138 } | 138 } |
| 139 | 139 |
| 140 m_regionAnchor.setX(value); | 140 m_regionAnchor.setX(value); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void TextTrackRegion::setRegionAnchorY(double value, ExceptionState& es) | 143 void TextTrackRegion::setRegionAnchorY(double value, ExceptionState& es) |
| 144 { | 144 { |
| 145 if (std::isinf(value) || std::isnan(value)) { | 145 if (std::isinf(value) || std::isnan(value)) { |
| 146 es.throwTypeError(); | 146 es.throwTypeError(); |
| 147 return; | 147 return; |
| 148 } | 148 } |
| 149 | 149 |
| 150 if (value < 0 || value > 100) { | 150 if (value < 0 || value > 100) { |
| 151 es.throwDOMException(IndexSizeError); | 151 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 152 return; | 152 return; |
| 153 } | 153 } |
| 154 | 154 |
| 155 m_regionAnchor.setY(value); | 155 m_regionAnchor.setY(value); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void TextTrackRegion::setViewportAnchorX(double value, ExceptionState& es) | 158 void TextTrackRegion::setViewportAnchorX(double value, ExceptionState& es) |
| 159 { | 159 { |
| 160 if (std::isinf(value) || std::isnan(value)) { | 160 if (std::isinf(value) || std::isnan(value)) { |
| 161 es.throwTypeError(); | 161 es.throwTypeError(); |
| 162 return; | 162 return; |
| 163 } | 163 } |
| 164 | 164 |
| 165 if (value < 0 || value > 100) { | 165 if (value < 0 || value > 100) { |
| 166 es.throwDOMException(IndexSizeError); | 166 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 167 return; | 167 return; |
| 168 } | 168 } |
| 169 | 169 |
| 170 m_viewportAnchor.setX(value); | 170 m_viewportAnchor.setX(value); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void TextTrackRegion::setViewportAnchorY(double value, ExceptionState& es) | 173 void TextTrackRegion::setViewportAnchorY(double value, ExceptionState& es) |
| 174 { | 174 { |
| 175 if (std::isinf(value) || std::isnan(value)) { | 175 if (std::isinf(value) || std::isnan(value)) { |
| 176 es.throwTypeError(); | 176 es.throwTypeError(); |
| 177 return; | 177 return; |
| 178 } | 178 } |
| 179 | 179 |
| 180 if (value < 0 || value > 100) { | 180 if (value < 0 || value > 100) { |
| 181 es.throwDOMException(IndexSizeError); | 181 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 182 return; | 182 return; |
| 183 } | 183 } |
| 184 | 184 |
| 185 m_viewportAnchor.setY(value); | 185 m_viewportAnchor.setY(value); |
| 186 } | 186 } |
| 187 | 187 |
| 188 const AtomicString TextTrackRegion::scroll() const | 188 const AtomicString TextTrackRegion::scroll() const |
| 189 { | 189 { |
| 190 DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicS
tring::ConstructFromLiteral)); | 190 DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicS
tring::ConstructFromLiteral)); |
| 191 | 191 |
| 192 if (m_scroll) | 192 if (m_scroll) |
| 193 return upScrollValueKeyword; | 193 return upScrollValueKeyword; |
| 194 | 194 |
| 195 return ""; | 195 return ""; |
| 196 } | 196 } |
| 197 | 197 |
| 198 void TextTrackRegion::setScroll(const AtomicString& value, ExceptionState& es) | 198 void TextTrackRegion::setScroll(const AtomicString& value, ExceptionState& es) |
| 199 { | 199 { |
| 200 DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicS
tring::ConstructFromLiteral)); | 200 DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicS
tring::ConstructFromLiteral)); |
| 201 | 201 |
| 202 if (value != emptyString() && value != upScrollValueKeyword) { | 202 if (value != emptyString() && value != upScrollValueKeyword) { |
| 203 es.throwDOMException(SyntaxError); | 203 es.throwUninformativeAndGenericDOMException(SyntaxError); |
| 204 return; | 204 return; |
| 205 } | 205 } |
| 206 | 206 |
| 207 m_scroll = value == upScrollValueKeyword; | 207 m_scroll = value == upScrollValueKeyword; |
| 208 } | 208 } |
| 209 | 209 |
| 210 void TextTrackRegion::updateParametersFromRegion(TextTrackRegion* region) | 210 void TextTrackRegion::updateParametersFromRegion(TextTrackRegion* region) |
| 211 { | 211 { |
| 212 m_heightInLines = region->height(); | 212 m_heightInLines = region->height(); |
| 213 m_width = region->width(); | 213 m_width = region->width(); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 { | 501 { |
| 502 LOG(Media, "TextTrackRegion::scrollTimerFired"); | 502 LOG(Media, "TextTrackRegion::scrollTimerFired"); |
| 503 | 503 |
| 504 stopTimer(); | 504 stopTimer(); |
| 505 displayLastTextTrackCueBox(); | 505 displayLastTextTrackCueBox(); |
| 506 } | 506 } |
| 507 | 507 |
| 508 } // namespace WebCore | 508 } // namespace WebCore |
| 509 | 509 |
| 510 #endif | 510 #endif |
| OLD | NEW |