Skip to content

Commit

Permalink
Merge pull request #7 from mathiasbynens/time-date
Browse files Browse the repository at this point in the history
Add <time> and <data> elements
  • Loading branch information
ifratric committed Sep 25, 2017
2 parents 836bf40 + b8e0834 commit 6763ad8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
10 changes: 6 additions & 4 deletions generator.py
Expand Up @@ -60,6 +60,7 @@
'colgroup': 'HTMLUnknownElement',
'command': 'HTMLUnknownElement',
'content': 'HTMLContentElement',
'data': 'HTMLDataElement',
'datalist': 'HTMLDataListElement',
'dd': 'HTMLUnknownElement',
'del': 'HTMLModElement',
Expand Down Expand Up @@ -155,6 +156,7 @@
'tfoot': 'HTMLTableSectionElement',
'th': 'HTMLTableCellElement',
'thead': 'HTMLTableSectionElement',
'time': 'HTMLTimeElement',
'title': 'HTMLTitleElement',
'tr': 'HTMLTableRowElement',
'track': 'HTMLTrackElement',
Expand Down Expand Up @@ -330,7 +332,7 @@ def GenerateNewSample(template, htmlgrammar, cssgrammar, jsgrammar):

htmlctx = {'htmlvars':[], 'htmlvarctr':0, 'svgvarctr':0, 'htmlvargen':''}
html = re.sub(r'<[a-zA-Z0-9_-]+\ ', lambda match: AddHTMLIDs(match, htmlctx), html)
GenerateHTMLElements(htmlctx, _N_ADDITIONAL_HTMLVARS);
GenerateHTMLElements(htmlctx, _N_ADDITIONAL_HTMLVARS);

result = result.replace('<cssfuzzer>', css)
result = result.replace('<htmlfuzzer>', html)
Expand Down Expand Up @@ -408,12 +410,12 @@ def main():
fuzzer_dir = os.path.dirname(__file__)

multiple_samples = False

for a in sys.argv:
if a.startswith('--output_dir='):
multiple_samples = True
if '--output_dir' in sys.argv:
multiple_samples = True
multiple_samples = True

if multiple_samples:
print('Running on ClusterFuzz')
Expand All @@ -427,7 +429,7 @@ def main():
outfiles.append(os.path.join(out_dir, 'fuzz-' + str(i) + '.html'))

GenerateSamples(fuzzer_dir, outfiles)

elif len(sys.argv) > 1:
outfile = sys.argv[1]
GenerateSamples(fuzzer_dir, [outfile])
Expand Down
12 changes: 12 additions & 0 deletions js.txt
Expand Up @@ -1523,6 +1523,18 @@
<new long> = <HTMLCollection>.length;
<new Element> = <HTMLCollection id=1>.item(<int min=0 max=100>%<HTMLCollection id=1>.length);

#HTMLDataElement
!extends HTMLDataElement Element
<new Element> = <HTMLDataElement>;
<new DOMString> = <HTMLDataElement>.value;
<HTMLDataElement>.value = "<value_value>";

#HTMLTimeElement
!extends HTMLTimeElement Element
<new Element> = <HTMLTimeElement>;
<new DOMString> = <HTMLTimeElement>.dateTime;
<HTMLTimeElement>.dateTime = "<datetime_value>";

#HTMLMarqueeElement
!extends HTMLMarqueeElement Element
<new Element> = <HTMLMarqueeElement>;
Expand Down

0 comments on commit 6763ad8

Please sign in to comment.