发明名称 Jslayout cascading style sheets optimization
摘要 A system, method and a computer-readable medium for optimizing cascading style sheet (CSS) rules. The system includes a parser, an optimizer and a compiler. The parser is configured to generate a template tree and a CSS tree. The template tree is associated with a template file that includes one or more templates. The CSS tree is associated with a CSS file that includes one or more CSS rules. The optimizer is configured to traverse the template tree and the CSS tree, and identify each node in the template tree that has a reference to a CSS node in the CSS tree. When the reference exists, optimizer retrieves a CSS rule from the CSS node and appends the CSS rule to the node in the template tree. The compiler compiles the appended template tree.
申请公布号 US8745027(B1) 申请公布日期 2014.06.03
申请号 US201213407431 申请日期 2012.02.28
申请人 Google Inc. 发明人 Haustein Stefan;Michael Constantinos;Boonstoppel Tobias;Meschkat Steffen
分类号 G06F17/30;G06F17/24 主分类号 G06F17/30
代理机构 代理人
主权项 1. A computer-implemented method for a cascading style sheet (CSS) rule optimization, comprising: generating, by one or more computing devices, a template tree associated with a template file with a parser, the template file including one or more templates; generating, by the one or more computing devices, a CSS tree associated with a CSS file with the parser, the CSS file including at least one or more CSS rules; traversing, by the one or more computing devices, the template tree and the CSS tree with an optimizer, wherein the traversing further comprises: for each node in the template tree, identifying a reference to one or more CSS nodes in the CSS tree;if the reference exists, reconstructing a CSS rule from the one or more CSS nodes;appending the CSS rule to the node in the template tree; andcompiling, by the one or more computing devices, the appended template tree with a compiler.
地址 Mountain View CA US