Skip to content

Commit

Permalink
Revert of Add FontFaceDescriptors IDL dictionary (patchset #4 id:6000…
Browse files Browse the repository at this point in the history
…1 of https://codereview.chromium.org/481453003/)

Reason for revert:
Broke build

http://build.chromium.org/p/chromium.webkit/builders/GPU%20Mac%20Builder/builds/19956

Original issue's description:
> Add FontFaceDescriptors IDL dictionary
> 
> To follow the spec[1]. This is the first place to use IDL dictionary
> execept for testing, so this CL also includes build related changes.
> Existing tests(e.g. fast/css/fontface-constructor-error.html) should
> cover this change.
> 
> [1] http://dev.w3.org/csswg/css-font-loading/#fontface-interface
> 
> BUG=403150
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181610

[email protected],[email protected],[email protected]
NOTREECHECKS=true
NOTRY=true
BUG=403150

Review URL: https://codereview.chromium.org/551873004

git-svn-id: svn://svn.chromium.org/blink/trunk@181612 bbb929c8-8fbe-4397-9dbb-9b2b20218538
  • Loading branch information
[email protected] committed Sep 9, 2014
1 parent 51269ba commit 3a37bcd
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 67 deletions.
8 changes: 2 additions & 6 deletions Source/bindings/core/idl.gni
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,20 @@ import("//third_party/WebKit/Source/core/core.gni")
# Don't actually read idl.gypi since that just defines variables in terms of
# others, which gypi_to_gn doesn't handle.

core_definition_idl_files =
core_dictionary_idl_files +
core_idl_files

core_testing_definition_idl_files =
core_testing_dictionary_idl_files +
webcore_testing_idl_files

# IDL file lists; see: http://www.chromium.org/developers/web-idl-interfaces
# Interface IDL files: generate individual bindings (includes testing)
core_interface_idl_files =
core_definition_idl_files +
core_idl_files +
core_testing_definition_idl_files +
generated_webcore_testing_idl_files

# Static IDL files
core_static_interface_idl_files =
core_definition_idl_files +
core_idl_files +
core_testing_definition_idl_files
core_static_dependency_idl_files =
core_dependency_idl_files +
Expand Down
12 changes: 4 additions & 8 deletions Source/bindings/core/idl.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
],

