Bug 109408

Summary: Remove AttributeBase now that NEW_XML is gone
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: New BugsAssignee: Eric Seidel (no email) <eric>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ojan.autocc, tonyg, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 107522    
Attachments:
Description Flags
Patch none

Description Eric Seidel (no email) 2013-02-11 01:05:00 PST
Remove AttributeBase now that NEW_XML is gone
Comment 1 Eric Seidel (no email) 2013-02-11 01:07:36 PST
Created attachment 187523 [details]
Patch
Comment 2 WebKit Review Bot 2013-02-11 08:54:05 PST
Comment on attachment 187523 [details]
Patch

Clearing flags on attachment: 187523

Committed r142480: <http://trac.webkit.org/changeset/142480>
Comment 3 WebKit Review Bot 2013-02-11 08:54:08 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Darin Adler 2013-02-11 08:59:41 PST
Comment on attachment 187523 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=187523&action=review

> Source/WebCore/xml/parser/MarkupTokenBase.h:67
> +    class Attribute {
> +    public:
> +        class Range {
> +        public:
> +            int m_start;
> +            int m_end;
> +        };
> +
> +        Range m_nameRange;
> +        Range m_valueRange;
> +        WTF::Vector<UChar, 32> m_name;
> +        WTF::Vector<UChar, 32> m_value;
> +    };

The WTF:: prefixes here are not needed.

Also, I notice a WebKit coding style anti-pattern here. In WebKit we use private data members, not public ones. When we want something with private data, we use struct, not class, and we name the data members without "m_" prefixes. So in WebKit coding style this would be:

struct Attribute {
    struct Range {
        int start;
        int end;
    };
    Range nameRange;
    Range valueRange;
    Vector<UChar, 32> name;
    Vector<UChar, 32> value;
};
Comment 5 Eric Seidel (no email) 2013-02-11 09:09:01 PST
Agreed.  Happy to fix the style in a follow-up patch.
Comment 6 Eric Seidel (no email) 2013-02-11 10:57:55 PST
I looked at this this morning.  gonna wait to fix this until we've killed MarkupTokenBase so that we can use String and AtomicString in this file. (which it currently seems to be avoiding).
Comment 7 Eric Seidel (no email) 2013-02-12 17:32:34 PST
(In reply to comment #4)
> (From update of attachment 187523 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=187523&action=review
> The WTF:: prefixes here are not needed.
> 
> Also, I notice a WebKit coding style anti-pattern here. In WebKit we use private data members, not public ones. When we want something with private data, we use struct, not class, and we name the data members without "m_" prefixes. So in WebKit coding style this would be:

Fixed in bug 109638