[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
simon.fraser at apple.com
simon.fraser at apple.com
Wed Dec 22 12:47:51 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 8f3665df98851c9c4217a246ae192eebe6487135
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Aug 30 15:58:03 2010 +0000
2010-08-29 Simon Fraser <simon.fraser at apple.com>
Reviewed by Darin Adler.
Fix RenderStyle::addCursor to use a StyleImage, not a CachedImage
https://bugs.webkit.org/show_bug.cgi?id=44719
Modernize the CSS cursor code to use a StyleImage, rather
than a CachedImage in the CursorData, and handle the loading
of pending images for the cursor property.
Covered by manual tests in WebCore/manual-tests
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
(WebCore::CSSStyleSelector::loadPendingImages):
* html/canvas/WebGLRenderingContext.cpp:
* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
* rendering/style/CursorData.h:
(WebCore::CursorData::CursorData):
(WebCore::CursorData::image):
(WebCore::CursorData::setImage):
* rendering/style/CursorList.h:
(WebCore::CursorList::operator[]):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::addCursor):
* rendering/style/RenderStyle.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 10561ad..4c68def 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -807,6 +807,37 @@
Reviewed by Darin Adler.
+ Fix RenderStyle::addCursor to use a StyleImage, not a CachedImage
+ https://bugs.webkit.org/show_bug.cgi?id=44719
+
+ Modernize the CSS cursor code to use a StyleImage, rather
+ than a CachedImage in the CursorData, and handle the loading
+ of pending images for the cursor property.
+
+ Covered by manual tests in WebCore/manual-tests
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ (WebCore::CSSStyleSelector::loadPendingImages):
+ * html/canvas/WebGLRenderingContext.cpp:
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::selectCursor):
+ * rendering/style/CursorData.h:
+ (WebCore::CursorData::CursorData):
+ (WebCore::CursorData::image):
+ (WebCore::CursorData::setImage):
+ * rendering/style/CursorList.h:
+ (WebCore::CursorList::operator[]):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::addCursor):
+ * rendering/style/RenderStyle.h:
+
+2010-08-29 Simon Fraser <simon.fraser at apple.com>
+
+ Reviewed by Darin Adler.
+
When properties are missing from animation keyframes, interpolate between those keyframes that specify them
https://bugs.webkit.org/show_bug.cgi?id=40794
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
index 7b4f329..1da86cb 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -692,6 +692,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyBackgroundColor:
return CSSPrimitiveValue::createColor(m_allowVisitedStyle? style->visitedDependentColor(CSSPropertyBackgroundColor).rgb() : style->backgroundColor().rgb());
case CSSPropertyBackgroundImage:
+ // FIXME: Broken for multiple backgrounds. https://bugs.webkit.org/show_bug.cgi?id=44853
if (style->backgroundImage())
return style->backgroundImage()->cssValue();
return CSSPrimitiveValue::createIdentifier(CSSValueNone);
@@ -838,7 +839,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
if (cursors && cursors->size() > 0) {
list = CSSValueList::createCommaSeparated();
for (unsigned i = 0; i < cursors->size(); ++i)
- list->append(CSSPrimitiveValue::create((*cursors)[i].image()->url(), CSSPrimitiveValue::CSS_URI));
+ list->append((*cursors)[i].image()->cssValue());
}
RefPtr<CSSValue> value = CSSPrimitiveValue::create(style->cursor());
if (list) {
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index a070c65..8657843 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -3529,11 +3529,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
CSSCursorImageValue* image = static_cast<CSSCursorImageValue*>(primitiveValue);
if (image->updateIfSVGCursorIsUsed(m_element)) // Elements with SVG cursors are not allowed to share style.
m_style->setUnique();
- // FIXME: Temporary clumsiness to pass off a CachedImage to an API that will eventually convert to using
- // StyleImage. Should also be fixed to use StylePendingImage at the same time.
- RefPtr<StyleCachedImage> styleCachedImage(image->cachedImage(m_element->document()->docLoader()));
- if (styleCachedImage)
- m_style->addCursor(styleCachedImage->cachedImage(), image->hotSpot());
+ m_style->addCursor(cachedOrPendingFromValue(CSSPropertyCursor, image), image->hotSpot());
} else if (type == CSSPrimitiveValue::CSS_IDENT)
m_style->setCursor(*primitiveValue);
}
@@ -6733,6 +6729,7 @@ void CSSStyleSelector::loadPendingImages()
}
break;
}
+
case CSSPropertyContent: {
for (ContentData* contentData = const_cast<ContentData*>(m_style->contentData()); contentData; contentData = contentData->next()) {
if (contentData->isImage() && contentData->image()->isPendingImage()) {
@@ -6742,9 +6739,19 @@ void CSSStyleSelector::loadPendingImages()
}
break;
}
- case CSSPropertyCursor:
- // Cursor doesn't use StylePendingImage yet.
+
+ case CSSPropertyCursor: {
+ if (CursorList* cursorList = m_style->cursors()) {
+ for (size_t i = 0; i < cursorList->size(); ++i) {
+ CursorData& currentCursor = (*cursorList)[i];
+ if (currentCursor.image()->isPendingImage()) {
+ CSSImageValue* imageValue = static_cast<StylePendingImage*>(currentCursor.image())->cssImageValue();
+ currentCursor.setImage(imageValue->cachedImage(docLoader));
+ }
+ }
+ }
break;
+ }
case CSSPropertyListStyleImage: {
if (m_style->listStyleImage() && m_style->listStyleImage()->isPendingImage()) {
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index a37a894..9591a53 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -29,6 +29,7 @@
#include "WebGLRenderingContext.h"
+#include "CachedImage.h"
#include "CanvasPixelArray.h"
#include "CheckedInt.h"
#include "Console.h"
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index d0adb4e..950e857 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -66,6 +66,7 @@
#include "Scrollbar.h"
#include "SelectionController.h"
#include "Settings.h"
+#include "StyleCachedImage.h"
#include "TextEvent.h"
#include "TextIterator.h"
#include "UserGestureIndicator.h"
@@ -1076,10 +1077,13 @@ Cursor EventHandler::selectCursor(const MouseEventWithHitTestResults& event, Scr
if (style && style->cursors()) {
const CursorList* cursors = style->cursors();
for (unsigned i = 0; i < cursors->size(); ++i) {
- const CachedImage* cimage = (*cursors)[i].image();
- IntPoint hotSpot = (*cursors)[i].hotSpot();
+ const CachedImage* cimage = 0;
+ StyleImage* image = (*cursors)[i].image();
+ if (image->isCachedImage())
+ cimage = static_cast<StyleCachedImage*>(image)->cachedImage();
if (!cimage)
continue;
+ IntPoint hotSpot = (*cursors)[i].hotSpot();
// Limit the size of cursors so that they cannot be used to cover UI elements in chrome.
IntSize size = cimage->image()->size();
if (size.width() > 128 || size.height() > 128)
diff --git a/WebCore/rendering/style/CursorData.h b/WebCore/rendering/style/CursorData.h
index 2341e71..6d0a273 100644
--- a/WebCore/rendering/style/CursorData.h
+++ b/WebCore/rendering/style/CursorData.h
@@ -25,15 +25,14 @@
#ifndef CursorData_h
#define CursorData_h
-#include "CachedImage.h"
-#include "CachedResourceHandle.h"
#include "IntPoint.h"
+#include "StyleImage.h"
namespace WebCore {
class CursorData {
public:
- CursorData(CachedImage* image, const IntPoint& hotSpot)
+ CursorData(PassRefPtr<StyleImage> image, const IntPoint& hotSpot)
: m_image(image)
, m_hotSpot(hotSpot)
{
@@ -49,11 +48,13 @@ public:
return !(*this == o);
}
- const CachedImage* image() const { return m_image.get(); }
+ StyleImage* image() const { return m_image.get(); }
+ void setImage(PassRefPtr<StyleImage> image) { m_image = image; }
+
const IntPoint& hotSpot() const { return m_hotSpot; }
private:
- CachedResourceHandle<CachedImage> m_image;
+ RefPtr<StyleImage> m_image;
IntPoint m_hotSpot; // for CSS3 support
};
diff --git a/WebCore/rendering/style/CursorList.h b/WebCore/rendering/style/CursorList.h
index bdd65d4..1b82684 100644
--- a/WebCore/rendering/style/CursorList.h
+++ b/WebCore/rendering/style/CursorList.h
@@ -39,6 +39,7 @@ public:
}
const CursorData& operator[](int i) const { return m_vector[i]; }
+ CursorData& operator[](int i) { return m_vector[i]; }
bool operator==(const CursorList& o) const { return m_vector == o.m_vector; }
bool operator!=(const CursorList& o) const { return m_vector != o.m_vector; }
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp
index 1a26d49..2d59bab 100644
--- a/WebCore/rendering/style/RenderStyle.cpp
+++ b/WebCore/rendering/style/RenderStyle.cpp
@@ -24,7 +24,6 @@
#include "CSSPropertyNames.h"
#include "CSSStyleSelector.h"
-#include "CachedImage.h"
#include "FontSelector.h"
#include "RenderArena.h"
#include "RenderObject.h"
@@ -550,7 +549,7 @@ void RenderStyle::setClip(Length top, Length right, Length bottom, Length left)
data->clip.m_left = left;
}
-void RenderStyle::addCursor(CachedImage* image, const IntPoint& hotSpot)
+void RenderStyle::addCursor(PassRefPtr<StyleImage> image, const IntPoint& hotSpot)
{
if (!rareInheritedData.access()->cursorData)
rareInheritedData.access()->cursorData = CursorList::create();
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index 9cda97f..c9cd270 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -35,7 +35,6 @@
#include "CSSPropertyNames.h"
#include "CSSReflectionDirection.h"
#include "CSSValueList.h"
-#include "CachedImage.h"
#include "CollapsedBorderValue.h"
#include "Color.h"
#include "ColorSpace.h"
@@ -103,7 +102,6 @@ using std::max;
class CSSStyleSelector;
class CSSValueList;
-class CachedImage;
class Pair;
class StyleImage;
@@ -902,7 +900,7 @@ public:
void setCounterReset(short v) { SET_VAR(rareNonInheritedData, m_counterReset, v) }
void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
- void setListStyleImage(StyleImage* v) { if (inherited->list_style_image != v) inherited.access()->list_style_image = v; }
+ void setListStyleImage(PassRefPtr<StyleImage> v) { if (inherited->list_style_image != v) inherited.access()->list_style_image = v; }
void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)) }
@@ -919,7 +917,7 @@ public:
void setPaddingRight(Length v) { SET_VAR(surround, padding.m_right, v) }
void setCursor(ECursor c) { inherited_flags._cursor_style = c; }
- void addCursor(CachedImage*, const IntPoint& = IntPoint());
+ void addCursor(PassRefPtr<StyleImage>, const IntPoint& hotSpot = IntPoint());
void setCursorList(PassRefPtr<CursorList>);
void clearCursorList();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list