Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / devtools / front_end / documentation / CSSArticle.js
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6  * @constructor
7  */
8 WebInspector.CSSArticle = function()
9 {
10     /** @type {string} */
11     this.pageTitle;
12     /** @type {string} */
13     this.standardizationStatus;
14     /** @type {string} */
15     this.summary;
16     /** @type {!Object.<string, ?Array.<!Object.<string>>>} */
17     this.cssProperties;
18 }
19
20 /**
21  * @param {string} wikiMarkupText
22  * @return {?WebInspector.CSSArticle}
23  */
24 WebInspector.CSSArticle.parse = function(wikiMarkupText)
25 {
26     var wikiParser = new WebInspector.WikiParser(wikiMarkupText);
27     var wikiDocument = wikiParser.document();
28
29     var article = new WebInspector.CSSArticle();
30     if (typeof wikiDocument["Page_Title"] !== "undefined")
31         article.pageTitle = wikiDocument["Page_Title"];
32     if (typeof wikiDocument["Standardization_Status"] !== "undefined")
33         article.standardizationStatus = wikiDocument["Standardization_Status"];
34     if (typeof wikiDocument["Summary_Section"] !== "undefined")
35         article.summary = wikiDocument["Summary_Section"];
36     if (typeof wikiDocument["CSS Property"] !== "undefined")
37         article.cssProperties = wikiDocument["CSS Property"];
38
39     return article;
40 }
41