diff options
author | Steve Block <steveblock@google.com> | 2010-02-11 11:31:37 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-15 10:54:06 +0000 |
commit | 3f39cd7259f17012f847c211fd7a1d6b5fef6309 (patch) | |
tree | 08091a7a2e70836129f5364e7376db01325f6e30 | |
parent | db6ec27680d00cea5ecd0c192eab2767cd6a9cf8 (diff) | |
download | external_webkit-3f39cd7259f17012f847c211fd7a1d6b5fef6309.zip external_webkit-3f39cd7259f17012f847c211fd7a1d6b5fef6309.tar.gz external_webkit-3f39cd7259f17012f847c211fd7a1d6b5fef6309.tar.bz2 |
Merge webkit.org at r54340 : Cherry-pick WebKit change 54650 to add SVG guards for V8
See http://trac.webkit.org/changeset/54650
Change-Id: Ieda3be45b1979c0f9d776cf6b7639f0e67f1466f
-rw-r--r-- | WebCore/Android.derived.v8bindings.mk | 25 | ||||
-rw-r--r-- | WebCore/bindings/v8/custom/V8CSSValueCustom.cpp | 2 | ||||
-rw-r--r-- | WebCore/bindings/v8/custom/V8DocumentCustom.cpp | 2 | ||||
-rw-r--r-- | WebCore/bindings/v8/custom/V8ElementCustom.cpp | 2 |
4 files changed, 19 insertions, 12 deletions
diff --git a/WebCore/Android.derived.v8bindings.mk b/WebCore/Android.derived.v8bindings.mk index 8f0da81..dd0a1bc 100644 --- a/WebCore/Android.derived.v8bindings.mk +++ b/WebCore/Android.derived.v8bindings.mk @@ -68,7 +68,6 @@ $(GEN): $(intermediates)/bindings/V8%.h : $(LOCAL_PATH)/css/%.idl $(js_binding_s $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) $(GEN:%.h=%.cpp) - # We also need the .cpp files, which are generated as side effects of the # above rules. Specifying this explicitly makes -j2 work. $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates)/bindings/%.h @@ -279,7 +278,7 @@ LOCAL_GENERATED_SOURCES += $(GEN) $(GEN:%.h=%.cpp) # above rules. Specifying this explicitly makes -j2 work. $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates)/bindings/%.h -# page +# Page GEN := \ $(intermediates)/bindings/V8BarInfo.h \ $(intermediates)/bindings/V8Connection.h \ @@ -356,24 +355,30 @@ LOCAL_GENERATED_SOURCES += $(GEN) $(GEN:%.h=%.cpp) $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates)/bindings/%.h # SVG -ifeq ($(ENABLE_SVG), true) +# These headers are required by the V8 bindings even when SVG is disabled GEN := \ + $(intermediates)/bindings/V8SVGColor.h \ + $(intermediates)/bindings/V8SVGDocument.h \ + $(intermediates)/bindings/V8SVGElement.h \ + $(intermediates)/bindings/V8SVGElementInstance.h \ + $(intermediates)/bindings/V8SVGException.h \ + $(intermediates)/bindings/V8SVGPaint.h \ + $(intermediates)/bindings/V8SVGZoomEvent.h + +ifeq ($(ENABLE_SVG), true) +GEN += \ $(intermediates)/bindings/V8SVGAElement.h \ $(intermediates)/bindings/V8SVGAltGlyphElement.h \ $(intermediates)/bindings/V8SVGAngle.h \ $(intermediates)/bindings/V8SVGCircleElement.h \ $(intermediates)/bindings/V8SVGClipPathElement.h \ - $(intermediates)/bindings/V8SVGColor.h \ $(intermediates)/bindings/V8SVGComponentTransferFunctionElement.h \ $(intermediates)/bindings/V8SVGCursorElement.h \ $(intermediates)/bindings/V8SVGDefsElement.h \ $(intermediates)/bindings/V8SVGDescElement.h \ - $(intermediates)/bindings/V8SVGDocument.h \ $(intermediates)/bindings/V8SVGElement.h \ - $(intermediates)/bindings/V8SVGElementInstance.h \ $(intermediates)/bindings/V8SVGElementInstanceList.h \ $(intermediates)/bindings/V8SVGEllipseElement.h \ - $(intermediates)/bindings/V8SVGException.h \ $(intermediates)/bindings/V8SVGFEBlendElement.h \ $(intermediates)/bindings/V8SVGFEColorMatrixElement.h \ $(intermediates)/bindings/V8SVGFEComponentTransferElement.h \ @@ -420,7 +425,6 @@ GEN := \ $(intermediates)/bindings/V8SVGMissingGlyphElement.h \ $(intermediates)/bindings/V8SVGNumber.h \ $(intermediates)/bindings/V8SVGNumberList.h \ - $(intermediates)/bindings/V8SVGPaint.h \ $(intermediates)/bindings/V8SVGPathElement.h \ $(intermediates)/bindings/V8SVGPathSeg.h \ $(intermediates)/bindings/V8SVGPathSegArcAbs.h \ @@ -473,7 +477,6 @@ GEN := \ $(intermediates)/bindings/V8SVGUnitTypes.h \ $(intermediates)/bindings/V8SVGUseElement.h \ $(intermediates)/bindings/V8SVGViewElement.h \ - $(intermediates)/bindings/V8SVGZoomEvent.h \ \ $(intermediates)/bindings/V8SVGAnimatedAngle.h \ $(intermediates)/bindings/V8SVGAnimatedEnumeration.h \ @@ -488,6 +491,7 @@ GEN := \ $(intermediates)/bindings/V8SVGAnimatedRect.h \ $(intermediates)/bindings/V8SVGAnimatedString.h \ $(intermediates)/bindings/V8SVGAnimatedTransformList.h +endif ifeq ($(ENABLE_SVG_ANIMATION), true) GEN += \ @@ -507,7 +511,6 @@ LOCAL_GENERATED_SOURCES += $(GEN) $(GEN:%.h=%.cpp) # We also need the .cpp files, which are generated as side effects of the # above rules. Specifying this explicitly makes -j2 work. $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates)/bindings/%.h -endif # Workers GEN := \ @@ -551,7 +554,6 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates) #end # HTML tag and attribute names - GEN:= $(intermediates)/HTMLNames.cpp $(intermediates)/HTMLNames.h $(intermediates)/HTMLElementFactory.cpp $(intermediates)/HTMLElementFactory.h $(intermediates)/V8HTMLElementWrapperFactory.cpp $(intermediates)/V8HTMLElementWrapperFactory.h $(GEN): PRIVATE_PATH := $(LOCAL_PATH) $(GEN): PRIVATE_CUSTOM_TOOL = perl -I $(PRIVATE_PATH)/bindings/scripts $< --tags $(PRIVATE_PATH)/html/HTMLTagNames.in --attrs $(PRIVATE_PATH)/html/HTMLAttributeNames.in --factory --wrapperFactoryV8 --output $(dir $@) @@ -560,7 +562,6 @@ $(GEN): $(LOCAL_PATH)/dom/make_names.pl $(LOCAL_PATH)/html/HTMLTagNames.in $(LOC LOCAL_GENERATED_SOURCES += $(GEN) # SVG tag and attribute names - ifeq ($(ENABLE_SVG), true) GEN:= $(intermediates)/SVGNames.cpp $(intermediates)/SVGNames.h $(intermediates)/SVGElementFactory.cpp $(intermediates)/SVGElementFactory.h $(intermediates)/V8SVGElementWrapperFactory.cpp $(intermediates)/V8SVGElementWrapperFactory.h SVG_FLAGS:=ENABLE_SVG_AS_IMAGE=1 ENABLE_SVG_FILTERS=1 ENABLE_SVG_FONTS=1 ENABLE_SVG_FOREIGN_OBJECT=1 ENABLE_SVG_USE=1 diff --git a/WebCore/bindings/v8/custom/V8CSSValueCustom.cpp b/WebCore/bindings/v8/custom/V8CSSValueCustom.cpp index 9e692ad..b06bc3c 100644 --- a/WebCore/bindings/v8/custom/V8CSSValueCustom.cpp +++ b/WebCore/bindings/v8/custom/V8CSSValueCustom.cpp @@ -49,10 +49,12 @@ v8::Handle<v8::Value> toV8(CSSValue* impl) return toV8(static_cast<CSSValueList*>(impl)); if (impl->isPrimitiveValue()) return toV8(static_cast<CSSPrimitiveValue*>(impl)); +#if ENABLE(SVG) if (impl->isSVGPaint()) return toV8(static_cast<SVGPaint*>(impl)); if (impl->isSVGColor()) return toV8(static_cast<SVGColor*>(impl)); +#endif return V8CSSValue::wrap(impl); } diff --git a/WebCore/bindings/v8/custom/V8DocumentCustom.cpp b/WebCore/bindings/v8/custom/V8DocumentCustom.cpp index bc8300c..7bf7e50 100644 --- a/WebCore/bindings/v8/custom/V8DocumentCustom.cpp +++ b/WebCore/bindings/v8/custom/V8DocumentCustom.cpp @@ -151,8 +151,10 @@ v8::Handle<v8::Value> toV8(Document* impl, bool forceNewObject) return v8::Null(); if (impl->isHTMLDocument()) return toV8(static_cast<HTMLDocument*>(impl), forceNewObject); +#if ENABLE(SVG) if (impl->isSVGDocument()) return toV8(static_cast<SVGDocument*>(impl), forceNewObject); +#endif v8::Handle<v8::Value> wrapper = V8Document::wrap(impl, forceNewObject); if (!V8IsolatedContext::getEntered()) { if (V8Proxy* proxy = V8Proxy::retrieve(impl->frame())) diff --git a/WebCore/bindings/v8/custom/V8ElementCustom.cpp b/WebCore/bindings/v8/custom/V8ElementCustom.cpp index b420f6a..a81e081 100644 --- a/WebCore/bindings/v8/custom/V8ElementCustom.cpp +++ b/WebCore/bindings/v8/custom/V8ElementCustom.cpp @@ -135,8 +135,10 @@ v8::Handle<v8::Value> toV8(Element* impl, bool forceNewObject) return v8::Null(); if (impl->isHTMLElement()) return toV8(static_cast<HTMLElement*>(impl), forceNewObject); +#if ENABLE(SVG) if (impl->isSVGElement()) return toV8(static_cast<SVGElement*>(impl), forceNewObject); +#endif return V8Element::wrap(impl, forceNewObject); } } // namespace WebCore |