Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/extensions/default/WebPlatformDocs/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ define(function (require, exports, module) {
.done(function (cssDocs) {
// Construct inline widget (if we have docs for this property)
var cssPropDetails = cssDocs.PROPERTIES["css/properties/" + cssPropName];
if (!cssPropDetails) {
cssPropName = cssPropName.replace(/^-(webkit|moz|ms|o)-/, ""); // remove possible vendor prefixes
if (cssPropName) {
cssPropDetails = cssDocs.PROPERTIES["css/properties/" + cssPropName];
}
}
if (cssPropDetails) {
var inlineWidget = new InlineDocsViewer(cssPropName, cssPropDetails);
inlineWidget.load(hostEditor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
{{3}}does-not-exist: 0;
/* {{5}}color: #000 */
background: border{{4}};
}
{{6}}-webkit-animation: none;
{{7}}-border-width: 2px;
}
10 changes: 10 additions & 0 deletions src/extensions/default/WebPlatformDocs/unittests.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ define(function (require, exports, module) {
queryInlineAtPos(testCSSInfo, 3, false);
});

it("should open docs for a vendor-prefixed CSS property", function () {
/* css -webkit- prefixed property */
queryInlineAtPos(testCSSInfo, 6, true, "animation");
});

it("should not open docs for an invalid CSS property (looking like a vendor-prefixed one)", function () {
/* css property invalidly prefixed */
queryInlineAtPos(testCSSInfo, 7, false);
});

});

describe("InlineDocsProvider parsing in HTML", function () {
Expand Down
4 changes: 4 additions & 0 deletions src/language/CSSUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ define(function (require, exports, module) {
testToken.type === "tag") {
propName = testToken.string;
offset = 0;
} else if (testToken.type === "meta" || testToken.string === "-") {
ctx.pos = testPos;
ctx.token = testToken;
return _getPropNameInfo(ctx);
}
}

Expand Down