Class Stylesheet

A representation of the style tags inside the document which allow for the easy addition and manipulation of the rules inside of them.

Constructor

class Stylesheet(id)
Arguments:
  • id (Number) – the style Id

Methods

add

Stylesheet#add(rule)
Arguments:
  • rule (RuleSet) – the rule to be added
Returns Boolean:
 

true if the addition was successful false otherwise

Queue a rule to be added to the stylesheet.

getFreeSpace

Stylesheet#getFreeSpace()
Returns Integer:
 the free space left inside the stylesheet

Calculate the free space left inside the stylesheet.

getRulesWithin

Stylesheet#getRulesWithin(space)
Arguments:
  • space (Number) – the space to fit the rules inside of
Returns RuleSet[]:
 

the identified rules

Find the rules inside this stylesheet that fit in a designated amount of space

remove

Stylesheet#remove(rules)
Arguments:
  • rules (RuleSet) – the rule to delete

Queue a rule to be removed from the stylesheet.

write

Stylesheet#write()

Write the queued modifications to the stylesheet object than to the html.

Attributes

id

id

the id of the stylesheet

ruleCount

ruleCount

the number of rules in the stylesheet

Table Of Contents

Previous topic

Class SocketHandler

Next topic

Class Util