mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Remove static atoms of CSS properties
This commit is contained in:
parent
e73bb054c5
commit
7f06c554d9
2 changed files with 7 additions and 2925 deletions
|
@ -33,14 +33,14 @@ def msvc32_symbolify(source, ident):
|
||||||
|
|
||||||
|
|
||||||
class GkAtomSource:
|
class GkAtomSource:
|
||||||
PATTERN = re.compile('^GK_ATOM\((?P<ident>.+),\s*"(?P<value>.*)"\)', re.M)
|
PATTERN = re.compile('^GK_ATOM\((.+),\s*"(.*)"\)')
|
||||||
FILE = "include/nsGkAtomList.h"
|
FILE = "include/nsGkAtomList.h"
|
||||||
CLASS = "nsGkAtoms"
|
CLASS = "nsGkAtoms"
|
||||||
TYPE = "nsIAtom"
|
TYPE = "nsIAtom"
|
||||||
|
|
||||||
|
|
||||||
class CSSPseudoElementsAtomSource:
|
class CSSPseudoElementsAtomSource:
|
||||||
PATTERN = re.compile('^CSS_PSEUDO_ELEMENT\((?P<ident>.+),\s*"(?P<value>.*)",', re.M)
|
PATTERN = re.compile('^CSS_PSEUDO_ELEMENT\((.+),\s*"(.*)",')
|
||||||
FILE = "include/nsCSSPseudoElementList.h"
|
FILE = "include/nsCSSPseudoElementList.h"
|
||||||
CLASS = "nsCSSPseudoElements"
|
CLASS = "nsCSSPseudoElements"
|
||||||
# NB: nsICSSPseudoElement is effectively the same as a nsIAtom, but we need
|
# NB: nsICSSPseudoElement is effectively the same as a nsIAtom, but we need
|
||||||
|
@ -49,24 +49,16 @@ class CSSPseudoElementsAtomSource:
|
||||||
|
|
||||||
|
|
||||||
class CSSAnonBoxesAtomSource:
|
class CSSAnonBoxesAtomSource:
|
||||||
PATTERN = re.compile('^CSS_ANON_BOX\((?P<ident>.+),\s*"(?P<value>.*)"\)', re.M)
|
PATTERN = re.compile('^CSS_ANON_BOX\((.+),\s*"(.*)"\)')
|
||||||
FILE = "include/nsCSSAnonBoxList.h"
|
FILE = "include/nsCSSAnonBoxList.h"
|
||||||
CLASS = "nsCSSAnonBoxes"
|
CLASS = "nsCSSAnonBoxes"
|
||||||
TYPE = "nsICSSAnonBoxPseudo"
|
TYPE = "nsICSSAnonBoxPseudo"
|
||||||
|
|
||||||
|
|
||||||
class CSSPropsAtomSource:
|
|
||||||
PATTERN = re.compile('^CSS_PROP_[A-Z]+\(\s*(?P<value>[^,]+),\s*(?P<ident>[^,]+)', re.M)
|
|
||||||
FILE = "include/nsCSSPropList.h"
|
|
||||||
CLASS = "nsCSSProps"
|
|
||||||
TYPE = "nsICSSProperty"
|
|
||||||
|
|
||||||
|
|
||||||
SOURCES = [
|
SOURCES = [
|
||||||
GkAtomSource,
|
GkAtomSource,
|
||||||
CSSPseudoElementsAtomSource,
|
CSSPseudoElementsAtomSource,
|
||||||
CSSAnonBoxesAtomSource,
|
CSSAnonBoxesAtomSource,
|
||||||
CSSPropsAtomSource,
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -104,14 +96,10 @@ def collect_atoms(objdir):
|
||||||
atoms = []
|
atoms = []
|
||||||
for source in SOURCES:
|
for source in SOURCES:
|
||||||
with open(os.path.join(objdir, source.FILE)) as f:
|
with open(os.path.join(objdir, source.FILE)) as f:
|
||||||
content = f.read()
|
for line in f.readlines():
|
||||||
found = set()
|
result = re.match(source.PATTERN, line)
|
||||||
for match in source.PATTERN.finditer(content):
|
if result:
|
||||||
ident = match.group('ident')
|
atoms.append(Atom(source, result.group(1), result.group(2)))
|
||||||
if ident in found:
|
|
||||||
continue
|
|
||||||
found.add(ident)
|
|
||||||
atoms.append(Atom(source, ident, match.group('value')))
|
|
||||||
return atoms
|
return atoms
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue