Skip to content

Commit

Permalink
Remove the non-standard image-url function
Browse files Browse the repository at this point in the history
  • Loading branch information
xzyfer committed Feb 16, 2015
1 parent 003d3dc commit c82c82b
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 32 deletions.
4 changes: 0 additions & 4 deletions constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ namespace Sass {
namespace Constants {
extern const int SPECIFICITY_BASE = 1000;

// hidden variable name for the image path (for the image-url built-in)
extern const char image_path_var[] = "$[image path]";

// sass keywords
extern const char at_root_kwd[] = "@at-root";
extern const char import_kwd[] = "@import";
Expand Down Expand Up @@ -70,7 +67,6 @@ namespace Sass {
extern const char only_kwd[] = "only";
extern const char rgb_kwd[] = "rgb(";
extern const char url_kwd[] = "url(";
extern const char image_url_kwd[] = "image-url(";
extern const char important_kwd[] = "important";
extern const char pseudo_not_kwd[] = ":not(";
extern const char even_kwd[] = "even";
Expand Down
5 changes: 1 addition & 4 deletions constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ namespace Sass {
namespace Constants {
extern const int SPECIFICITY_BASE;

// hidden variable name for the image path (for the image-url built-in)
extern const char image_path_var[];

// sass keywords
extern const char at_root_kwd[];
extern const char import_kwd[];
Expand Down Expand Up @@ -150,4 +147,4 @@ namespace Sass {
}
}

#endif
#endif
3 changes: 0 additions & 3 deletions context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ namespace Sass {
c_functions (vector<Sass_C_Function_Callback>()),
indent (initializers.indent()),
linefeed (initializers.linefeed()),
image_path (initializers.image_path()),
input_path (make_canonical_path(initializers.input_path())),
output_path (make_canonical_path(initializers.output_path())),
source_comments (initializers.source_comments()),
Expand Down Expand Up @@ -475,8 +474,6 @@ namespace Sass {
// Boolean Functions
register_function(ctx, not_sig, sass_not, env);
register_function(ctx, if_sig, sass_if, env);
// Path Functions
register_function(ctx, image_url_sig, image_url, env);
// Misc Functions
register_function(ctx, inspect_sig, inspect, env);
register_function(ctx, unique_id_sig, unique_id, env);
Expand Down
2 changes: 0 additions & 2 deletions context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ namespace Sass {

string indent; // String to be used for indentation
string linefeed; // String to be used for line feeds
string image_path; // for the image-url Sass function
string input_path; // for relative paths in src-map
string output_path; // for relative paths to the output
bool source_comments; // for inline debug comments in css output
Expand All @@ -87,7 +86,6 @@ namespace Sass {
KWD_ARG(Data, string, entry_point);
KWD_ARG(Data, string, input_path);
KWD_ARG(Data, string, output_path);
KWD_ARG(Data, string, image_path);
KWD_ARG(Data, string, indent);
KWD_ARG(Data, string, linefeed);
KWD_ARG(Data, const char*, include_paths_c_str);
Expand Down
6 changes: 1 addition & 5 deletions functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1494,11 +1494,7 @@ namespace Sass {
Signature image_url_sig = "image-url($path, $only-path: false, $cache-buster: false)";
BUILT_IN(image_url)
{
String_Constant* ipath = ARG("$path", String_Constant);
bool only_path = !ARG("$only-path", Expression)->is_false();
string full_path(quote(ctx.image_path + "/" + unquote(ipath->value()), '"'));
if (!only_path) full_path = "url(" + full_path + ")";
return new (ctx.mem) String_Constant(pstate, full_path);
error("`image_url` has been removed from libsass because it's not part of the Sass spec", pstate);
}

//////////////////////////
Expand Down
7 changes: 0 additions & 7 deletions sass_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ extern "C" {
// String to be used to for line feeds
const char* linefeed;

// For the image-url Sass function
char* image_path;

// Colon-separated list of paths
// Semicolon-separated on Windows
// Maybe use array interface instead?
Expand Down Expand Up @@ -327,7 +324,6 @@ extern "C" {
.source_map_embed(c_ctx->source_map_embed)
.source_map_contents(c_ctx->source_map_contents)
.omit_source_map_url(c_ctx->omit_source_map_url)
.image_path(safe_str(c_ctx->image_path))
.include_paths_c_str(c_ctx->include_path)
.importer(c_ctx->importer)
.include_paths_array(include_paths)
Expand Down Expand Up @@ -620,7 +616,6 @@ extern "C" {
if (ctx->error_file) free(ctx->error_file);
if (ctx->input_path) free(ctx->input_path);
if (ctx->output_path) free(ctx->output_path);
if (ctx->image_path) free(ctx->image_path);
if (ctx->include_path) free(ctx->include_path);
if (ctx->source_map_file) free(ctx->source_map_file);
free_string_array(ctx->included_files);
Expand All @@ -632,7 +627,6 @@ extern "C" {
ctx->error_file = 0;
ctx->input_path = 0;
ctx->output_path = 0;
ctx->image_path = 0;
ctx->include_path = 0;
ctx->source_map_file = 0;
ctx->included_files = 0;
Expand Down Expand Up @@ -678,7 +672,6 @@ extern "C" {
IMPLEMENT_SASS_OPTION_ACCESSOR(const char*, linefeed);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, input_path);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, output_path);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, image_path);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, include_path);
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, source_map_file);

Expand Down
4 changes: 1 addition & 3 deletions sass_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ ADDAPI const char* ADDCALL sass_option_get_indent (struct Sass_Options* options)
ADDAPI const char* ADDCALL sass_option_get_linefeed (struct Sass_Options* options);
ADDAPI const char* ADDCALL sass_option_get_input_path (struct Sass_Options* options);
ADDAPI const char* ADDCALL sass_option_get_output_path (struct Sass_Options* options);
ADDAPI const char* ADDCALL sass_option_get_image_path (struct Sass_Options* options);
ADDAPI const char* ADDCALL sass_option_get_include_path (struct Sass_Options* options);
ADDAPI const char* ADDCALL sass_option_get_source_map_file (struct Sass_Options* options);
ADDAPI Sass_C_Function_List ADDCALL sass_option_get_c_functions (struct Sass_Options* options);
Expand All @@ -88,7 +87,6 @@ ADDAPI void ADDCALL sass_option_set_indent (struct Sass_Options* options, const
ADDAPI void ADDCALL sass_option_set_linefeed (struct Sass_Options* options, const char* linefeed);
ADDAPI void ADDCALL sass_option_set_input_path (struct Sass_Options* options, const char* input_path);
ADDAPI void ADDCALL sass_option_set_output_path (struct Sass_Options* options, const char* output_path);
ADDAPI void ADDCALL sass_option_set_image_path (struct Sass_Options* options, const char* image_path);
ADDAPI void ADDCALL sass_option_set_include_path (struct Sass_Options* options, const char* include_path);
ADDAPI void ADDCALL sass_option_set_source_map_file (struct Sass_Options* options, const char* source_map_file);
ADDAPI void ADDCALL sass_option_set_c_functions (struct Sass_Options* options, Sass_C_Function_List c_functions);
Expand Down Expand Up @@ -121,4 +119,4 @@ ADDAPI void ADDCALL sass_option_push_include_path (struct Sass_Options* options,
} // __cplusplus defined.
#endif

#endif
#endif
2 changes: 0 additions & 2 deletions sass_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ extern "C" {
.source_map_embed(c_ctx->options.source_map_embed)
.source_map_contents(c_ctx->options.source_map_contents)
.omit_source_map_url(c_ctx->options.omit_source_map_url)
.image_path(safe_str(c_ctx->options.image_path))
.include_paths_c_str(c_ctx->options.include_paths)
.include_paths_array(0)
.include_paths(vector<string>())
Expand Down Expand Up @@ -205,7 +204,6 @@ extern "C" {
.source_map_embed(c_ctx->options.source_map_embed)
.source_map_contents(c_ctx->options.source_map_contents)
.omit_source_map_url(c_ctx->options.omit_source_map_url)
.image_path(safe_str(c_ctx->options.image_path))
.include_paths_c_str(c_ctx->options.include_paths)
.include_paths_array(0)
.include_paths(vector<string>())
Expand Down
2 changes: 0 additions & 2 deletions sass_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ struct sass_options {
// Colon-separated list of paths
// Semicolon-separated on Windows
const char* include_paths;
// For the image-url Sass function
const char* image_path;
// String to be used for indentation
const char* indent;
// String to be used to for line feeds
Expand Down

0 comments on commit c82c82b

Please sign in to comment.