Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit cbf718f

Browse files
committed
Remove the non-standard image-url function
1 parent 196e12f commit cbf718f

File tree

9 files changed

+3
-32
lines changed

9 files changed

+3
-32
lines changed

constants.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ namespace Sass {
44
namespace Constants {
55
extern const int SPECIFICITY_BASE = 1000;
66

7-
// hidden variable name for the image path (for the image-url built-in)
8-
extern const char image_path_var[] = "$[image path]";
9-
107
// sass keywords
118
extern const char at_root_kwd[] = "@at-root";
129
extern const char import_kwd[] = "@import";
@@ -70,7 +67,6 @@ namespace Sass {
7067
extern const char only_kwd[] = "only";
7168
extern const char rgb_kwd[] = "rgb(";
7269
extern const char url_kwd[] = "url(";
73-
extern const char image_url_kwd[] = "image-url(";
7470
extern const char important_kwd[] = "important";
7571
extern const char pseudo_not_kwd[] = ":not(";
7672
extern const char even_kwd[] = "even";

constants.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ namespace Sass {
55
namespace Constants {
66
extern const int SPECIFICITY_BASE;
77

8-
// hidden variable name for the image path (for the image-url built-in)
9-
extern const char image_path_var[];
10-
118
// sass keywords
129
extern const char at_root_kwd[];
1310
extern const char import_kwd[];
@@ -150,4 +147,4 @@ namespace Sass {
150147
}
151148
}
152149

153-
#endif
150+
#endif

context.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ namespace Sass {
5555
c_functions (vector<Sass_C_Function_Callback>()),
5656
indent (initializers.indent()),
5757
linefeed (initializers.linefeed()),
58-
image_path (initializers.image_path()),
5958
input_path (make_canonical_path(initializers.input_path())),
6059
output_path (make_canonical_path(initializers.output_path())),
6160
source_comments (initializers.source_comments()),
@@ -475,8 +474,6 @@ namespace Sass {
475474
// Boolean Functions
476475
register_function(ctx, not_sig, sass_not, env);
477476
register_function(ctx, if_sig, sass_if, env);
478-
// Path Functions
479-
register_function(ctx, image_url_sig, image_url, env);
480477
// Misc Functions
481478
register_function(ctx, inspect_sig, inspect, env);
482479
register_function(ctx, unique_id_sig, unique_id, env);

context.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ namespace Sass {
6161

6262
string indent; // String to be used for indentation
6363
string linefeed; // String to be used for line feeds
64-
string image_path; // for the image-url Sass function
6564
string input_path; // for relative paths in src-map
6665
string output_path; // for relative paths to the output
6766
bool source_comments; // for inline debug comments in css output
@@ -87,7 +86,6 @@ namespace Sass {
8786
KWD_ARG(Data, string, entry_point);
8887
KWD_ARG(Data, string, input_path);
8988
KWD_ARG(Data, string, output_path);
90-
KWD_ARG(Data, string, image_path);
9189
KWD_ARG(Data, string, indent);
9290
KWD_ARG(Data, string, linefeed);
9391
KWD_ARG(Data, const char*, include_paths_c_str);

functions.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,11 +1502,7 @@ namespace Sass {
15021502
Signature image_url_sig = "image-url($path, $only-path: false, $cache-buster: false)";
15031503
BUILT_IN(image_url)
15041504
{
1505-
String_Constant* ipath = ARG("$path", String_Constant);
1506-
bool only_path = !ARG("$only-path", Expression)->is_false();
1507-
string full_path(quote(ctx.image_path + "/" + unquote(ipath->value()), '"'));
1508-
if (!only_path) full_path = "url(" + full_path + ")";
1509-
return new (ctx.mem) String_Constant(pstate, full_path);
1505+
error("`image_url` has been removed from libsass because it's not part of the Sass spec", pstate);
15101506
}
15111507

15121508
//////////////////////////

sass_context.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ extern "C" {
7575
// String to be used to for line feeds
7676
const char* linefeed;
7777

78-
// For the image-url Sass function
79-
char* image_path;
80-
8178
// Colon-separated list of paths
8279
// Semicolon-separated on Windows
8380
// Maybe use array interface instead?
@@ -327,7 +324,6 @@ extern "C" {
327324
.source_map_embed(c_ctx->source_map_embed)
328325
.source_map_contents(c_ctx->source_map_contents)
329326
.omit_source_map_url(c_ctx->omit_source_map_url)
330-
.image_path(safe_str(c_ctx->image_path))
331327
.include_paths_c_str(c_ctx->include_path)
332328
.importer(c_ctx->importer)
333329
.include_paths_array(include_paths)
@@ -620,7 +616,6 @@ extern "C" {
620616
if (ctx->error_file) free(ctx->error_file);
621617
if (ctx->input_path) free(ctx->input_path);
622618
if (ctx->output_path) free(ctx->output_path);
623-
if (ctx->image_path) free(ctx->image_path);
624619
if (ctx->include_path) free(ctx->include_path);
625620
if (ctx->source_map_file) free(ctx->source_map_file);
626621
free_string_array(ctx->included_files);
@@ -632,7 +627,6 @@ extern "C" {
632627
ctx->error_file = 0;
633628
ctx->input_path = 0;
634629
ctx->output_path = 0;
635-
ctx->image_path = 0;
636630
ctx->include_path = 0;
637631
ctx->source_map_file = 0;
638632
ctx->included_files = 0;
@@ -678,7 +672,6 @@ extern "C" {
678672
IMPLEMENT_SASS_OPTION_ACCESSOR(const char*, linefeed);
679673
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, input_path);
680674
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, output_path);
681-
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, image_path);
682675
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, include_path);
683676
IMPLEMENT_SASS_OPTION_STRING_ACCESSOR(const char*, source_map_file);
684677

sass_context.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ ADDAPI const char* ADDCALL sass_option_get_indent (struct Sass_Options* options)
7070
ADDAPI const char* ADDCALL sass_option_get_linefeed (struct Sass_Options* options);
7171
ADDAPI const char* ADDCALL sass_option_get_input_path (struct Sass_Options* options);
7272
ADDAPI const char* ADDCALL sass_option_get_output_path (struct Sass_Options* options);
73-
ADDAPI const char* ADDCALL sass_option_get_image_path (struct Sass_Options* options);
7473
ADDAPI const char* ADDCALL sass_option_get_include_path (struct Sass_Options* options);
7574
ADDAPI const char* ADDCALL sass_option_get_source_map_file (struct Sass_Options* options);
7675
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
8887
ADDAPI void ADDCALL sass_option_set_linefeed (struct Sass_Options* options, const char* linefeed);
8988
ADDAPI void ADDCALL sass_option_set_input_path (struct Sass_Options* options, const char* input_path);
9089
ADDAPI void ADDCALL sass_option_set_output_path (struct Sass_Options* options, const char* output_path);
91-
ADDAPI void ADDCALL sass_option_set_image_path (struct Sass_Options* options, const char* image_path);
9290
ADDAPI void ADDCALL sass_option_set_include_path (struct Sass_Options* options, const char* include_path);
9391
ADDAPI void ADDCALL sass_option_set_source_map_file (struct Sass_Options* options, const char* source_map_file);
9492
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,
121119
} // __cplusplus defined.
122120
#endif
123121

124-
#endif
122+
#endif

sass_interface.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ extern "C" {
115115
.source_map_embed(c_ctx->options.source_map_embed)
116116
.source_map_contents(c_ctx->options.source_map_contents)
117117
.omit_source_map_url(c_ctx->options.omit_source_map_url)
118-
.image_path(safe_str(c_ctx->options.image_path))
119118
.include_paths_c_str(c_ctx->options.include_paths)
120119
.include_paths_array(0)
121120
.include_paths(vector<string>())
@@ -205,7 +204,6 @@ extern "C" {
205204
.source_map_embed(c_ctx->options.source_map_embed)
206205
.source_map_contents(c_ctx->options.source_map_contents)
207206
.omit_source_map_url(c_ctx->options.omit_source_map_url)
208-
.image_path(safe_str(c_ctx->options.image_path))
209207
.include_paths_c_str(c_ctx->options.include_paths)
210208
.include_paths_array(0)
211209
.include_paths(vector<string>())

sass_interface.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ struct sass_options {
3333
// Colon-separated list of paths
3434
// Semicolon-separated on Windows
3535
const char* include_paths;
36-
// For the image-url Sass function
37-
const char* image_path;
3836
// String to be used for indentation
3937
const char* indent;
4038
// String to be used to for line feeds

0 commit comments

Comments
 (0)