Changeset 57358 in webkit
- Timestamp:
- Apr 9, 2010 1:44:13 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57355 r57358 1 2010-04-09 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Adam Roben. 4 5 https://bugs.webkit.org/show_bug.cgi?id=37353, clean up cursors used by RenderStyles. 6 7 * css/CSSComputedStyleDeclaration.cpp: 8 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 9 * page/EventHandler.cpp: 10 (WebCore::EventHandler::selectCursor): 11 * rendering/style/CursorData.h: 12 (WebCore::CursorData::CursorData): 13 (WebCore::CursorData::operator==): 14 (WebCore::CursorData::image): 15 (WebCore::CursorData::hotSpot): 16 * rendering/style/RenderStyle.cpp: 17 (WebCore::RenderStyle::addCursor): 18 1 19 2010-04-09 David Hyatt <hyatt@apple.com> 2 20 -
trunk/WebCore/css/CSSComputedStyleDeclaration.cpp
r57292 r57358 821 821 list = CSSValueList::createCommaSeparated(); 822 822 for (unsigned i = 0; i < cursors->size(); ++i) 823 list->append(CSSPrimitiveValue::create((*cursors)[i]. cursorImage->url(), CSSPrimitiveValue::CSS_URI));823 list->append(CSSPrimitiveValue::create((*cursors)[i].image()->url(), CSSPrimitiveValue::CSS_URI)); 824 824 } 825 825 RefPtr<CSSValue> value = CSSPrimitiveValue::create(style->cursor()); -
trunk/WebCore/page/EventHandler.cpp
r57337 r57358 1022 1022 const CursorList* cursors = style->cursors(); 1023 1023 for (unsigned i = 0; i < cursors->size(); ++i) { 1024 CachedImage* cimage = (*cursors)[i].cursorImage.get();1025 IntPoint hotSpot = (*cursors)[i].hotSpot ;1024 const CachedImage* cimage = (*cursors)[i].image(); 1025 IntPoint hotSpot = (*cursors)[i].hotSpot(); 1026 1026 if (!cimage) 1027 1027 continue; -
trunk/WebCore/rendering/style/CursorData.h
r36623 r57358 32 32 namespace WebCore { 33 33 34 struct CursorData { 35 CursorData() 36 : cursorImage(0) 34 class CursorData { 35 public: 36 CursorData(CachedImage* image, const IntPoint& hotSpot) 37 : m_image(image) 38 , m_hotSpot(hotSpot) 37 39 { 38 40 } … … 40 42 bool operator==(const CursorData& o) const 41 43 { 42 return hotSpot == o.hotSpot && cursorImage == o.cursorImage;44 return m_hotSpot == o.m_hotSpot && m_image == o.m_image; 43 45 } 44 46 … … 48 50 } 49 51 50 IntPoint hotSpot; // for CSS3 support 51 CachedResourceHandle<CachedImage> cursorImage; 52 const CachedImage* image() const { return m_image.get(); } 53 const IntPoint& hotSpot() const { return m_hotSpot; } 54 55 private: 56 CachedResourceHandle<CachedImage> m_image; 57 IntPoint m_hotSpot; // for CSS3 support 52 58 }; 53 59 -
trunk/WebCore/rendering/style/RenderStyle.cpp
r57355 r57358 543 543 void RenderStyle::addCursor(CachedImage* image, const IntPoint& hotSpot) 544 544 { 545 CursorData data;546 data.cursorImage = image;547 data.hotSpot = hotSpot;548 545 if (!inherited.access()->cursorData) 549 546 inherited.access()->cursorData = CursorList::create(); 550 inherited.access()->cursorData->append( data);547 inherited.access()->cursorData->append(CursorData(image, hotSpot)); 551 548 } 552 549
Note: See TracChangeset
for help on using the changeset viewer.