From c82c82bf6f92369cf619c8f0c8b401f0e2b96eee Mon Sep 17 00:00:00 2001 From: xzyfer Date: Mon, 12 Jan 2015 15:46:24 +1100 Subject: [PATCH] Remove the non-standard image-url function --- constants.cpp | 4 ---- constants.hpp | 5 +---- context.cpp | 3 --- context.hpp | 2 -- functions.cpp | 6 +----- sass_context.cpp | 7 ------- sass_context.h | 4 +--- sass_interface.cpp | 2 -- sass_interface.h | 2 -- 9 files changed, 3 insertions(+), 32 deletions(-) diff --git a/constants.cpp b/constants.cpp index d9837681c0..dbddebb413 100644 --- a/constants.cpp +++ b/constants.cpp @@ -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"; @@ -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"; diff --git a/constants.hpp b/constants.hpp index 77dd629403..9036ea035e 100644 --- a/constants.hpp +++ b/constants.hpp @@ -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[]; @@ -150,4 +147,4 @@ namespace Sass { } } -#endif \ No newline at end of file +#endif diff --git a/context.cpp b/context.cpp index 9777bc9fa0..664898f9fb 100644 --- a/context.cpp +++ b/context.cpp @@ -55,7 +55,6 @@ namespace Sass { c_functions (vector()), 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()), @@ -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); diff --git a/context.hpp b/context.hpp index 113a495916..8ff8427cb5 100644 --- a/context.hpp +++ b/context.hpp @@ -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 @@ -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); diff --git a/functions.cpp b/functions.cpp index ecf4f482d7..6f8d7d21ac 100644 --- a/functions.cpp +++ b/functions.cpp @@ -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); } ////////////////////////// diff --git a/sass_context.cpp b/sass_context.cpp index cdbdfaf591..af1faa84e3 100644 --- a/sass_context.cpp +++ b/sass_context.cpp @@ -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? @@ -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) @@ -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); @@ -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; @@ -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); diff --git a/sass_context.h b/sass_context.h index 3d5b95f201..96c5be80b8 100644 --- a/sass_context.h +++ b/sass_context.h @@ -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); @@ -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); @@ -121,4 +119,4 @@ ADDAPI void ADDCALL sass_option_push_include_path (struct Sass_Options* options, } // __cplusplus defined. #endif -#endif \ No newline at end of file +#endif diff --git a/sass_interface.cpp b/sass_interface.cpp index 8f39d7a664..ceb0d1de6a 100644 --- a/sass_interface.cpp +++ b/sass_interface.cpp @@ -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()) @@ -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()) diff --git a/sass_interface.h b/sass_interface.h index 402dfd9577..c8d9457e4a 100644 --- a/sass_interface.h +++ b/sass_interface.h @@ -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