Compression of cascading style sheet files
AssigneeAlibaba Group Holding Limited
InventorLixin Hao
Life of this patent
Estimating the term…
Abstract
One embodiment of the present invention provides a system for facilitating compression of a Cascading Style Sheet (CSS) file. During operation, the system stores the CSS file in a local storage device and identifies a merge parameter in the CSS file. The merge parameter can be one of: a repeated selector, a repeated property in a selector, and a same value of a property in different selectors. The system then determines whether a merge condition is satisfied for the merge parameter and merges the merge parameter in the CSS file to obtain a compressed merge parameter. The merge condition indicates whether merging of the merge parameter is consistent with original style in the CSS file.
Claims21
A computer-implemented method for facilitating compression of a Cascading Style Sheet (CSS) file, the method comprising:
- identifying a merge parameter in the CSS file, wherein the merge parameter is one of:
- a repeated selector, a repeated property in a selector, and a same value of a property in different selectors;
- determining whether a merge condition is satisfied for the merge parameter, wherein the merge condition indicates whether merging of the merge parameter is consistent with original style in the CSS file;
- and
- merging the merge parameter in the CSS file to obtain a compressed merge parameter.
A non-transitory storage medium storing instructions, which when executed by a processor cause the processor to perform a method for facilitating dynamic load-based merging, the method comprising:
- identifying a merge parameter in the CSS file, wherein the merge parameter is one of:
- a repeated selector, a repeated property in a selector, and a same value of a property in different selectors;
- determining whether a merge condition is satisfied for the merge parameter, wherein the merge condition indicates whether merging of the merge parameter is consistent with original style in the CSS file;
- and
- merging the merge parameter in the CSS file to obtain a compressed merge parameter.
A computing system for facilitating dynamic load-based merging, the computing system comprising:
- a processor;
- a memory coupled to the processor and storing instructions, which when executed by the processor cause the processor to perform a method, the method comprising:
- identifying a merge parameter in the CSS file, wherein the merge parameter is one of:
- a repeated selector, a repeated property in a selector, or a same value of a property in different selectors;
- determining whether a merge condition is satisfied for the merge parameter, wherein the merge condition indicates whether merging of the merge parameter is consistent with original style in the CSS file;
- and
- merging the merge parameter in the CSS file to obtain a compressed merge parameter.
Dependencies are inferred from the claim text.