Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit fd59d72

Browse files
committed
Merge pull request #6824 from oslego/prefix
Unit Tests: CSSUtils.getInfoAtPos() ignores prefixes
2 parents aee91c6 + 666b34b commit fd59d72

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

test/spec/CSSUtils-test-files/contexts.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@
6363
shape-inside: polygon(n{{108}}onzero, 0 0);
6464
}
6565

66+
.prefixed{
67+
-{{110}}webkit-transform: ;
68+
t{{111}}ransform: ;
69+
}
70+
6671
.nested-functional-notation {
6772
background: linear-gradient(to r{{109}}ight, rgba(255,255,0), #fff);
6873
}

test/spec/CSSUtils-test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,6 +2100,29 @@ define(function (require, exports, module) {
21002100
});
21012101
});
21022102

2103+
it("should return unprefixed PROP_NAME", function () {
2104+
result = CSSUtils.getInfoAtPos(testEditor, contextTest.offsets[111]);
2105+
expect(result).toEqual({
2106+
context: CSSUtils.PROP_NAME,
2107+
name: "transform",
2108+
offset: 1,
2109+
index: -1,
2110+
values: [],
2111+
isNewItem: false
2112+
});
2113+
});
2114+
2115+
it("should return prefixed PROP_NAME when inside a prefixed property name", function () {
2116+
result = CSSUtils.getInfoAtPos(testEditor, contextTest.offsets[110]);
2117+
expect(result).toEqual({
2118+
context: CSSUtils.PROP_NAME,
2119+
name: "-webkit-transform",
2120+
offset: 1,
2121+
index: -1,
2122+
values: [],
2123+
isNewItem: false
2124+
});
2125+
});
21032126
});
21042127

21052128
describe("quoting", function () {

0 commit comments

Comments
 (0)