Skip to content

Commit

Permalink
Delete "image_url" function and "image_path" API
Browse files Browse the repository at this point in the history
This function doesn't currently exist in the Sass spec.
Fixes sassgh-489
  • Loading branch information
nschonni committed Oct 12, 2014
1 parent 6de03c6 commit e406c32
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 36 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 import_kwd[] = "@import";
extern const char mixin_kwd[] = "@mixin";
Expand Down Expand Up @@ -61,7 +58,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
3 changes: 0 additions & 3 deletions constants.hpp
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;

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

// sass keywords
extern const char import_kwd[];
extern const char mixin_kwd[];
Expand Down
3 changes: 0 additions & 3 deletions context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ namespace Sass {
style_sheets (map<string, Block*>()),
source_map (resolve_relative_path(initializers.output_path(), initializers.source_map_file(), get_cwd())),
c_functions (vector<Sass_C_Function_Descriptor>()),
image_path (initializers.image_path()),
output_path (make_canonical_path(initializers.output_path())),
source_comments (initializers.source_comments()),
output_style (initializers.output_style()),
Expand Down Expand Up @@ -433,8 +432,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);
}

void register_c_functions(Context& ctx, Env* env, Sass_C_Function_Descriptor* descrs)
Expand Down
2 changes: 0 additions & 2 deletions context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ namespace Sass {
SourceMap source_map;
vector<Sass_C_Function_Descriptor> c_functions;

string image_path; // for the image-url Sass function
string output_path; // for relative paths to the output
bool source_comments; // for inline debug comments in css output
Output_Style output_style; // output style for the generated css code
Expand All @@ -65,7 +64,6 @@ namespace Sass {
KWD_ARG(Data, const char*, source_c_str);
KWD_ARG(Data, string, entry_point);
KWD_ARG(Data, string, output_path);
KWD_ARG(Data, string, image_path);
KWD_ARG(Data, const char*, include_paths_c_str);
KWD_ARG(Data, const char**, include_paths_array);
KWD_ARG(Data, vector<string>, include_paths);
Expand Down
14 changes: 0 additions & 14 deletions functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1410,19 +1410,5 @@ namespace Sass {
}
}

////////////////
// URL FUNCTIONS
////////////////

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(path, position, full_path);
}

}
}
1 change: 0 additions & 1 deletion functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ namespace Sass {
extern Signature call_sig;
extern Signature not_sig;
extern Signature if_sig;
extern Signature image_url_sig;
extern Signature map_get_sig;
extern Signature map_merge_sig;
extern Signature map_remove_sig;
Expand Down
4 changes: 0 additions & 4 deletions sass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ extern "C" {
.source_map_file (c_ctx->source_map_file)
.omit_source_map_url (c_ctx->omit_source_map_url)

.image_path (c_ctx->image_path ?
c_ctx->image_path :
"")

.output_path (c_ctx->output_path ?
c_ctx->output_path :
"")
Expand Down
1 change: 0 additions & 1 deletion sass.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct Sass_Context {
bool source_comments;
const char* source_map_file;
bool omit_source_map_url;
const char* image_path;
const char* output_path;
const char* include_paths_string;
const char** include_paths_array;
Expand Down
2 changes: 0 additions & 2 deletions sass_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ extern "C" {
.source_comments(c_ctx->options.source_comments)
.source_map_file(safe_str(c_ctx->options.source_map_file))
.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 @@ -203,7 +202,6 @@ extern "C" {
.source_comments(c_ctx->options.source_comments)
.source_map_file(safe_str(c_ctx->options.source_map_file))
.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 @@ -32,8 +32,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;
// Precision for outputting fractional numbers
int precision;
};
Expand Down

0 comments on commit e406c32

Please sign in to comment.