Compression of cascading style sheet files

US9747385B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-9747385-B2
Application numberUS-201514881066-A
CountryUS
Kind codeB2
Filing dateOct 12, 2015
Priority dateOct 15, 2014
Publication dateAug 29, 2017
Grant dateAug 29, 2017

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

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.

First claim

Opening claim text (preview).

What is claimed is: 1. A method for facilitating compression of a Cascading Style Sheet (CSS) file, the method comprising: identifying, by a server hosting a web page associated with the CSS file, a first selector and a second selector in the CSS file by identifying a repeated code in the first and second selectors, wherein the repeated code appears in each of the first and second selectors; determining whether the first selector and the second selector are adjacent in the CSS file; in response to the first and second selectors not being adjacent, determining whether a third selector between the first and second selectors includes a property included in the first and second selectors; in response to the third selector not including the property, determining that merging the repeated code in the first and second selectors produces a same style for the web page as the original style in the CSS file; merging the repeated code in the first and second selectors in the CSS file to obtain a compressed CSS file; receiving a request for the web page; and in response to receiving the request for the web page, generating a web response comprising the web page and the compressed CSS file. 2. The method of claim 1 , further comprising determining whether the compressed CSS file is valid based on a length of the merged repeated code. 3. The method of claim 1 , wherein in response to the third selector including the property, the method further comprises determining whether the repeated code includes one or more of: a same value in the first, second, and third selectors; different priorities in the first, second, and third selectors. 4. The method of claim 1 , further comprising determining that merging the repeated code in the first and second selectors produces a same style for the web page as the original style in the CSS file further in response to determining that: a latter value of a property of the repeated code overwrites a former value of the property and the latter value has an equal or higher priority; or a former value of the property overwrites a latter value of the property and the former value has a higher priority. 5. The method of claim 1 , wherein merging the repeated code comprises removing a second value of a property, wherein the second value appears before a first value, has a lower priority than the first value, or has an overwriting relationship with the first value. 6. The method of claim 1 , further comprising: representing selectors of the CSS file and corresponding properties in a table; and determining a common area in the table for a respective property. 7. The method of claim 6 , further comprising: identifying a current maximum common area in the table for a property; extracting the property as a common factor; merging the common factor across a respective selector comprising the property. 8. The method of claim 1 , further comprising generating the compressed CSS file based on a plurality of merged repeated codes. 9. The method of claim 1 , further comprising, prior to generating the compressed CSS file, organizing properties of all selectors in the CSS file in an alphabetic order. 10. A non-transitory storage medium storing instructions, which when executed by a processor cause the processor to perform a method for facilitating compression of a Cascading Style Sheet (CSS) file, the method comprising: identifying, by a server hosting a web page associated with the CSS file, a first selector and a second selector in the CSS file by identifying a repeated code in the first and second selectors, wherein the repeated code appears in each of the first and second selectors; determining whether the first selector and the second selector are adjacent in the CSS file; in response to the first and second selectors not being adjacent, determining whether a third selector between the first and second selectors includes a property included in the first and second selectors; in response to the third selector not including the property, determining that merging the repeated code in the first and second selectors produces a same style for the web page as the original style in the CSS file; and merging the repeated code in the first and second selectors in the CSS file to obtain a compressed CSS file; receiving a request for the web page; and in response to receiving the request for the web page, generating a web response comprising the web page and the compressed CSS file. 11. The non-transitory storage medium of claim 10 , wherein the method further comprises determining whether the compressed CSS file is valid based on a length of the merged repeated code. 12. The non-transitory storage medium of claim 10 , wherein in response to the third selector including the property, the method further comprises determining whether the repeated code includes one or more of: a same value in the first, second, and third selectors; different priorities in the first, second, and third selectors. 13. The non-transitory storage medium of claim 10 , wherein the method further comprises determining that merging the repeated code in the first and second selectors produces a same style for the web page as the original style in the CSS file further in response to determining that: a latter value of a property of the repeated code overwrites a former value of the property and the latter value has an equal or higher priority; or a former value of the property overwrites a latter value of the property and the former value has a higher priority. 14. The non-transitory storage medium of claim 10 , wherein merging the repeated code comprises removing a second value of a property, wherein the second value appears before a first value, has a lower priority than the first value, or has an overwriting relationship with the first value. 15. The non-transitory storage medium of claim 10 , wherein the method further comprises: representing selectors of the CSS file and corresponding properties in a table; and determining a common area in the table for a respective property. 16. The non-transitory storage medium of claim 15 , wherein the method further comprises: identifying a current maximum common area in the table for a property; extracting the property as a common factor; merging the common factor across a respective selector comprising the property. 17. The non-transitory storage medium of claim 10 , wherein the method further comprises generating the compressed CSS file based on a plurality of merged repeated codes. 18. The non-transitory storage medium of claim 10 , wherein the method further comprises, prior to generating the compressed CSS file, organizing properties of all selectors in the CSS file in an alphabetic order. 19. A computing system for facilitating compression of a Cascading Style Sheet (CSS) file and hosting a web page associated with the CSS file, 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 first selector and a second selector in the CSS file by identifying a repeated code in the first and second selectors, wherein the repeated code appears in each of the first and second selectors; determining whether the first selector and the second selector are adjacent in the CSS file; in response to the first and second selectors not being adjacent, determining whether a third selector between the first and second selectors inc

Assignees

Inventors

Classifications

  • H03M7/707Primary

    Structured documents, e.g. XML · CPC title

  • Coding or compression of tree-structured data · CPC title

  • Precoding preceding compression, e.g. Burrows-Wheeler transformation · CPC title

  • G06F16/986Primary

    Document structures and storage, e.g. HTML extensions · CPC title

  • H03M7/30Primary

    Compression (speech analysis-synthesis for redundancy reduction G10L19/00; for image communication H04N); Expansion; Suppression of unnecessary data, e.g. redundancy reduction · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US9747385B2 cover?
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. …
Who is the assignee on this patent?
Alibaba Group Holding Ltd
What technology area does this patent fall under?
Primary CPC classification H03M7/707. Mapped technology areas include Electricity.
When was this patent published?
Publication date Tue Aug 29 2017 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).