Closed Bug 1483458 Opened 6 years ago Closed 6 years ago

update HTML parser atom generation for new HTMLAtoms.py file

Categories

(Core :: DOM: HTML Parser, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox63 --- wontfix
firefox64 --- fixed

People

(Reporter: heycam, Assigned: jkt)

References

(Depends on 1 open bug)

Details

Attachments

(2 files, 3 obsolete files)

Bug 1482782 changed the way static atoms are defined, and the HTML parser atoms all now live in xpcom/ds/HTMLAtoms.py. The atom generation script needs to be updated for this.
Taking as I have a prelim patch for this as I was struggling to generate an attr change.
Assignee: nobody → jkt
Attached patch bug-1483458.patch (obsolete) (deleted) — Splinter Review
Attached patch bug-1483458-parser.patch (obsolete) (deleted) — Splinter Review
Attachment #9018011 - Flags: review?(hsivonen)
Attachment #9018011 - Flags: review?(cam)
Attachment #9018012 - Flags: review?(hsivonen)
Attachment #9018012 - Flags: review?(cam)
Blocks: 903372
I tested this and minus Bug 1466449 it appears to be generating the right output. The non parser patch is the change it generated (mostly whitespace) I had to edit the new static .py file to be on one line so to remove a bigger change in the parser.
Comment on attachment 9018012 [details] [diff] [review] bug-1483458-parser.patch Review of attachment 9018012 [details] [diff] [review]: ----------------------------------------------------------------- r=me with that, though I don't have the original sources at hand so I will leave most of the review to Henri. ::: translator-src/nu/validator/htmlparser/cpptranslate/CppTypes.java @@ +55,4 @@ > > public class CppTypes { > > + private static final Pattern ATOM_DEF = Pattern.compile("^\\s*Atom\\(\"([^,]+)\",\\s*\"([^\"]*)\"\\).*$"); What about the atoms defined with PseudoElementAtom or NonInheritingAnonBoxAtom or InheritingAnonBoxAtom? I guess it's unlikely that we need to worry about them, but it might be worth pointing that out in a comment if so. @@ +148,4 @@ > while ((line = atomReader.readLine()) != null) { > manualAtoms.append(line); > manualAtoms.append('\n'); > + if (line.trim().startsWith("] + HTML_PARSER_ATOMS")) { It won't be obvious if someone's editing StaticAtoms.py that the "] + HTML_PARSER_ATOMS" line is important. Can you instead add some comments surrounding the HTML_PARSER_ATOMS assignment like "# START ATOMS" and "# END ATOMS" that we can check for? ::: translator-src/nu/validator/htmlparser/cpptranslate/GkAtomParser.java @@ +47,4 @@ > > public class GkAtomParser { > > + private static final Pattern ATOM = Pattern.compile("^Atom\\(\"([^,]+)\",\\s*\"([^\"]*)\"\\).*$"); Same here.
Attachment #9018012 - Flags: review?(cam) → review+
Comment on attachment 9018011 [details] [diff] [review] bug-1483458.patch Review of attachment 9018011 [details] [diff] [review]: ----------------------------------------------------------------- ::: xpcom/ds/StaticAtoms.py @@ +75,4 @@ > Atom("allowpopupstoescapesandbox", "allow-popups-to-escape-sandbox"), > Atom("allowpopups", "allow-popups"), > Atom("allowpresentation", "allow-presentation"), > + Atom("allowstorageaccessbyuseractivatetion", "allow-storage-access-by-user-activation"), Can you add a comment at the top of the file saying that all of these definitions must be on a single line because the HTML parser generation script expects it? FWIW there's a typo in the atom identifier ("activatetion"), can you file a followup for that?
Attachment #9018011 - Flags: review?(cam) → review+
Comment on attachment 9018012 [details] [diff] [review] bug-1483458-parser.patch Review of attachment 9018012 [details] [diff] [review]: ----------------------------------------------------------------- I trust heycam's comments. Thanks for fixing this.
Attachment #9018012 - Flags: review?(hsivonen) → review+
Attached patch bug-1483458-parser.patch (deleted) — Splinter Review
Copying r+ over from previous patch as I fixed simple nits.
Attachment #9018012 - Attachment is obsolete: true
Attachment #9018258 - Flags: review+
Attached patch bug-1483458.patch (deleted) — Splinter Review
Copying r+ over from previous patch as I fixed simple nits.
Attachment #9018011 - Attachment is obsolete: true
Attachment #9018259 - Attachment is obsolete: true
Attachment #9018260 - Flags: review+
Requesting checkin-needed for both patches as this should be OK to land in a soft code freeze due to there being no functional changes and is blocking anyone using this tool (probably just me): bug-1483458-parser.patch - is for https://hg.mozilla.org/projects/htmlparser/ bug-1483458.patch - is for mozilla-central/inbound etc Thank you!
Keywords: checkin-needed
Depends on: 1500096
Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/mozilla-inbound/rev/0ff0b54b9ec7 Change HTML parser to look at .py Atom files. r=hsivonen,heycam
Keywords: checkin-needed
Cameron, can you push this to htmlparser, please?
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
(In reply to Sebastian Hengst [:aryx] (needinfo on intermittent or backout) from comment #13) > Cameron, can you push this to htmlparser, please? I've pushed it: https://hg.mozilla.org/projects/htmlparser/rev/9b24191bc606
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: