<http://webkit.org/b/79144>
Reviewed by Antti Koivisto.
WebKitCSSShaderValue was inheriting from CSSPrimitiveValue but only used
it for storing the shader URL. Moved that to a String member instead.
WebKitCSSShaderValues didn't even return true for isPrimitiveValue() so
there should be no behavior change whatsoever here.
* css/WebKitCSSShaderValue.cpp:
(WebCore::WebKitCSSShaderValue::WebKitCSSShaderValue):
(WebCore::WebKitCSSShaderValue::cachedShader):
(WebCore::WebKitCSSShaderValue::customCssText):
* css/WebKitCSSShaderValue.h:
(WebKitCSSShaderValue):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108396
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-21 Andreas Kling <awesomekling@apple.com>
+
+ Make WebKitCSSShaderValue inherit directly from CSSValue.
+ <http://webkit.org/b/79144>
+
+ Reviewed by Antti Koivisto.
+
+ WebKitCSSShaderValue was inheriting from CSSPrimitiveValue but only used
+ it for storing the shader URL. Moved that to a String member instead.
+
+ WebKitCSSShaderValues didn't even return true for isPrimitiveValue() so
+ there should be no behavior change whatsoever here.
+
+ * css/WebKitCSSShaderValue.cpp:
+ (WebCore::WebKitCSSShaderValue::WebKitCSSShaderValue):
+ (WebCore::WebKitCSSShaderValue::cachedShader):
+ (WebCore::WebKitCSSShaderValue::customCssText):
+ * css/WebKitCSSShaderValue.h:
+ (WebKitCSSShaderValue):
+
2012-02-21 James Robinson <jamesr@chromium.org>
Unreviewed windows build fix - avoid return statement after return if USE(ACCELERATED_COMPOSITING) is set.
#include "WebKitCSSShaderValue.h"
#include "CachedResourceLoader.h"
+#include "CSSParser.h"
#include "Document.h"
#include "StyleCachedShader.h"
#include "StylePendingShader.h"
namespace WebCore {
WebKitCSSShaderValue::WebKitCSSShaderValue(const String& url)
- : CSSPrimitiveValue(WebKitCSSShaderClass, url, CSS_URI)
+ : CSSValue(WebKitCSSShaderClass)
+ , m_url(url)
, m_accessedShader(false)
{
}
if (!m_accessedShader) {
m_accessedShader = true;
- ResourceRequest request(loader->document()->completeURL(getStringValue()));
+ ResourceRequest request(loader->document()->completeURL(m_url));
if (CachedShader* cachedShader = loader->requestShader(request))
m_shader = StyleCachedShader::create(cachedShader);
}
return m_shader.get();
}
+String WebKitCSSShaderValue::customCssText() const
+{
+ return "url(" + quoteCSSURLIfNeeded(m_url) + ")";
+}
} // namespace WebCore
#if ENABLE(CSS_SHADERS)
-#include "CachedResourceHandle.h"
-#include "CSSPrimitiveValue.h"
+#include "CSSValue.h"
namespace WebCore {
class StyleCachedShader;
class StyleShader;
-class WebKitCSSShaderValue : public CSSPrimitiveValue {
+class WebKitCSSShaderValue : public CSSValue {
public:
static PassRefPtr<WebKitCSSShaderValue> create(const String& url) { return adoptRef(new WebKitCSSShaderValue(url)); }
~WebKitCSSShaderValue();
StyleCachedShader* cachedShader(CachedResourceLoader*);
StyleShader* cachedOrPendingShader();
-
+
+ String customCssText() const;
+
private:
WebKitCSSShaderValue(const String& url);
-
+
+ String m_url;
RefPtr<StyleShader> m_shader;
bool m_accessedShader;
};