| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2006 Rob Buis <buis@kde.org> |
| 3 * (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> | 3 * (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 4 * Copyright (C) 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2008 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return false; | 92 return false; |
| 93 | 93 |
| 94 if (!isSVGCursor()) | 94 if (!isSVGCursor()) |
| 95 return false; | 95 return false; |
| 96 | 96 |
| 97 String url = toCSSImageValue(m_imageValue.get())->url(); | 97 String url = toCSSImageValue(m_imageValue.get())->url(); |
| 98 if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(url,
element->document())) { | 98 if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(url,
element->document())) { |
| 99 // FIXME: This will override hot spot specified in CSS, which is probabl
y incorrect. | 99 // FIXME: This will override hot spot specified in CSS, which is probabl
y incorrect. |
| 100 SVGLengthContext lengthContext(0); | 100 SVGLengthContext lengthContext(0); |
| 101 m_hasHotSpot = true; | 101 m_hasHotSpot = true; |
| 102 float x = roundf(cursorElement->xCurrentValue().value(lengthContext)); | 102 float x = roundf(cursorElement->x()->currentValue()->value(lengthContext
)); |
| 103 m_hotSpot.setX(static_cast<int>(x)); | 103 m_hotSpot.setX(static_cast<int>(x)); |
| 104 | 104 |
| 105 float y = roundf(cursorElement->yCurrentValue().value(lengthContext)); | 105 float y = roundf(cursorElement->y()->currentValue()->value(lengthContext
)); |
| 106 m_hotSpot.setY(static_cast<int>(y)); | 106 m_hotSpot.setY(static_cast<int>(y)); |
| 107 | 107 |
| 108 if (cachedImageURL() != element->document().completeURL(cursorElement->h
refCurrentValue())) | 108 if (cachedImageURL() != element->document().completeURL(cursorElement->h
refCurrentValue())) |
| 109 clearImageResource(); | 109 clearImageResource(); |
| 110 | 110 |
| 111 SVGElement* svgElement = toSVGElement(element); | 111 SVGElement* svgElement = toSVGElement(element); |
| 112 m_referencedElements.add(svgElement); | 112 m_referencedElements.add(svgElement); |
| 113 svgElement->setCursorImageValue(this); | 113 svgElement->setCursorImageValue(this); |
| 114 cursorElement->addClient(svgElement); | 114 cursorElement->addClient(svgElement); |
| 115 return true; | 115 return true; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 m_referencedElements.remove(element); | 189 m_referencedElements.remove(element); |
| 190 } | 190 } |
| 191 | 191 |
| 192 bool CSSCursorImageValue::equals(const CSSCursorImageValue& other) const | 192 bool CSSCursorImageValue::equals(const CSSCursorImageValue& other) const |
| 193 { | 193 { |
| 194 return m_hasHotSpot ? other.m_hasHotSpot && m_hotSpot == other.m_hotSpot : !
other.m_hasHotSpot | 194 return m_hasHotSpot ? other.m_hasHotSpot && m_hotSpot == other.m_hotSpot : !
other.m_hasHotSpot |
| 195 && compareCSSValuePtr(m_imageValue, other.m_imageValue); | 195 && compareCSSValuePtr(m_imageValue, other.m_imageValue); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace WebCore | 198 } // namespace WebCore |
| OLD | NEW |