IP Library Granted Patent US 10,489,497
Granted Patent B2
US 10,489,497 · App. 16/140,030 · Granted Nov 26, 2019

Fast CSS parser

Inventor: Nathan David McWilliams (Atlanta, GA)
Assignee: salesforce.com, inc.
G06F17/227G06F16/958G06F16/9577G06F17/2247G06F17/272G06F8/20G06F8/30G06F8/38G06F9/451G06F16/951G06F16/972G06F17/243G06F17/247G06F17/248G06Q10/10G06Q30/02H04L67/42
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,489,497
App. No.
16/140,030
Granted
Nov 26, 2019
Kind
B2
Abstract

The technology disclosed relates to systems and methods for providing a CSS parser to improve the maintainability of code that displays data to users. The technology disclosed also improves the performance and consistency of the code that delivers a user's experience. An embodiment operates by accessing a CSS target token in a first customizable code segment and scanning a CSS codebase to locate a second customizable code segment of the CSS codebase that comprises the target token. Embodiments may further include transforming an object in the first or second customizable code segments of the CSS codebase by modifying the first or second customizable code segments to include customization code, parsing the first and second customizable code segments by transforming the first or second customizable code segments of the CSS codebase into a plurality of segment parse trees, and outputting a customized codebase based on the plurality of segment parse trees.

Claims (47)

1. A computer-implemented method comprising:

accessing, by a cascading style sheet (CSS) parser at runtime, implemented by at least one processor, a CSS target token in a first customizable code segment;

scanning, by the at least one processor, a CSS codebase to locate a second customizable code segment of the CSS codebase that comprises the target token, wherein the first or second customizable code segments are specified by a selected set of customizations based at least in part on an attribute of a user;

transforming, by the at least one processor, a first object in the first or second customizable code segments of the CSS codebase, by modifying the first or second customizable code segments to include customization code;

parsing, by the at least one processor, the first and second customizable code segments, by transforming, by the at least one processor, the first or second customizable code segments of the CSS codebase into a plurality of segment parse trees;

removing, by the at least one processor, the first object or a second object from the plurality of segment parse trees, in response to the parsing, and based on a condition corresponding to a customized codebase; and

outputting, by the at least one processor, the customized codebase based on the plurality of segment parse trees.

2. The method of claim 1 , further comprising identifying, by the at least one processor, an active theme.

3. The method of claim 2 , wherein the parsing is performed in accordance with the active theme.

4. The method of claim 1 , wherein the parsing is based on a characteristic associated with a user instance for a given website.

5. The method of claim 1 , further comprising registering, by the at least one processor, a plugin with a parser.

6. The method of claim 5 , wherein the plugin performs a rework operation with respect to the CSS codebase, and wherein the modifying the first or second customizable code segments to include the customization code comprises substituting the first or second customizable code segments with the customization code or appending the customization code to the first or second customizable code segments.

7. The method of claim 5 , wherein the plugin performs a validation operation with respect to the CSS codebase, wherein the validation operation comprises linting.

8. A system comprising:

memory and at least one processor configured to:

access, by a cascading style sheet (CSS) parser at runtime, a CSS target token in a first customizable code segment;

scan a CSS codebase to locate a second customizable code segment of the CSS codebase that comprises the target token, wherein the first or second customizable code segments are specified by a selected set of customizations based at least in part on an attribute of a user;

transform a first object in the first or second customizable code segments of the CSS codebase, by modifying the first or second customizable code segments to include customization code;

parse the first and second customizable code segments, by transforming the first or second customizable code segments of the CSS codebase into a plurality of segment parse trees;

remove the first object or a second object from the plurality of segment parse trees, in response to the parsing, and based on a condition corresponding to a customized codebase; and

output the customized codebase based on the plurality of segment parse trees.

9. The system of claim 8 , the at least one processor being further configured to identify an active theme.

10. The system of claim 9 , wherein the parsing is performed in accordance with the active theme.

11. The system of claim 8 , wherein the parsing is based on at least a characteristic associated with a user instance for a given website.

12. The system of claim 8 , the at least one processor being further configured to:

register a plugin with a parser, wherein:

the plugin is accessible from the CSS codebase,

the parser is configured to parse a remaining object of the customized codebase, and

the remaining object comprises at least one of an at-rule, a selector, or a declaration.

13. The system of claim 12 , wherein the plugin performs a rework operation with respect to the CSS codebase, and wherein the modifying the first or second customizable code segments to include the customization code comprises substituting the first or second customizable code segments with the customization code or appending the customization code to the first or second customizable code segments.

14. A non-transitory computer-readable storage device comprising instructions that, when executed by at least one processor, cause the at least one processor to perform operations comprising:

accessing, by a cascading style sheet (CSS) parser at runtime, a CSS target token in a first customizable code segment;

scanning a CSS codebase to locate a second customizable code segment of the CSS codebase that comprises the target token, wherein the first or second customizable code segments are specified by a selected set of customizations based at least in part on an attribute of a user;

transforming a first object in the first or second customizable code segments of the CSS codebase, by modifying the first or second customizable code segments to include customization code;

parsing the first and second customizable code segments, by transforming the first or second customizable code segments of the CSS codebase into a plurality of segment parse trees;

removing the first object or a second object from the plurality of segment parse trees, in response to the parsing, and based on a condition corresponding to a customized codebase; and

outputting the customized codebase based on the plurality of segment parse trees.

15. The non-transitory computer-readable storage device of claim 14 , the operations further comprising identifying an active theme.

16. The non-transitory computer-readable storage device of claim 15 , wherein the parsing is performed in accordance with the active theme.

17. The non-transitory computer-readable storage device of claim 14 , wherein the parsing is based on at least a characteristic associated with a user instance for a given website.

18. The non-transitory computer-readable storage device of claim 14 , the operations further comprising:

registering a plugin with a parser, wherein:

the plugin is accessible from the CSS codebase,

the parser is configured to parse a remaining object of the customized codebase, and

the remaining object comprises at least one of an at-rule, a selector, or a declaration.

19. The non-transitory computer-readable storage device of claim 18 , wherein the plugin performs a rework operation with respect to the CSS codebase, and wherein the modifying the first or second customizable code segments to include the customization code comprises substituting the first or second customizable code segments with the customization code or appending the customization code to the first or second customizable code segments.

20. The non-transitory computer-readable storage device of claim 18 , wherein the plugin performs a validation operation with respect to the CSS codebase, wherein the validation operation comprises linting.

Assignments (2)
CHANGE OF NAME Recorded Dec 18, 2024
From: SALESFORCE.COM, INC.
To: SALESFORCE, INC.
Reel/Frame 069717/0378 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 12, 2019
From: MCWILLIAMS, NATHAN DAVID
To: SALESFORCE.COM, INC.
Reel/Frame 050360/0474 →
Continuity (3)
Continuation 15376250 · Dec 12, 2016
Continuation 14320198 · Jun 30, 2014
Related Publication 20190026254A1 · Jan 24, 2019