| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 if (!styleImage) | 808 if (!styleImage) |
| 809 continue; | 809 continue; |
| 810 ImageResource* cachedImage = styleImage->cachedImage(); | 810 ImageResource* cachedImage = styleImage->cachedImage(); |
| 811 if (!cachedImage) | 811 if (!cachedImage) |
| 812 continue; | 812 continue; |
| 813 float scale = styleImage->imageScaleFactor(); | 813 float scale = styleImage->imageScaleFactor(); |
| 814 bool hotSpotSpecified = (*cursors)[i].hotSpotSpecified(); | 814 bool hotSpotSpecified = (*cursors)[i].hotSpotSpecified(); |
| 815 // Get hotspot and convert from logical pixels to physical pixels. | 815 // Get hotspot and convert from logical pixels to physical pixels. |
| 816 IntPoint hotSpot = (*cursors)[i].hotSpot(); | 816 IntPoint hotSpot = (*cursors)[i].hotSpot(); |
| 817 hotSpot.scale(scale, scale); | 817 hotSpot.scale(scale, scale); |
| 818 IntSize size = cachedImage->imageForLayoutObject(layoutObject)->size
(); | 818 IntSize size = cachedImage->image()->size(); |
| 819 if (cachedImage->errorOccurred()) | 819 if (cachedImage->errorOccurred()) |
| 820 continue; | 820 continue; |
| 821 // Limit the size of cursors (in UI pixels) so that they cannot be | 821 // Limit the size of cursors (in UI pixels) so that they cannot be |
| 822 // used to cover UI elements in chrome. | 822 // used to cover UI elements in chrome. |
| 823 size.scale(1 / scale); | 823 size.scale(1 / scale); |
| 824 if (size.width() > maximumCursorSize || size.height() > maximumCurso
rSize) | 824 if (size.width() > maximumCursorSize || size.height() > maximumCurso
rSize) |
| 825 continue; | 825 continue; |
| 826 | 826 |
| 827 Image* image = cachedImage->imageForLayoutObject(layoutObject); | 827 Image* image = cachedImage->image(); |
| 828 // Ensure no overflow possible in calculations above. | 828 // Ensure no overflow possible in calculations above. |
| 829 if (scale < minimumCursorScale) | 829 if (scale < minimumCursorScale) |
| 830 continue; | 830 continue; |
| 831 return Cursor(image, hotSpotSpecified, hotSpot, scale); | 831 return Cursor(image, hotSpotSpecified, hotSpot, scale); |
| 832 } | 832 } |
| 833 } | 833 } |
| 834 | 834 |
| 835 switch (style ? style->cursor() : CURSOR_AUTO) { | 835 switch (style ? style->cursor() : CURSOR_AUTO) { |
| 836 case CURSOR_AUTO: { | 836 case CURSOR_AUTO: { |
| 837 bool horizontalText = !style || style->isHorizontalWritingMode(); | 837 bool horizontalText = !style || style->isHorizontalWritingMode(); |
| (...skipping 3249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4087 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() | 4087 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() |
| 4088 { | 4088 { |
| 4089 #if OS(MACOSX) | 4089 #if OS(MACOSX) |
| 4090 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); | 4090 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); |
| 4091 #else | 4091 #else |
| 4092 return PlatformEvent::AltKey; | 4092 return PlatformEvent::AltKey; |
| 4093 #endif | 4093 #endif |
| 4094 } | 4094 } |
| 4095 | 4095 |
| 4096 } // namespace blink | 4096 } // namespace blink |
| OLD | NEW |