| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2003, 2007, 2010 Apple Inc. All rights reserved. | 4 * Copyright (C) 2003, 2007, 2010 Apple Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 int HTMLMarqueeElement::scrollAmount() const | 124 int HTMLMarqueeElement::scrollAmount() const |
| 125 { | 125 { |
| 126 bool ok; | 126 bool ok; |
| 127 int scrollAmount = fastGetAttribute(scrollamountAttr).toInt(&ok); | 127 int scrollAmount = fastGetAttribute(scrollamountAttr).toInt(&ok); |
| 128 return ok && scrollAmount >= 0 ? scrollAmount : RenderStyle::initialMarqueeI
ncrement().intValue(); | 128 return ok && scrollAmount >= 0 ? scrollAmount : RenderStyle::initialMarqueeI
ncrement().intValue(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void HTMLMarqueeElement::setScrollAmount(int scrollAmount, ExceptionState& es) | 131 void HTMLMarqueeElement::setScrollAmount(int scrollAmount, ExceptionState& es) |
| 132 { | 132 { |
| 133 if (scrollAmount < 0) | 133 if (scrollAmount < 0) |
| 134 es.throwDOMException(IndexSizeError); | 134 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 135 else | 135 else |
| 136 setIntegralAttribute(scrollamountAttr, scrollAmount); | 136 setIntegralAttribute(scrollamountAttr, scrollAmount); |
| 137 } | 137 } |
| 138 | 138 |
| 139 int HTMLMarqueeElement::scrollDelay() const | 139 int HTMLMarqueeElement::scrollDelay() const |
| 140 { | 140 { |
| 141 bool ok; | 141 bool ok; |
| 142 int scrollDelay = fastGetAttribute(scrolldelayAttr).toInt(&ok); | 142 int scrollDelay = fastGetAttribute(scrolldelayAttr).toInt(&ok); |
| 143 return ok && scrollDelay >= 0 ? scrollDelay : RenderStyle::initialMarqueeSpe
ed(); | 143 return ok && scrollDelay >= 0 ? scrollDelay : RenderStyle::initialMarqueeSpe
ed(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void HTMLMarqueeElement::setScrollDelay(int scrollDelay, ExceptionState& es) | 146 void HTMLMarqueeElement::setScrollDelay(int scrollDelay, ExceptionState& es) |
| 147 { | 147 { |
| 148 if (scrollDelay < 0) | 148 if (scrollDelay < 0) |
| 149 es.throwDOMException(IndexSizeError); | 149 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 150 else | 150 else |
| 151 setIntegralAttribute(scrolldelayAttr, scrollDelay); | 151 setIntegralAttribute(scrolldelayAttr, scrollDelay); |
| 152 } | 152 } |
| 153 | 153 |
| 154 int HTMLMarqueeElement::loop() const | 154 int HTMLMarqueeElement::loop() const |
| 155 { | 155 { |
| 156 bool ok; | 156 bool ok; |
| 157 int loopValue = fastGetAttribute(loopAttr).toInt(&ok); | 157 int loopValue = fastGetAttribute(loopAttr).toInt(&ok); |
| 158 return ok && loopValue > 0 ? loopValue : -1; | 158 return ok && loopValue > 0 ? loopValue : -1; |
| 159 } | 159 } |
| 160 | 160 |
| 161 void HTMLMarqueeElement::setLoop(int loop, ExceptionState& es) | 161 void HTMLMarqueeElement::setLoop(int loop, ExceptionState& es) |
| 162 { | 162 { |
| 163 if (loop <= 0 && loop != -1) | 163 if (loop <= 0 && loop != -1) |
| 164 es.throwDOMException(IndexSizeError); | 164 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 165 else | 165 else |
| 166 setIntegralAttribute(loopAttr, loop); | 166 setIntegralAttribute(loopAttr, loop); |
| 167 } | 167 } |
| 168 | 168 |
| 169 bool HTMLMarqueeElement::canSuspend() const | 169 bool HTMLMarqueeElement::canSuspend() const |
| 170 { | 170 { |
| 171 return true; | 171 return true; |
| 172 } | 172 } |
| 173 | 173 |
| 174 void HTMLMarqueeElement::suspend(ReasonForSuspension) | 174 void HTMLMarqueeElement::suspend(ReasonForSuspension) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 189 return toRenderMarquee(renderer()); | 189 return toRenderMarquee(renderer()); |
| 190 return 0; | 190 return 0; |
| 191 } | 191 } |
| 192 | 192 |
| 193 RenderObject* HTMLMarqueeElement::createRenderer(RenderStyle*) | 193 RenderObject* HTMLMarqueeElement::createRenderer(RenderStyle*) |
| 194 { | 194 { |
| 195 return new RenderMarquee(this); | 195 return new RenderMarquee(this); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace WebCore | 198 } // namespace WebCore |
| OLD | NEW |