Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: Source/bindings/v8/custom/V8DocumentCustom.cpp

Issue 15338005: Remove ENABLE(SVG) from bindings/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007-2009 Google Inc. All rights reserved. 2 * Copyright (C) 2007-2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 #include "core/dom/TouchList.h" 38 #include "core/dom/TouchList.h"
39 #include "core/html/canvas/CanvasRenderingContext.h" 39 #include "core/html/canvas/CanvasRenderingContext.h"
40 #include "core/page/Frame.h" 40 #include "core/page/Frame.h"
41 #include "core/xml/XPathNSResolver.h" 41 #include "core/xml/XPathNSResolver.h"
42 #include "core/xml/XPathResult.h" 42 #include "core/xml/XPathResult.h"
43 43
44 #include "V8CanvasRenderingContext2D.h" 44 #include "V8CanvasRenderingContext2D.h"
45 #include "V8DOMImplementation.h" 45 #include "V8DOMImplementation.h"
46 #include "V8HTMLDocument.h" 46 #include "V8HTMLDocument.h"
47 #include "V8Node.h" 47 #include "V8Node.h"
48 #include "V8SVGDocument.h"
48 #include "V8Touch.h" 49 #include "V8Touch.h"
49 #include "V8TouchList.h" 50 #include "V8TouchList.h"
50 #include "V8WebGLRenderingContext.h" 51 #include "V8WebGLRenderingContext.h"
51 #include "V8XPathNSResolver.h" 52 #include "V8XPathNSResolver.h"
52 #include "V8XPathResult.h" 53 #include "V8XPathResult.h"
53 #include "bindings/v8/V8Binding.h" 54 #include "bindings/v8/V8Binding.h"
54 #include "bindings/v8/V8DOMWindowShell.h" 55 #include "bindings/v8/V8DOMWindowShell.h"
55 #include "bindings/v8/V8DOMWrapper.h" 56 #include "bindings/v8/V8DOMWrapper.h"
56 #include "bindings/v8/custom/V8CustomXPathNSResolver.h" 57 #include "bindings/v8/custom/V8CustomXPathNSResolver.h"
57 58
58 #if ENABLE(SVG)
59 #include "V8SVGDocument.h"
60 #endif
61
62 #include "wtf/RefPtr.h" 59 #include "wtf/RefPtr.h"
63 60
64 namespace WebCore { 61 namespace WebCore {
65 62
66 v8::Handle<v8::Value> V8Document::evaluateMethodCustom(const v8::Arguments& args ) 63 v8::Handle<v8::Value> V8Document::evaluateMethodCustom(const v8::Arguments& args )
67 { 64 {
68 RefPtr<Document> document = V8Document::toNative(args.Holder()); 65 RefPtr<Document> document = V8Document::toNative(args.Holder());
69 ExceptionCode ec = 0; 66 ExceptionCode ec = 0;
70 String expression = toWebCoreString(args[0]); 67 String expression = toWebCoreString(args[0]);
71 RefPtr<Node> contextNode; 68 RefPtr<Node> contextNode;
(...skipping 14 matching lines...) Expand all
86 return setDOMException(ec, args.GetIsolate()); 83 return setDOMException(ec, args.GetIsolate());
87 84
88 return toV8Fast(result.release(), args, document.get()); 85 return toV8Fast(result.release(), args, document.get());
89 } 86 }
90 87
91 v8::Handle<v8::Object> wrap(Document* impl, v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate) 88 v8::Handle<v8::Object> wrap(Document* impl, v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate)
92 { 89 {
93 ASSERT(impl); 90 ASSERT(impl);
94 if (impl->isHTMLDocument()) 91 if (impl->isHTMLDocument())
95 return wrap(toHTMLDocument(impl), creationContext, isolate); 92 return wrap(toHTMLDocument(impl), creationContext, isolate);
96 #if ENABLE(SVG)
97 if (impl->isSVGDocument()) 93 if (impl->isSVGDocument())
98 return wrap(toSVGDocument(impl), creationContext, isolate); 94 return wrap(toSVGDocument(impl), creationContext, isolate);
99 #endif
100 v8::Handle<v8::Object> wrapper = V8Document::createWrapper(impl, creationCon text, isolate); 95 v8::Handle<v8::Object> wrapper = V8Document::createWrapper(impl, creationCon text, isolate);
101 if (wrapper.IsEmpty()) 96 if (wrapper.IsEmpty())
102 return wrapper; 97 return wrapper;
103 if (!isolatedWorldForEnteredContext()) { 98 if (!isolatedWorldForEnteredContext()) {
104 if (Frame* frame = impl->frame()) 99 if (Frame* frame = impl->frame())
105 frame->script()->windowShell(mainThreadNormalWorld())->updateDocumen tWrapper(wrapper); 100 frame->script()->windowShell(mainThreadNormalWorld())->updateDocumen tWrapper(wrapper);
106 } 101 }
107 return wrapper; 102 return wrapper;
108 } 103 }
109 104
110 v8::Handle<v8::Value> V8Document::createTouchListMethodCustom(const v8::Argument s& args) 105 v8::Handle<v8::Value> V8Document::createTouchListMethodCustom(const v8::Argument s& args)
111 { 106 {
112 RefPtr<TouchList> touchList = TouchList::create(); 107 RefPtr<TouchList> touchList = TouchList::create();
113 108
114 for (int i = 0; i < args.Length(); i++) { 109 for (int i = 0; i < args.Length(); i++) {
115 Touch* touch = V8DOMWrapper::isWrapperOfType(args[i], &V8Touch::info) ? V8Touch::toNative(args[i]->ToObject()) : 0; 110 Touch* touch = V8DOMWrapper::isWrapperOfType(args[i], &V8Touch::info) ? V8Touch::toNative(args[i]->ToObject()) : 0;
116 touchList->append(touch); 111 touchList->append(touch);
117 } 112 }
118 113
119 return toV8(touchList.release(), args.Holder(), args.GetIsolate()); 114 return toV8(touchList.release(), args.Holder(), args.GetIsolate());
120 } 115 }
121 116
122 } // namespace WebCore 117 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8CSSValueCustom.cpp ('k') | Source/bindings/v8/custom/V8ElementCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698