OSDN Git Service

am 3c54ece0: am 5dc34a85: activeDocumentLoader() causes crash in WebCoreFrameBridge.cpp
[android-x86/external-webkit.git] / WebCore / css / CSSCursorImageValue.cpp
index 84ac565..f2e5d95 100644 (file)
@@ -17,7 +17,7 @@
  * along with this library; see the file COPYING.LIB.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
- */
+ */ 
 
 #include "config.h"
 #include "CSSCursorImageValue.h"
@@ -25,7 +25,6 @@
 #include "DocLoader.h"
 #include "Document.h"
 #include "PlatformString.h"
-#include "RenderStyle.h"
 #include <wtf/MathExtras.h>
 #include <wtf/UnusedParam.h>
 
@@ -39,8 +38,8 @@ namespace WebCore {
 #if ENABLE(SVG)
 static inline bool isSVGCursorIdentifier(const String& url)
 {
-    KURL kurl(url);
-    return kurl.hasRef();
+    KURL kurl(ParsedURLString, url);
+    return kurl.hasFragmentIdentifier();
 }
 
 static inline SVGCursorElement* resourceReferencedByCursorElement(const String& fragmentId, Document* document)
@@ -53,9 +52,9 @@ static inline SVGCursorElement* resourceReferencedByCursorElement(const String&
 }
 #endif
 
-CSSCursorImageValue::CSSCursorImageValue(const String& url, const IntPoint& hotspot)
+CSSCursorImageValue::CSSCursorImageValue(const String& url, const IntPoint& hotSpot)
     : CSSImageValue(url)
-    , m_hotspot(hotspot)
+    , m_hotSpot(hotSpot)
 {
 }
 
@@ -91,11 +90,12 @@ bool CSSCursorImageValue::updateIfSVGCursorIsUsed(Element* element)
         return false;
 
     if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(url, element->document())) {
+        // FIXME: This will override hot spot specified in CSS, which is probably incorrect.
         float x = roundf(cursorElement->x().value(0));
-        m_hotspot.setX(static_cast<int>(x));
+        m_hotSpot.setX(static_cast<int>(x));
 
         float y = roundf(cursorElement->y().value(0));
-        m_hotspot.setY(static_cast<int>(y));
+        m_hotSpot.setY(static_cast<int>(y));
 
         if (cachedImageURL() != element->document()->completeURL(cursorElement->href()))
             clearCachedImage();