| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2006, 2010, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2006, 2010, 2012 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 return queries[index]->cssText(); | 194 return queries[index]->cssText(); |
| 195 return String(); | 195 return String(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void MediaList::deleteMedium(const String& medium, ExceptionState& exceptionStat
e) | 198 void MediaList::deleteMedium(const String& medium, ExceptionState& exceptionStat
e) |
| 199 { | 199 { |
| 200 CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule); | 200 CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule); |
| 201 | 201 |
| 202 bool success = m_mediaQueries->remove(medium); | 202 bool success = m_mediaQueries->remove(medium); |
| 203 if (!success) { | 203 if (!success) { |
| 204 exceptionState.throwUninformativeAndGenericDOMException(NotFoundError); | 204 exceptionState.throwDOMException(NotFoundError, "Failed to delete '" + m
edium + "'."); |
| 205 return; | 205 return; |
| 206 } | 206 } |
| 207 if (m_parentStyleSheet) | 207 if (m_parentStyleSheet) |
| 208 m_parentStyleSheet->didMutate(); | 208 m_parentStyleSheet->didMutate(); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void MediaList::appendMedium(const String& medium, ExceptionState& exceptionStat
e) | 211 void MediaList::appendMedium(const String& medium, ExceptionState& exceptionStat
e) |
| 212 { | 212 { |
| 213 CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule); | 213 CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule); |
| 214 | 214 |
| 215 bool success = m_mediaQueries->add(medium); | 215 bool success = m_mediaQueries->add(medium); |
| 216 if (!success) { | 216 if (!success) { |
| 217 exceptionState.throwUninformativeAndGenericDOMException(InvalidCharacter
Error); | 217 exceptionState.throwDOMException(InvalidCharacterError, "The value provi
ded ('" + medium + "') is not a valid medium."); |
| 218 return; | 218 return; |
| 219 } | 219 } |
| 220 | 220 |
| 221 if (m_parentStyleSheet) | 221 if (m_parentStyleSheet) |
| 222 m_parentStyleSheet->didMutate(); | 222 m_parentStyleSheet->didMutate(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 void MediaList::reattach(MediaQuerySet* mediaQueries) | 225 void MediaList::reattach(MediaQuerySet* mediaQueries) |
| 226 { | 226 { |
| 227 ASSERT(mediaQueries); | 227 ASSERT(mediaQueries); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssV
alue); | 284 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssV
alue); |
| 285 if (primitiveValue->isDotsPerInch() || primitiveValue->isDot
sPerCentimeter()) | 285 if (primitiveValue->isDotsPerInch() || primitiveValue->isDot
sPerCentimeter()) |
| 286 addResolutionWarningMessageToConsole(document, mediaQuer
ySet->mediaText(), primitiveValue); | 286 addResolutionWarningMessageToConsole(document, mediaQuer
ySet->mediaText(), primitiveValue); |
| 287 } | 287 } |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 | 292 |
| 293 } | 293 } |
| OLD | NEW |