Skip to content

Commit 091010d

Browse files
committed
Merge pull request #994 from mgreter/bugfix/issue_452
Implement `/deep/` shadow DOM selector
2 parents ff3565b + 5caacc3 commit 091010d

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

constants.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ namespace Sass {
7878
extern const char webkit_calc_kwd[] = "-webkit-calc(";
7979
extern const char ms_calc_kwd[] = "-ms-calc(";
8080

81+
// css selector keywords
82+
extern const char sel_deep_kwd[] = "/deep/";
83+
8184
// css attribute-matching operators
8285
extern const char tilde_equal[] = "~=";
8386
extern const char pipe_equal[] = "|=";

constants.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ namespace Sass {
8080
extern const char webkit_calc_kwd[];
8181
extern const char ms_calc_kwd[];
8282

83+
// css selector keywords
84+
extern const char sel_deep_kwd[];
85+
8386
// css attribute-matching operators
8487
extern const char tilde_equal[];
8588
extern const char pipe_equal[];

parser.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,9 @@ namespace Sass {
628628
else if (lex< quoted_string >() || lex< number >()) {
629629
return new (ctx.mem) Type_Selector(pstate, unquote(lexed));
630630
}
631+
else if (lex< exactly < sel_deep_kwd > >()) {
632+
return new (ctx.mem) Type_Selector(pstate, unquote(lexed));
633+
}
631634
else if (peek< pseudo_not >()) {
632635
return parse_negated_selector();
633636
}
@@ -1984,6 +1987,7 @@ namespace Sass {
19841987
(q = peek< dimension >(p)) ||
19851988
(q = peek< quoted_string >(p)) ||
19861989
(q = peek< exactly<'*'> >(p)) ||
1990+
(q = peek< exactly<sel_deep_kwd> >(p)) ||
19871991
(q = peek< exactly<'('> >(p)) ||
19881992
(q = peek< exactly<')'> >(p)) ||
19891993
(q = peek< exactly<'['> >(p)) ||

0 commit comments

Comments
 (0)