'variables': {
'core_definition_idl_files': [
'<@(core_dictionary_idl_files)',
'<@(core_idl_files)',
],
'core_testing_definition_idl_files': [
'<@(core_testing_dictionary_idl_files)',
'<@(webcore_testing_idl_files)',
Expand All @@ -23,15 +19,15 @@
# IDL file lists; see: http://www.chromium.org/developers/web-idl-interfaces
# Interface IDL files: generate individual bindings (includes testing)
'core_interface_idl_files': [
'<@(core_definition_idl_files)',
'<@(core_idl_files)',
'<@(core_testing_definition_idl_files)',
'<@(generated_webcore_testing_idl_files)',
],

# Write lists of main IDL files to a file, so that the command lines don't
# exceed OS length limits.
'core_idl_files_list': '<|(core_idl_files_list.tmp <@(core_definition_idl_files))',
'core_dictionary_idl_files_list': '<|(core_dictionary_idl_files_list.tmp <@(core_dictionary_idl_files) <@(core_testing_dictionary_idl_files))',
'core_idl_files_list': '<|(core_idl_files_list.tmp <@(core_idl_files))',
'core_dictionary_idl_files_list': '<|(core_dictionary_idl_files_list.tmp <@(core_testing_dictionary_idl_files))',

# Dependency IDL files: don't generate individual bindings, but do process
# in IDL dependency computation, and count as build dependencies
Expand Down Expand Up @@ -62,7 +58,7 @@

# Static IDL files
'core_static_interface_idl_files': [
'<@(core_definition_idl_files)',
'<@(core_idl_files)',
'<@(core_testing_definition_idl_files)',
],
'core_static_dependency_idl_files': [
Expand Down
11 changes: 7 additions & 4 deletions Source/bindings/core/v8/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ group("bindings_core_v8_generated") {

# bindings_core_generated_aggregate in Source/bindings/core/v8/generated.gyp
aggregate_generated_bindings("bindings_core_v8_generated_aggregate") {
sources = core_definition_idl_files
sources = core_idl_files
component_dir = "core"
outputs = bindings_core_generated_aggregate_files
}
Expand All @@ -34,7 +34,10 @@ idl_compiler("bindings_core_v8_generated_individual") {

# bindings_core_dictionary_impl_generated in Source/bindings/core/v8/generated.gyp
idl_dictionary("bindings_core_dictionary_impl_generated") {
sources = core_dictionary_idl_files + core_testing_dictionary_idl_files
outputs = generated_core_dictionary_files +
generated_core_testing_dictionary_files
# FIXME: Add 'core_dictionary_idl_files' to sources
# See comment on core/core.gypi
sources = core_testing_dictionary_idl_files
# FIXME: Add 'generated_core_dictionary_files' to outputs
# See comment on core/core.gypi
outputs = generated_core_testing_dictionary_files
}
6 changes: 4 additions & 2 deletions Source/bindings/core/v8/generated.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@
'../../modules/generated.gyp:interfaces_info',
],
'sources': [
'<@(core_dictionary_idl_files)',
# FIXME: Add '<@(core_dictionary_idl_files)',
# See comment on core/core.gypi
'<@(core_testing_dictionary_idl_files)',
],
'actions': [{
Expand All @@ -148,7 +149,8 @@
'<(bindings_modules_output_dir)/InterfacesInfoModules.pickle',
],
'outputs': [
'<@(generated_core_dictionary_files)',
# FIXME: Add '<@(generated_core_dictionary_files)',
# See comment on core/core.gypi
'<@(generated_core_testing_dictionary_files)',
],
'action': [
Expand Down
2 changes: 0 additions & 2 deletions Source/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,6 @@ source_set("core_generated") {
# These files include all the .cpp files generated from the .idl files
# in webcore_files.
sources += bindings_core_generated_aggregate_files
# IDL dictionary impl files generated by IDL compiler
sources += generated_core_dictionary_files

sources += [
# Additional .cpp files for HashTools.h
Expand Down
4 changes: 0 additions & 4 deletions Source/core/core.gni
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ _gypi = exec_script(
# Files for which bindings (.cpp and .h files) will be generated.
core_idl_files = get_path_info(_gypi.core_idl_files, "abspath")

core_dictionary_idl_files =
get_path_info(_gypi.core_dictionary_idl_files, "abspath")
core_testing_dictionary_idl_files =
get_path_info(_gypi.core_testing_dictionary_idl_files, "abspath")

Expand All @@ -39,8 +37,6 @@ webcore_testing_idl_files =
get_path_info(_gypi.webcore_testing_idl_files, "abspath")
webcore_testing_dependency_idl_files =
get_path_info(_gypi.webcore_testing_dependency_idl_files, "abspath")
generated_core_dictionary_files =
get_path_info(_gypi.generated_core_dictionary_files, "abspath")
generated_core_testing_dictionary_files =
get_path_info(_gypi.generated_core_testing_dictionary_files, "abspath")
generated_webcore_testing_idl_files =
Expand Down
3 changes: 2 additions & 1 deletion Source/core/core.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@
'<(blink_core_output_dir)/CSSPropertyMetadata.cpp',

# IDL dictionary impl files generated by IDL compiler
'<@(generated_core_dictionary_files)',
# FIXME: Add '<@(generated_core_dictionary_files)',
# See comment on core/core.gypi
],
'conditions': [
['OS=="win" and component=="shared_library"', {
Expand Down
19 changes: 12 additions & 7 deletions Source/core/core.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -3336,13 +3336,18 @@
'svg/properties/SVGAnimatedProperty.cpp',
'svg/properties/SVGPropertyTearOff.cpp',
],
'core_dictionary_idl_files': [
'css/FontFaceDescriptors.idl',
],
'generated_core_dictionary_files': [
'<(blink_core_output_dir)/css/FontFaceDescriptors.cpp',
'<(blink_core_output_dir)/css/FontFaceDescriptors.h',
],
# FIXME: http://crbug.com/403150
# Add 'core_dictionary_idl_files' and
# 'generated_core_dictionary_files' variables.
# The variables should contain IDL dictionary files and generated files
# They would look like below:
# 'core_dictionary_idl_files': [
# 'css/FontFaceDescriptors.idl',
# ],
# 'generated_core_dictionary_files': [
# '<(blink_core_output_dir)/css/FontFaceDescriptors.cpp',
# '<(blink_core_output_dir)/css/FontFaceDescriptors.h',
# ],
'core_testing_dictionary_idl_files': [
'testing/InternalDictionary.idl',
],
Expand Down
29 changes: 18 additions & 11 deletions Source/core/css/FontFace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "config.h"
#include "core/css/FontFace.h"

#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/ScriptState.h"
#include "core/CSSValueKeywords.h"
Expand All @@ -41,7 +42,6 @@
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSUnicodeRangeValue.h"
#include "core/css/CSSValueList.h"
#include "core/css/FontFaceDescriptors.h"
#include "core/css/LocalFontFaceSource.h"
#include "core/css/RemoteFontFaceSource.h"
#include "core/css/StylePropertySet.h"
Expand Down Expand Up @@ -70,7 +70,7 @@ static PassRefPtrWillBeRawPtr<CSSValue> parseCSSValue(const Document* document,
return parsedStyle->getPropertyCSSValue(propertyID);
}

PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, const String& source, const FontFaceDescriptors* descriptors)
PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, const String& source, const Dictionary& descriptors)
{
RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(context, family, descriptors));

Expand All @@ -82,14 +82,14 @@ PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con
return fontFace.release();
}

PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, PassRefPtr<ArrayBuffer> source, const FontFaceDescriptors* descriptors)
PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, PassRefPtr<ArrayBuffer> source, const Dictionary& descriptors)
{
RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(context, family, descriptors));
fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->data()), source->byteLength());
return fontFace.release();
}

PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, PassRefPtr<ArrayBufferView> source, const FontFaceDescriptors* descriptors)
PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, PassRefPtr<ArrayBufferView> source, const Dictionary& descriptors)
{
RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(context, family, descriptors));
fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->baseAddress()), source->byteLength());
Expand Down Expand Up @@ -130,17 +130,24 @@ FontFace::FontFace()
{
}

FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const FontFaceDescriptors* descriptors)
FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const Dictionary& descriptors)
: m_family(family)
, m_status(Unloaded)
{
Document* document = toDocument(context);
setPropertyFromString(document, descriptors->style(), CSSPropertyFontStyle);
setPropertyFromString(document, descriptors->weight(), CSSPropertyFontWeight);
// FIXME: we don't implement 'font-strech' property yet so we can't set the property.
setPropertyFromString(document, descriptors->unicodeRange(), CSSPropertyUnicodeRange);
setPropertyFromString(document, descriptors->variant(), CSSPropertyFontVariant);
setPropertyFromString(document, descriptors->featureSettings(), CSSPropertyWebkitFontFeatureSettings);
String value;
if (DictionaryHelper::get(descriptors, "style", value))
setPropertyFromString(document, value, CSSPropertyFontStyle);
if (DictionaryHelper::get(descriptors, "weight", value))
setPropertyFromString(document, value, CSSPropertyFontWeight);
if (DictionaryHelper::get(descriptors, "stretch", value))
setPropertyFromString(document, value, CSSPropertyFontStretch);
if (DictionaryHelper::get(descriptors, "unicodeRange", value))
setPropertyFromString(document, value, CSSPropertyUnicodeRange);
if (DictionaryHelper::get(descriptors, "variant", value))
setPropertyFromString(document, value, CSSPropertyFontVariant);
if (DictionaryHelper::get(descriptors, "featureSettings", value))
setPropertyFromString(document, value, CSSPropertyWebkitFontFeatureSettings);
}

FontFace::~FontFace()
Expand Down
9 changes: 4 additions & 5 deletions Source/core/css/FontFace.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class CSSValueList;
class Dictionary;
class Document;
class ExceptionState;
class FontFaceDescriptors;
class StylePropertySet;
class StyleRuleFontFace;

Expand All @@ -58,9 +57,9 @@ class FontFace : public RefCountedWillBeGarbageCollectedFinalized<FontFace>, pub
public:
enum LoadStatus { Unloaded, Loading, Loaded, Error };

static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, PassRefPtr<ArrayBuffer> source, const FontFaceDescriptors*);
static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, PassRefPtr<ArrayBufferView>, const FontFaceDescriptors*);
static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, const String& source, const FontFaceDescriptors*);
static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, PassRefPtr<ArrayBuffer> source, const Dictionary&);
static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, PassRefPtr<ArrayBufferView>, const Dictionary&);
static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, const String& source, const Dictionary&);
static PassRefPtrWillBeRawPtr<FontFace> create(Document*, const StyleRuleFontFace*);

~FontFace();
Expand Down Expand Up @@ -109,7 +108,7 @@ class FontFace : public RefCountedWillBeGarbageCollectedFinalized<FontFace>, pub

private:
FontFace();
FontFace(ExecutionContext*, const AtomicString& family, const FontFaceDescriptors*);
FontFace(ExecutionContext*, const AtomicString& family, const Dictionary& descriptors);

void initCSSFontFace(Document*, PassRefPtrWillBeRawPtr<CSSValue> src);
void initCSSFontFace(const unsigned char* data, unsigned size);
Expand Down
6 changes: 3 additions & 3 deletions Source/core/css/FontFace.idl
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ enum FontFaceLoadStatus {

[
// FIXME: should be union type http://crbug.com/240176
Constructor(DOMString family, DOMString source, optional FontFaceDescriptors descriptors),
Constructor(DOMString family, ArrayBuffer source, optional FontFaceDescriptors descriptors),
Constructor(DOMString family, ArrayBufferView source, optional FontFaceDescriptors descriptors),
Constructor(DOMString family, DOMString source, optional Dictionary descriptors),
Constructor(DOMString family, ArrayBuffer source, optional Dictionary descriptors),
Constructor(DOMString family, ArrayBufferView source, optional Dictionary descriptors),
ConstructorCallWith=ExecutionContext,
WillBeGarbageCollected,
] interface FontFace {
Expand Down
14 changes: 0 additions & 14 deletions Source/core/css/FontFaceDescriptors.idl

This file was deleted.

0 comments on commit 3a37bcd

Please sign in to comment.