Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: Source/core/css/CSSCursorImageValue.cpp

Issue 126443005: Use TreeScope::completeURL and baseURL instead of the Document versions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased again, passes tests Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/css/CSSParserMode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
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->x()->currentValue()->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->y()->currentValue()->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->treeScope().completeURL(cursorElement-> hrefCurrentValue()))
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;
116 } 116 }
117 117
118 return false; 118 return false;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/CSSParserMode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698