Jslayout cascading style sheets optimization
First Claim
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; and
compiling, by the one or more computing devices, the appended template tree with a compiler.
2 Assignments
0 Petitions
Accused Products
Abstract
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.
47 Citations
19 Claims
-
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; and compiling, by the one or more computing devices, the appended template tree with a compiler. - View Dependent Claims (2, 3, 4)
-
-
5. The computer-implemented method for a cascading style sheet (CSS) rule optimization, comprising:
-
receiving, by one or more computing device, a message requesting a webpage; collecting, by the one or more computing devices, one or more CSS rules included in a compiled template tree in a style element, the compiled template tree generated with a parser; excluding with an optimizer, by the one or more computing devices, one or more CSS rules from the style element according to a predefined criteria; inserting, by the one or more computing devices, the style element in an output stream with a compiler; and sending, by the one or more computing devices, a response message, the response message including the output stream that is displayed as the webpage. - View Dependent Claims (6, 7, 8, 9, 10)
-
-
11. A system for a cascading style sheet (CSS) rule optimization, comprising:
-
a parser configured to; generate, by one or more computing device, a template tree associated with a template file, the template file including one or more templates, and generate, by the one or more computing device, a CSS tree associated with a CSS file, the CSS file including at least one or more CSS rules; an optimizer configured to; traverse, by the one or more computing device, the template tree and the CSS tree, wherein the traversing further comprises; for each node in the template tree, the optimizer if further configured to; identify 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; append the CSS rule to the node in the template tree; and a compiler configured to compile, by the one or more computing device, the appended template tree.
-
-
12. A system for a cascading style sheet (CSS) rule optimization, comprising:
-
a communication interface configured to; receive, by one or more computing device, a message requesting a webpage; send, by the one or more computing device, a response message, the response message including an output stream that is displayed as the webpage; an interpreter configured to; collect, by the one or more computing device, one or more CSS rules included in a compiled template tree in a style element, the compiled template tree generated with a parser; exclude with an optimizer, by the one or more computing device, one or more CSS rules from the style element according to a predefined criteria; insert, by the one or more computing device, the style element in the output stream with a compiler; and communicate, by the one or more computing device, the output stream to the communication interface. - View Dependent Claims (13, 14, 15, 16, 17)
-
-
18. An article of manufacture including a non-transitory computer-readable medium having instructions stored thereon that, when executed by a computing device, cause the computing device to perform operations comprising:
-
generating a template tree associated with a template file with a parser, the template file including one or more templates; generating a CSS tree associated with a CSS file with the parser, the CSS file including at least one or more CSS rules; traversing 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, retrieving a CSS rule from the one or more CSS nodes; appending the CSS rule to the node in the template tree; and compiling the appended template tree with a compiler.
-
-
19. An article of manufacture including a non-transitory computer-readable medium having instructions stored thereon that, when executed by a computing device, cause the computing device to perform operations comprising:
-
receiving a message requesting a webpage; collecting one or more CSS rules included in a compiled template tree in a style element, the compiled template tree generated with a parser; excluding with an optimizer one or more CSS rules from the style element according to a predefined criteria; inserting the style element in an output stream with a compiler; and sending a response message, the response message including the output stream that is displayed as the webpage.
-
Specification