RESOLVED FIXED Bug 64398
Character reference parser for new XML parser
https://bugs.webkit.org/show_bug.cgi?id=64398
Summary Character reference parser for new XML parser
Vicki Pfau
Reported 2011-07-12 14:48:14 PDT
Character reference parser for new XML parser
Attachments
Patch (14.64 KB, patch)
2011-07-12 16:36 PDT, Vicki Pfau
no flags
Patch (30.04 KB, patch)
2011-07-13 17:57 PDT, Vicki Pfau
no flags
Patch for landing (30.03 KB, patch)
2011-07-14 12:15 PDT, Vicki Pfau
no flags
Vicki Pfau
Comment 1 2011-07-12 16:36:05 PDT
Adam Barth
Comment 2 2011-07-12 16:48:52 PDT
Comment on attachment 100586 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=100586&action=review > Source/WebCore/xml/parser/XMLCharacterReferenceParser.cpp:37 > +namespace { No need to indent for namespaces. > Source/WebCore/xml/parser/XMLCharacterReferenceParser.cpp:46 > + inline UChar adjustEntity(UChar32 value) You probably don't need this for XML. This is a strange HTML legacy thing. > Source/WebCore/xml/parser/XMLCharacterReferenceParser.cpp:94 > +bool consumeCharacterReference(SegmentedString& source, Vector<UChar, 16>& decodedCharacter, bool& notEnoughCharacters) You should be able to share almost all of this code with the HTML version by taking convertToUTF16 as a template parameter.
Adam Barth
Comment 3 2011-07-12 16:52:10 PDT
Comment on attachment 100586 [details] Patch I'm going to make this r- to encourage you to share more code using a template.
Vicki Pfau
Comment 4 2011-07-13 17:57:44 PDT
Adam Barth
Comment 5 2011-07-13 18:45:50 PDT
Comment on attachment 100743 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=100743&action=review This looks great. We could od some work to fixup some naming mistakes I made when writing this code originally, but that's nto a big deal. (The most pervasive one is renaming "cc" to either currentCharacter or "c" as appropriate.) > Source/WebCore/xml/parser/CharacterReferenceParserInlineMethods.h:28 > +#ifndef CharacterReferenceParserInlineMethods_h > +#define CharacterReferenceParserInlineMethods_h I'd drop the word "Methods" from the name of this file/ > Source/WebCore/xml/parser/CharacterReferenceParserInlineMethods.h:51 > +template <typename ParserFunctions> > +inline bool consumeCharacterReference(SegmentedString& source, Vector<UChar, 16>& decodedCharacter, bool& notEnoughCharacters, UChar additionalAllowedCharacter) jamesr says to get rid of this inline keyword. That's probably the right. The compiler will probably just generate an unconditional jump anyway. > Source/WebCore/xml/parser/XMLCharacterReferenceParser.cpp:45 > + return 0xFFFD; bad indents in this file. > Source/WebCore/xml/parser/XMLCharacterReferenceParser.cpp:66 > + ASSERT_NOT_REACHED(); Do you mean notImplemented() ?
Adam Barth
Comment 6 2011-07-13 18:46:21 PDT
You should also listen to whatever suggestions jamesr has.
Vicki Pfau
Comment 7 2011-07-14 12:15:35 PDT
Created attachment 100840 [details] Patch for landing
WebKit Review Bot
Comment 8 2011-07-14 13:08:23 PDT
Comment on attachment 100840 [details] Patch for landing Clearing flags on attachment: 100840 Committed r91025: <http://trac.webkit.org/changeset/91025>
WebKit Review Bot
Comment 9 2011-07-14 13:08:28 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.