Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / BUILD.gn
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/config/ui.gni")
6 import("//third_party/WebKit/Source/bindings/bindings.gni")
7 import("//third_party/WebKit/Source/bindings/core/v8/generated.gni")
8 import("//third_party/WebKit/Source/bindings/modules/modules.gni")
9 import("//third_party/WebKit/Source/bindings/modules/v8/generated.gni")
10 import("//third_party/WebKit/Source/bindings/scripts/scripts.gni")
11 import("//third_party/WebKit/Source/config.gni")
12 import("//third_party/WebKit/Source/core/core.gni")
13 import("//third_party/WebKit/Source/build/scripts/scripts.gni")
14 import("//third_party/WebKit/Source/platform/platform_generated.gni")
15
16 visibility = [ "//third_party/WebKit/Source/*" ]
17
18 rel_blink_core_gen_dir = rebase_path(blink_core_output_dir, root_build_dir)
19
20 # Compute the optimization level. The GYP code sets "optimize: max" which sets
21 # speed-over-size optimization for official builds on Windows only. The GN's
22 # build optimize_max config applies this optimization on all platforms, so
23 # compute how to modify the config list to duplicate the GYP behavior.
24 if (is_debug) {
25   core_config_remove = [ "//build/config/compiler:no_optimize" ]
26   core_config_add = core_config_remove  # NOP
27 } else {
28   core_config_remove = [ "//build/config/compiler:optimize" ]
29
30   if (is_win && is_official_build) {
31     core_config_add = [ "//build/config/compiler:optimize_max" ]
32   } else {
33     core_config_add = core_config_remove  # NOP
34   }
35 }
36
37 # Core targets also get wexit time destructors.
38 core_config_add += [ "//build/config/compiler:wexit_time_destructors" ]
39
40 config("core_include_dirs") {
41   include_dirs = [
42     "..",
43     "$root_gen_dir/blink",
44   ]
45   if (is_android && use_openmax_dl_fft) {
46     include_dirs += [ "//third_party/openmax_dl" ]
47   }
48 }
49
50 # GYP version: WebKit/Source/core/core.gyp:webcore_generated
51 source_set("generated") {
52   deps = [
53     ":make_core_generated",
54     ":prerequisites",
55     "inspector:protocol_sources",
56     "inspector:instrumentation_sources",
57     "//gin",
58     "//skia",
59     "//third_party/iccjpeg",
60     "//third_party/libpng",
61     "//third_party/libwebp",
62     "//third_party/libxml",
63     "//third_party/libxslt",
64     "//third_party/npapi",
65     "//third_party/qcms",
66     "//third_party/sqlite",
67     "//third_party/WebKit/Source/bindings/core/v8:bindings_core_v8_generated",
68     # FIXME: don't depend on bindings/modules http://crbug.com/358074
69     "//third_party/WebKit/Source/bindings/modules:bindings_modules_generated",
70     "//third_party/WebKit/Source/bindings/modules/v8:bindings_modules_generated",
71     "//third_party/WebKit/Source/platform:make_platform_generated",
72     "//third_party/WebKit/Source/wtf",
73     "//url",
74     "//v8",
75   ]
76 }
77
78 # GYP version: WebKit/Source/core/core.gyp:webcore_prerequisites
79 source_set("prerequisites") {
80   public_deps = [
81     "//third_party/WebKit/Source/wtf",
82     "//gpu/command_buffer/client:gles2_c_lib",
83     "//skia",
84     "//third_party/angle:translator",
85     "//third_party/iccjpeg",
86     "//third_party/libpng",
87     "//third_party/libwebp",
88     "//third_party/libxml",
89     "//third_party/libxslt",
90     "//third_party/npapi",
91     "//third_party/ots",
92     "//third_party/qcms",
93     "//third_party/sqlite",
94     "//third_party/zlib",
95     "//url",
96     "//v8",
97   ]
98   deps = [
99     ":make_core_generated",
100     "inspector:protocol_sources",
101     "inspector:instrumentation_sources",
102     "//third_party/WebKit/Source/bindings/core/v8:bindings_core_v8_generated",
103     # FIXME: don't depend on bindings_modules http://crbug.com/358074
104     "//third_party/WebKit/Source/bindings/modules/v8:bindings_modules_generated",
105     "//third_party/WebKit/Source/platform",
106   ]
107
108   public_configs = [
109     ":core_include_dirs",
110     "//third_party/WebKit/Source:config",
111     "//third_party/WebKit/Source:inside_blink",
112   ]
113
114   if (use_openmax_dl_fft) {
115     deps += [
116       "//third_party/openmax_dl/dl"
117     ]
118   }
119 }
120
121 # Note that this is a source set rather than a group, even though it has no
122 # sources. A group would implicitly forward all direct dependent configs
123 # through it, but we want to keep our internal targets' public_configs private
124 # and only forward some of them.
125 #
126 # GYP version: WebKit/Source/core/core.gyp:webcore
127 source_set("core") {
128   visibility = []  # Allow re-assignment of list.
129   visibility = [ "//third_party/WebKit/*" ]
130
131   configs -= core_config_remove
132   configs += core_config_add
133
134   public_deps = [
135     ":core_generated",
136     "//skia",
137     "//third_party/npapi",
138     "//third_party/qcms",
139     "//third_party/WebKit/Source/platform",
140     "//third_party/WebKit/Source/wtf",
141     "//url",
142     "//v8",
143   ]
144   deps = [
145     ":dom",
146     ":html",
147     ":remaining",
148     ":rendering",
149     ":svg",
150   ]
151
152   public_configs = [
153     ":core_include_dirs",
154   ]
155
156   # TODO(GYP) IPP libraries pkg-config. These seem to be experimental and used
157   # only on x86 Android. See also below. There should be one pkg-config call
158   # that creates a config used in both of these cases.
159 }
160
161 # GYP version: //third_party/WebKit/Source/core/core.gyp:webcore_dom
162 source_set("dom") {
163   sources = rebase_path(webcore_dom_files, ".", "//")
164
165   configs -= core_config_remove
166   configs += core_config_add
167
168   if (is_win) {
169     cflags = [ "/wd4267" ]  # size_t to int truncation.
170   }
171
172   deps = [
173     ":prerequisites",
174   ]
175 }
176
177 # GYP version: //third_party/WebKit/Source/core/core.gyp:webcore_html
178 source_set("html") {
179   sources = rebase_path(webcore_html_files, ".", "//")
180
181   configs -= core_config_remove
182   configs += core_config_add
183
184   deps = [
185     ":prerequisites",
186   ]
187
188   # TODO(GYP)
189   # Shard this target into parts to work around linker limitations.
190   # on link time code generation builds.
191   #['OS=="win" and buildtype=="Official"', {
192   #  'msvs_shard': 5,
193   #}],
194 }
195
196 # GYP version: //third_party/WebKit/Source/core/core.gyp:webcore_svg
197 source_set("svg") {
198   sources = rebase_path(webcore_svg_files, ".", "//")
199
200   configs -= core_config_remove
201   configs += core_config_add
202
203   deps = [
204     ":prerequisites",
205   ]
206
207   # TODO(GYP)
208   # Shard this taret into parts to work around linker limitations.
209   # on link time code generation builds.
210   #['OS=="win" and buildtype=="Official"', {
211   #  'msvs_shard': 5,
212   #}],
213 }
214
215 # GYP version: //third_party/WebKit/Source/core/core.gyp:webcore_remaining
216 source_set("remaining") {
217   # This is currently a mashup of "webcore_rendering" and "webcore_remaining"
218   # in GYP. The file list variable is the same and then GYP filters on wether
219   # the path starts with "rendering/" or not. We should tweak the .gypis a bit
220   # to separate out the rendering files.
221   sources = rebase_path(webcore_files, ".", "//")
222
223   configs -= core_config_remove
224   configs += core_config_add
225
226   cflags = []
227   libs = []
228
229   deps = [
230     ":prerequisites",
231   ]
232
233   if (is_win) {
234     cflags += [
235       "/wd4267",
236       "/wd4334",
237     ]
238   } else {  # !is_win
239     sources -= [
240       "rendering/RenderThemeChromiumFontProviderWin.cpp",
241     ]
242   }
243   if (!is_linux && !is_android) {
244     sources -= [
245       "rendering/RenderThemeChromiumFontProviderLinux.cpp",
246     ]
247   }
248
249   if (is_android) {
250     # Due to a bug in gcc 4.6 in android NDK, we got warnings about
251     # uninitialized variable.
252     # TODO: try removing now that we are on GCC 4.8.
253     cflags += [ "-Wno-uninitialized" ]
254   } else {  # !is_android
255     sources -= [
256       "rendering/RenderThemeChromiumAndroid.cpp",
257       "rendering/RenderThemeChromiumAndroid.h",
258     ]
259   }
260
261   if (is_mac) {
262     sources -= [
263       "rendering/RenderThemeChromiumFontProvider.cpp",
264       "rendering/RenderThemeChromiumFontProvider.h",
265       "rendering/RenderThemeChromiumSkia.cpp",
266       "rendering/RenderThemeChromiumSkia.h",
267     ]
268     libs += [ "Carbon.framework" ]
269     # Some Mac-specific parts of WebKit won't compile without having this
270     # prefix header injected.
271     cflags = [
272       "-include",
273       rebase_path("../build/mac/Prefix.h", root_build_dir),
274     ]
275   } else {  # !is_mac
276     sources -= [
277       "editing/SmartReplaceCF.cpp",
278     ]
279   }
280 }
281
282 # GYP version: //third_party/WebKit/Source/core/core.gyp:webcore_rendering
283 source_set("rendering") {
284   # The files that go here are currently in "remaining".
285 }
286
287 # GYP version: WebKit/Source/core/core.gyp:webcore_testing
288 source_set("testing") {
289   configs += [
290     "//third_party/WebKit/Source:inside_blink",
291     "//third_party/WebKit/Source:config",
292   ]
293
294   deps = [
295     ":core",
296     ":core_generated",
297   ]
298
299   sources = generated_core_testing_dictionary_files + webcore_testing_files
300   sources += [
301     "$bindings_core_v8_output_dir/V8DictionaryTest.cpp",
302     "$bindings_core_v8_output_dir/V8DictionaryTest.h",
303     "$bindings_core_v8_output_dir/V8GarbageCollectedScriptWrappable.cpp",
304     "$bindings_core_v8_output_dir/V8GarbageCollectedScriptWrappable.h",
305     "$bindings_core_v8_output_dir/V8GCObservation.cpp",
306     "$bindings_core_v8_output_dir/V8GCObservation.h",
307     "$bindings_core_v8_output_dir/V8PrivateScriptTest.cpp",
308     "$bindings_core_v8_output_dir/V8PrivateScriptTest.h",
309     "$bindings_core_v8_output_dir/V8TypeConversions.cpp",
310     "$bindings_core_v8_output_dir/V8TypeConversions.h",
311     "$bindings_core_v8_output_dir/V8UnionTypesTest.cpp",
312     "$bindings_core_v8_output_dir/V8UnionTypesTest.h",
313     "$bindings_core_v8_output_dir/V8Internals.cpp",
314     "$bindings_core_v8_output_dir/V8Internals.h",
315     "$bindings_core_v8_output_dir/V8InternalProfilers.cpp",
316     "$bindings_core_v8_output_dir/V8InternalProfilers.h",
317     "$bindings_core_v8_output_dir/V8InternalSettings.cpp",
318     "$bindings_core_v8_output_dir/V8InternalSettings.h",
319     "$bindings_core_v8_output_dir/V8InternalSettingsGenerated.cpp",
320     "$bindings_core_v8_output_dir/V8InternalSettingsGenerated.h",
321     "$bindings_core_v8_output_dir/V8InternalRuntimeFlags.cpp",
322     "$bindings_core_v8_output_dir/V8InternalRuntimeFlags.h",
323     "$bindings_core_v8_output_dir/V8LayerRect.cpp",
324     "$bindings_core_v8_output_dir/V8LayerRect.h",
325     "$bindings_core_v8_output_dir/V8LayerRectList.cpp",
326     "$bindings_core_v8_output_dir/V8LayerRectList.h",
327     "$bindings_core_v8_output_dir/V8RefCountedScriptWrappable.cpp",
328     "$bindings_core_v8_output_dir/V8RefCountedScriptWrappable.h",
329     "$bindings_core_v8_output_dir/V8InternalDictionary.cpp",
330     "$bindings_core_v8_output_dir/V8InternalDictionary.h",
331   ]
332 }
333
334 # GYP version: //third_party/WebKit/Source/core/core.gyp:webcore_generated
335 source_set("core_generated") {
336   sources = bindings_core_v8_files
337   # These files include all the .cpp files generated from the .idl files
338   # in webcore_files.
339   sources += bindings_core_generated_aggregate_files
340   sources += bindings_core_generated_union_type_files
341   # IDL dictionary impl files generated by IDL compiler
342   sources += generated_core_dictionary_files
343
344   sources += [
345     # Additional .cpp files for HashTools.h
346     "$blink_core_output_dir/CSSPropertyNames.cpp",
347     "$blink_core_output_dir/CSSValueKeywords.cpp",
348
349     # Additional .cpp files from make_core_generated actions.
350     "$blink_core_output_dir/Event.cpp",
351     "$blink_core_output_dir/EventHeaders.h",
352     "$blink_core_output_dir/EventNames.cpp",
353     "$blink_core_output_dir/EventNames.h",
354     "$blink_core_output_dir/EventTargetNames.cpp",
355     "$blink_core_output_dir/EventTargetNames.h",
356     "$blink_core_output_dir/EventTypeNames.cpp",
357     "$blink_core_output_dir/EventTypeNames.h",
358     "$blink_core_output_dir/FetchInitiatorTypeNames.cpp",
359     "$blink_core_output_dir/HTMLElementFactory.cpp",
360     "$blink_core_output_dir/HTMLElementFactory.h",
361     "$blink_core_output_dir/HTMLElementLookupTrie.cpp",
362     "$blink_core_output_dir/HTMLElementLookupTrie.h",
363     "$blink_core_output_dir/HTMLNames.cpp",
364     "$blink_core_output_dir/HTMLTokenizerNames.cpp",
365     "$blink_core_output_dir/InputTypeNames.cpp",
366     "$blink_core_output_dir/MathMLNames.cpp",
367     "$blink_core_output_dir/SVGNames.cpp",
368     "$blink_core_output_dir/UserAgentStyleSheetsData.cpp",
369     "$blink_core_output_dir/XLinkNames.cpp",
370     "$blink_core_output_dir/XMLNSNames.cpp",
371     "$blink_core_output_dir/XMLNames.cpp",
372
373     # Generated from HTMLEntityNames.in
374     "$blink_core_output_dir/HTMLEntityTable.cpp",
375
376     # Generated from MediaFeatureNames.in
377     "$blink_core_output_dir/MediaFeatureNames.cpp",
378
379     # Generated from MediaTypeNames.in
380     "$blink_core_output_dir/MediaTypeNames.cpp",
381
382     # Generated from BisonCSSTokenizer-in.cpp
383     "$blink_core_output_dir/BisonCSSTokenizer.cpp",
384
385     # Generated from BisonCSSParser-in.cpp
386     "$blink_core_output_dir/BisonCSSParser.cpp",
387
388     # Generated from HTMLMetaElement-in.cpp
389     "$blink_core_output_dir/HTMLMetaElement.cpp",
390
391     # Additional .cpp files from the make_core_generated rules.
392     "$blink_core_output_dir/CSSGrammar.cpp",
393     "$blink_core_output_dir/XPathGrammar.cpp",
394
395     # Additional .cpp files from the inspector_protocol_sources list.
396     "$blink_core_output_dir/InspectorFrontend.cpp",
397     "$blink_core_output_dir/InspectorBackendDispatcher.cpp",
398     "$blink_core_output_dir/InspectorTypeBuilder.cpp",
399
400     # Additional .cpp files from the inspector_instrumentation_sources list.
401     "$blink_core_output_dir/InspectorCanvasInstrumentationInl.h",
402     "$blink_core_output_dir/InspectorConsoleInstrumentationInl.h",
403     "$blink_core_output_dir/InspectorInstrumentationInl.h",
404     "$blink_core_output_dir/InspectorOverridesInl.h",
405     "$blink_core_output_dir/InstrumentingAgentsInl.h",
406     "$blink_core_output_dir/InspectorInstrumentationImpl.cpp",
407
408     # Additional .cpp files for SVG.
409     "$blink_core_output_dir/SVGElementFactory.cpp",
410
411     # Generated from make_style_shorthands.py
412     "$blink_core_output_dir/StylePropertyShorthand.cpp",
413
414     # Generated from make_style_builder.py
415     "$blink_core_output_dir/StyleBuilder.cpp",
416     "$blink_core_output_dir/StyleBuilderFunctions.cpp",
417
418     # Generated from make_css_property_metadata.py
419     "$blink_core_output_dir/CSSPropertyMetadata.cpp",
420   ]
421
422   configs -= core_config_remove
423   configs += core_config_add
424
425   configs += [
426     "..:inside_blink",
427   ]
428
429   deps = [
430     ":make_core_generated",
431     ":prerequisites",
432     "inspector:protocol_sources",
433     "inspector:instrumentation_sources",
434     "//gin",
435     "//skia",
436     "//third_party/iccjpeg",
437     "//third_party/libpng",
438     "//third_party/libwebp",
439     "//third_party/libxml",
440     "//third_party/libxslt",
441     "//third_party/npapi",
442     "//third_party/qcms",
443     "//third_party/sqlite",
444     "//third_party/WebKit/Source/bindings/core/v8:bindings_core_v8_generated",
445     # FIXME: don't depend on bindings/modules http://crbug.com/358074
446     "//third_party/WebKit/Source/bindings/modules:bindings_modules_generated",
447     "//third_party/WebKit/Source/bindings/modules/v8:bindings_modules_generated",
448     "//third_party/WebKit/Source/platform:make_platform_generated",
449     "//third_party/WebKit/Source/wtf",
450     "//url",
451     "//v8",
452   ]
453
454   configs += [ ":core_include_dirs" ]
455   include_dirs = [
456     "$root_gen_dir/blink",
457   ]
458
459   cflags = []
460   defines = []
461
462   if (is_win && component_mode == "shared_library") {
463     defines += [ "USING_V8_SHARED" ]
464   }
465
466   if (is_win) {
467     cflags += [
468       # In generated bindings code: "switch contains default but no case".
469       # Disable c4267 warnings until we fix size_t to int truncations.
470       # 4701 and 4702 are disabled because of issues in Bison-generated
471       # XPathGrammar.cpp and CSSGrammar.cpp.
472       "/wd4065",
473       "/wd4267",
474       "/wd4701",
475       "/wd4702",
476     ]
477   }
478
479   # TODO(GYP) More IPP libraries, see above.
480   #if ((is_linux || is_android) && use_webaudio_ipp)
481   #  ["OS in ("linux", "android") and "WTF_USE_WEBAUDIO_IPP=1" in feature_defines", {
482   #    "cflags": [
483   #      "<!@(pkg-config --cflags-only-I ipp)",
484   #    ],
485   #  }],
486   #],
487 }
488
489 # core_bindings_generated ------------------------------------------------------
490
491 # GYP version: WebKit/Source/core/core_generated.gyp:core_event_interfaces
492 generate_event_interfaces("core_event_interfaces") {
493   sources = core_event_idl_files
494   output_file = "core/EventInterfaces.in"
495 }
496
497 # generated_testing_idls -------------------------------------------------------
498
499 # GYP version: WebKit/Source/core/core_generated.gyp:generated_testing_idls
500 group("generated_testing_idls") {
501   deps = [
502     ":generated_testing_idls_settings",
503     ":generated_testing_idls_internal_runtime_flags",
504   ]
505 }
506
507 # "Settings" action in generated_testing_idls from GYP.
508 action("generated_testing_idls_settings") {
509   script = "../build/scripts/make_settings.py"
510
511   inputs = scripts_for_in_files + [
512     "../build/scripts/make_settings.py",
513     "../build/scripts/templates/InternalSettingsGenerated.idl.tmpl",
514     "../build/scripts/templates/InternalSettingsGenerated.cpp.tmpl",
515     "../build/scripts/templates/InternalSettingsGenerated.h.tmpl",
516     "../build/scripts/templates/SettingsMacros.h.tmpl",
517     "frame/Settings.in",
518   ]
519   outputs = [
520     "$blink_core_output_dir/SettingsMacros.h",
521     "$blink_core_output_dir/InternalSettingsGenerated.idl",
522     "$blink_core_output_dir/InternalSettingsGenerated.cpp",
523     "$blink_core_output_dir/InternalSettingsGenerated.h",
524   ]
525
526   args = [
527     rebase_path("frame/Settings.in", root_build_dir),
528     "--output_dir", rel_blink_core_gen_dir,
529   ]
530 }
531
532 # "InternalRuntimeFlags" action in generated_testing_idls from GYP.
533 action("generated_testing_idls_internal_runtime_flags") {
534   script = "../build/scripts/make_internal_runtime_flags.py"
535
536   inputs = scripts_for_in_files + [
537     "../build/scripts/make_internal_runtime_flags.py",
538     "../platform/RuntimeEnabledFeatures.in",
539     "../build/scripts/templates/InternalRuntimeFlags.h.tmpl",
540     "../build/scripts/templates/InternalRuntimeFlags.idl.tmpl",
541   ]
542   outputs = [
543     "$blink_core_output_dir/InternalRuntimeFlags.idl",
544     "$blink_core_output_dir/InternalRuntimeFlags.h",
545   ]
546
547   args = [
548     rebase_path("../platform/RuntimeEnabledFeatures.in", root_build_dir),
549     "--output_dir", rel_blink_core_gen_dir,
550   ]
551 }
552
553 # make_core_generated ----------------------------------------------------------
554
555 # GYP version: WebKit/Source/core/core_generated.gyp:make_core_generated
556 group("make_core_generated") {
557   deps = [
558     ":make_core_generated_private_script",
559     ":make_core_generated_private_script_for_testing",
560     ":make_core_generated_html_entity_table",
561     ":make_core_generated_css_property_names",
562     ":make_core_generated_css_tokenizer_codepoints",
563     ":make_core_generated_media_feature_names",
564     ":make_core_generated_media_features",
565     ":make_core_generated_media_type_names",
566     ":make_core_generated_style_property_shorthand",
567     ":make_core_generated_style_builder",
568     ":make_core_generated_css_value_keywords",
569     ":make_core_generated_html_element_factory",
570     ":make_core_generated_html_element_type_helpers",
571     ":make_core_generated_svg_names",
572     ":make_core_generated_svg_element_type_helpers",
573     ":make_core_generated_event_factory",
574     ":make_core_generated_event_names",
575     ":make_core_generated_event_target_names",
576     ":make_core_generated_math_ml_names",
577     ":make_core_generated_user_agent_style_sheets",
578     ":make_core_generated_fetch_initiator_type_names",
579     ":make_core_generated_event_type_names",
580     ":make_core_generated_html_tokenizer_names",
581     ":make_core_generated_input_type_names",
582     ":make_core_generated_xlink_names",
583     ":make_core_generated_xml_ns_names",
584     ":make_core_generated_xml_names",
585     ":make_core_generated_make_token_matcher",
586     ":make_core_generated_make_parser",
587     ":make_core_generated_make_token_matcher_for_viewport",
588     ":make_core_generated_html_element_lookup_trie",
589     ":make_core_generated_bison",
590   ]
591 }
592
593 # "CSSPropertyNames" in make_core_generated from GYP.
594 css_properties("make_core_generated_css_property_names") {
595   script = "../build/scripts/make_css_property_names.py"
596   outputs = [
597     "$blink_core_output_dir/CSSPropertyNames.cpp",
598     "$blink_core_output_dir/CSSPropertyNames.h",
599   ]
600 }
601
602 # "MediaFeatures" in make_core_generated from GYP.
603 process_in_files("make_core_generated_media_features") {
604   script = "../build/scripts/make_media_features.py"
605   in_files = [
606     "css/MediaFeatureNames.in",
607   ]
608   other_inputs = [
609     "../build/scripts/make_media_features.py",
610     "../build/scripts/templates/MediaFeatures.h.tmpl",
611   ]
612   outputs = [
613     "$blink_core_output_dir/MediaFeatures.h",
614   ]
615 }
616
617 # "StylePropertyShorthand" in make_core_generated from GYP.
618 css_properties("make_core_generated_style_property_shorthand") {
619   script = "../build/scripts/make_style_shorthands.py"
620   other_inputs = [
621     "../build/scripts/templates/StylePropertyShorthand.cpp.tmpl",
622     "../build/scripts/templates/StylePropertyShorthand.h.tmpl",
623   ]
624   outputs = [
625     "$blink_core_output_dir/StylePropertyShorthand.cpp",
626     "$blink_core_output_dir/StylePropertyShorthand.h",
627   ]
628 }
629
630 # "StyleBuilder" in make_core_generated from GYP.
631 css_properties("make_core_generated_style_builder") {
632   script = "../build/scripts/make_style_builder.py"
633   other_inputs = [
634     "../build/scripts/templates/StyleBuilder.cpp.tmpl",
635     "../build/scripts/templates/StyleBuilderFunctions.cpp.tmpl",
636     "../build/scripts/templates/StyleBuilderFunctions.h.tmpl",
637   ]
638   outputs = [
639     "$blink_core_output_dir/StyleBuilder.cpp",
640     "$blink_core_output_dir/StyleBuilderFunctions.h",
641     "$blink_core_output_dir/StyleBuilderFunctions.cpp",
642   ]
643 }
644
645 # "CSSPropertyMetadata" in make_core_generated from GYP.
646 css_properties("make_core_generated_css_property_metadata") {
647   script = "../build/scripts/make_css_property_metadata.py"
648   other_inputs = [
649     "../build/scripts/templates/CSSPropertyMetadata.cpp.tmpl",
650   ]
651   outputs = [
652     "$blink_core_output_dir/CSSPropertyMetadata.cpp",
653   ]
654 }
655
656 # "CSSValueKeywords" in make_core_generated from GYP.
657 process_in_files("make_core_generated_css_value_keywords") {
658   script = "../build/scripts/make_css_value_keywords.py"
659
660   in_files = [
661     "css/CSSValueKeywords.in",
662     "css/SVGCSSValueKeywords.in",
663   ]
664   outputs = [
665     "$blink_core_output_dir/CSSValueKeywords.cpp",
666     "$blink_core_output_dir/CSSValueKeywords.h",
667   ]
668   other_args = [
669     "--gperf", gperf_exe,
670   ]
671 }
672
673 # "HTMLElementFactory" in make_core_generated from GYP.
674 process_in_files("make_core_generated_html_element_factory") {
675   script = "../build/scripts/make_element_factory.py"
676
677   in_files = [
678     "html/HTMLTagNames.in",
679     "html/HTMLAttributeNames.in",
680   ]
681   other_inputs = make_element_factory_files
682   outputs = [
683     "$blink_core_output_dir/HTMLElementFactory.cpp",
684     "$blink_core_output_dir/HTMLElementFactory.h",
685     "$blink_core_output_dir/HTMLNames.cpp",
686     "$blink_core_output_dir/HTMLNames.h",
687   ]
688 }
689
690 # "HTMLElementTypeHelpers" in make_core_generated from GYP.
691 process_in_files("make_core_generated_html_element_type_helpers") {
692   script = "../build/scripts/make_element_type_helpers.py"
693
694   in_files = [
695     "html/HTMLTagNames.in",
696   ]
697   other_inputs = make_element_type_helpers_files
698   outputs = [
699     "$blink_core_output_dir/HTMLElementTypeHelpers.h",
700   ]
701 }
702
703 # "SVGNames" in make_core_generated from GYP.
704 process_in_files("make_core_generated_svg_names") {
705   script = "../build/scripts/make_element_factory.py"
706
707   in_files = [
708     "svg/SVGTagNames.in",
709     "svg/SVGAttributeNames.in",
710   ]
711   other_inputs = make_element_factory_files
712   outputs = [
713     "$blink_core_output_dir/SVGElementFactory.cpp",
714     "$blink_core_output_dir/SVGElementFactory.h",
715     "$blink_core_output_dir/SVGNames.cpp",
716     "$blink_core_output_dir/SVGNames.h",
717   ]
718 }
719
720 # "SVGElementTypeHelpers" in make_core_generated from GYP.
721 process_in_files("make_core_generated_svg_element_type_helpers") {
722   script = "../build/scripts/make_element_type_helpers.py"
723
724   in_files = [
725     "svg/SVGTagNames.in",
726   ]
727   other_inputs = make_element_type_helpers_files
728   outputs = [
729     "$blink_core_output_dir/SVGElementTypeHelpers.h",
730   ]
731 }
732
733 # make_event_factory -----------------------------------------------------------
734
735 # "EventFactory" in make_core_generated from GYP.
736 process_in_files("make_core_generated_event_factory") {
737   script = "../build/scripts/make_event_factory.py"
738
739   in_files = [
740     "$blink_core_output_dir/EventInterfaces.in",
741     "events/EventAliases.in",
742   ]
743   other_inputs = make_event_factory_files
744   outputs = [
745     "$blink_core_output_dir/Event.cpp",
746     "$blink_core_output_dir/EventHeaders.h",
747   ]
748 }
749
750 # make_names -------------------------------------------------------------------
751
752 # "MediaFeatureNames" in make_core_generated from GYP.
753 process_in_files("make_core_generated_media_feature_names") {
754   script = "../build/scripts/make_media_feature_names.py"
755   in_files = [
756     "css/MediaFeatureNames.in",
757   ]
758   other_inputs = make_names_files
759   outputs = [
760     "$blink_core_output_dir/MediaFeatureNames.cpp",
761     "$blink_core_output_dir/MediaFeatureNames.h",
762   ]
763 }
764
765 # "MediaTypeNames" in make_core_generated from GYP.
766 make_names("make_core_generated_media_type_names") {
767   in_files = [
768     "css/MediaTypeNames.in",
769   ]
770   outputs = [
771     "$blink_core_output_dir/MediaTypeNames.cpp",
772     "$blink_core_output_dir/MediaTypeNames.h",
773   ]
774 }
775
776 # "EventNames" in make_core_generated from GYP.
777 make_names("make_core_generated_event_names") {
778   in_files = [
779     "$blink_core_output_dir/EventInterfaces.in",
780   ]
781   outputs = [
782     "$blink_core_output_dir/EventNames.cpp",
783     "$blink_core_output_dir/EventNames.h",
784   ]
785 }
786
787 # "EventTargetNames" in make_core_generated from GYP.
788 make_names("make_core_generated_event_target_names") {
789   in_files = [
790     "events/EventTargetFactory.in",
791   ]
792   outputs = [
793     "$blink_core_output_dir/EventTargetNames.cpp",
794     "$blink_core_output_dir/EventTargetNames.h",
795   ]
796 }
797
798 # "FetchInitiatorTypeNames" in make_core_generated from GYP.
799 make_names("make_core_generated_fetch_initiator_type_names") {
800   in_files = [
801     "fetch/FetchInitiatorTypeNames.in",
802   ]
803   outputs = [
804     "$blink_core_output_dir/FetchInitiatorTypeNames.cpp",
805     "$blink_core_output_dir/FetchInitiatorTypeNames.h",
806   ]
807 }
808
809 # "EventTypeNames" in make_core_generated from GYP.
810 make_names("make_core_generated_event_type_names") {
811   in_files = [
812     "events/EventTypeNames.in",
813   ]
814   outputs = [
815     "$blink_core_output_dir/EventTypeNames.cpp",
816     "$blink_core_output_dir/EventTypeNames.h",
817   ]
818 }
819
820 # "HTMLTokenizerNames" in make_core_generated from GYP.
821 make_names("make_core_generated_html_tokenizer_names") {
822   in_files = [
823     "html/parser/HTMLTokenizerNames.in",
824   ]
825   outputs = [
826     "$blink_core_output_dir/HTMLTokenizerNames.cpp",
827     "$blink_core_output_dir/HTMLTokenizerNames.h",
828   ]
829 }
830
831 # "InputTypeNames" in make_core_generated from GYP.
832 make_names("make_core_generated_input_type_names") {
833   in_files = [
834     "html/forms/InputTypeNames.in",
835   ]
836   outputs = [
837     "$blink_core_output_dir/InputTypeNames.cpp",
838     "$blink_core_output_dir/InputTypeNames.h",
839   ]
840 }
841
842 # make_qualified_names ---------------------------------------------------------
843
844 # "MathMLNames" in make_core_generated from GYP.
845 make_qualified_names("make_core_generated_math_ml_names") {
846   in_files = [
847     "html/parser/MathMLTagNames.in",
848     "html/parser/MathMLAttributeNames.in",
849   ]
850   outputs = [
851     "$blink_core_output_dir/MathMLNames.cpp",
852     "$blink_core_output_dir/MathMLNames.h",
853   ]
854 }
855
856 # "XLinkNames" in make_core_generated from GYP.
857 make_qualified_names("make_core_generated_xlink_names") {
858   in_files = [
859     "svg/xlinkattrs.in",
860   ]
861   outputs = [
862     "$blink_core_output_dir/XLinkNames.cpp",
863     "$blink_core_output_dir/XLinkNames.h",
864   ]
865 }
866
867 # "XMLNSNames" in make_core_generated from GYP.
868 make_qualified_names("make_core_generated_xml_ns_names") {
869   in_files = [
870     "xml/xmlnsattrs.in",
871   ]
872   outputs = [
873     "$blink_core_output_dir/XMLNSNames.cpp",
874     "$blink_core_output_dir/XMLNSNames.h",
875   ]
876 }
877
878 # "XMLNames" in make_core_generated from GYP.
879 make_qualified_names("make_core_generated_xml_names") {
880   in_files = [
881     "xml/xmlattrs.in",
882   ]
883   outputs = [
884     "$blink_core_output_dir/XMLNames.cpp",
885     "$blink_core_output_dir/XMLNames.h",
886   ]
887 }
888
889 # make_token_matcher -----------------------------------------------------------
890
891 # "MakeTokenMatcher" in make_core_generated from GYP.
892 make_token_matcher("make_core_generated_make_token_matcher") {
893   input_file = "css/parser/BisonCSSTokenizer-in.cpp"
894   output_file = "$blink_core_output_dir/BisonCSSTokenizer.cpp"
895 }
896
897 # "MakeParser" in make_core_generated from GYP.
898 make_token_matcher("make_core_generated_make_parser") {
899   input_file = "css/parser/BisonCSSParser-in.cpp"
900   output_file = "$blink_core_output_dir/BisonCSSParser.cpp"
901 }
902
903 # "MakeTokenMatcherForViewport" in make_core_generated from GYP.
904 make_token_matcher("make_core_generated_make_token_matcher_for_viewport") {
905   input_file = "html/HTMLMetaElement-in.cpp"
906   output_file = "$blink_core_output_dir/HTMLMetaElement.cpp"
907 }
908
909 # One-off scripts --------------------------------------------------------------
910
911 # "generatePrivateScript" in make_core_generated from GYP.
912 # FIXME: The implementation of Blink-in-JS is not yet mature.
913 # You can use Blink-in-JS in your local experiment, but don't ship it.
914 # crbug.com/341031
915 action("make_core_generated_private_script") {
916   visibility = []  # Allow re-assignment of list.
917   visibility = [ ":make_core_generated" ]
918   script = "../build/scripts/make_private_script_source.py"
919
920   inputs = [
921     "../bindings/core/v8/PrivateScriptRunner.js",
922     "html/HTMLMarqueeElement.js",
923     "html/shadow/PluginPlaceholderElement.js",
924     "xml/DocumentXMLTreeViewer.js",
925   ]
926   outputs = [
927     "$blink_core_output_dir/PrivateScriptSources.h",
928   ]
929
930   args = rebase_path(outputs, root_build_dir)
931   args += rebase_path(inputs, root_build_dir)
932
933   deps = make_core_generated_deps
934 }
935
936 action("make_core_generated_private_script_for_testing") {
937   visibility = []  # Allow re-assignment of list.
938   visibility = [ ":make_core_generated" ]
939   script = "../build/scripts/make_private_script_source.py"
940
941   inputs = [
942       "testing/PartialPrivateScriptTest.js",
943       "testing/PrivateScriptTest.js",
944   ]
945   outputs = [
946     "$blink_core_output_dir/PrivateScriptSourcesForTesting.h",
947   ]
948
949   args = [ "--for-testing" ]
950   args += rebase_path(outputs, root_build_dir)
951   args += rebase_path(inputs, root_build_dir)
952
953   deps = make_core_generated_deps
954 }
955
956 # "HTMLEntityTable" in make_core_generated from GYP.
957 action("make_core_generated_html_entity_table") {
958   visibility = []  # Allow re-assignment of list.
959   visibility = [ ":make_core_generated" ]
960   script = "html/parser/create-html-entity-table"
961
962   inputs = [
963     "html/parser/HTMLEntityNames.in",
964   ]
965   outputs = [
966     "$blink_core_output_dir/HTMLEntityTable.cpp",
967   ]
968
969   args = [ "-o" ] + rebase_path(outputs, root_build_dir) 
970   args += rebase_path(inputs, root_build_dir)
971
972   deps = make_core_generated_deps
973 }
974
975 # "CSSTokenizerCodepoints" in make_core_generated from GYP.
976 action("make_core_generated_css_tokenizer_codepoints") {
977   visibility = []  # Allow re-assignment of list.
978   visibility = [ ":make_core_generated" ]
979   script = "../build/scripts/make_css_tokenizer_codepoints.py"
980
981   outputs = [
982     "$blink_core_output_dir/CSSTokenizerCodepoints.cpp",
983   ]
984
985   args = [
986     "--output_dir", rel_blink_core_gen_dir,
987   ]
988
989   deps = make_core_generated_deps
990 }
991
992 # "UserAgentStyleSheets" in make_core_generated from GYP.
993 action("make_core_generated_user_agent_style_sheets") {
994   visibility = []  # Allow re-assignment of list.
995   visibility = [ ":make_core_generated" ]
996   script = "../build/scripts/make-file-arrays.py"
997
998   inputs = [
999     "css/html.css",
1000     "css/quirks.css",
1001     "css/view-source.css",
1002     "css/themeChromium.css",
1003     "css/themeChromiumAndroid.css",
1004     "css/themeChromiumLinux.css",
1005     "css/themeChromiumSkia.css",
1006     "css/themeInputMultipleFields.css",
1007     "css/themeMac.css",
1008     "css/themeWin.css",
1009     "css/themeWinQuirks.css",
1010     "css/svg.css",
1011     "css/navigationTransitions.css",
1012     "css/mathml.css",
1013     "css/mediaControls.css",
1014     "css/mediaControlsAndroid.css",
1015     "css/fullscreen.css",
1016     "css/xhtmlmp.css",
1017     "css/viewportAndroid.css",
1018   ]
1019
1020   outputs = [
1021     "$blink_core_output_dir/UserAgentStyleSheets.h",
1022     "$blink_core_output_dir/UserAgentStyleSheetsData.cpp",
1023   ]
1024
1025   args =
1026     [ "--namespace", "blink" ] +
1027     [ "--out-h=" + rebase_path(outputs[0], root_build_dir) ] +
1028     [ "--out-cpp=" + rebase_path(outputs[1], root_build_dir) ] +
1029     rebase_path(inputs, root_build_dir)
1030
1031   deps = make_core_generated_deps
1032 }
1033
1034 # "HTMLElementLookupTrie" in make_core_generated from GYP.
1035 action("make_core_generated_html_element_lookup_trie") {
1036   visibility = []  # Allow re-assignment of list.
1037   visibility = [ ":make_core_generated" ]
1038   script = "../build/scripts/make_element_lookup_trie.py"
1039
1040   input_file = "html/HTMLTagNames.in"
1041   inputs = scripts_for_in_files + [
1042     input_file,
1043     "../build/scripts/templates/ElementLookupTrie.cpp.tmpl",
1044     "../build/scripts/templates/ElementLookupTrie.h.tmpl",
1045   ]
1046   outputs = [
1047     "$blink_core_output_dir/HTMLElementLookupTrie.cpp",
1048     "$blink_core_output_dir/HTMLElementLookupTrie.h",
1049   ]
1050
1051   args = [
1052     rebase_path(input_file, root_build_dir),
1053     "--output_dir", rel_blink_core_gen_dir,
1054   ]
1055
1056   deps = make_core_generated_deps
1057 }
1058
1059 # The bison rules from make_core_generated.
1060 action_foreach("make_core_generated_bison") {
1061   script = "../build/scripts/rule_bison.py"
1062   sources = [
1063     "css/parser/CSSGrammar.y",
1064     "xml/XPathGrammar.y",
1065   ]
1066   outputs = [
1067     "$blink_core_output_dir/{{source_name_part}}.cpp",
1068     "$blink_core_output_dir/{{source_name_part}}.h",
1069   ]
1070   args = [
1071     "{{source}}",
1072     rel_blink_core_gen_dir,
1073     bison_exe,
1074   ]
1075
1076   deps = make_core_generated_deps
1077 }