Bug 65578

Summary: Add namespace prefix support in XML tokenizer
Product: WebKit Reporter: Vicki Pfau <jeffrey+webkit>
Component: New BugsAssignee: Vicki Pfau <jeffrey+webkit>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 64396    
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Vicki Pfau 2011-08-02 15:44:52 PDT
Add namespace prefix support in XML tokenizer
Comment 1 Vicki Pfau 2011-08-02 15:48:31 PDT
Created attachment 102707 [details]
Patch
Comment 2 Adam Barth 2011-08-02 16:11:13 PDT
Comment on attachment 102707 [details]
Patch

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

> Source/WebCore/xml/parser/XMLToken.h:66
> +        : m_hasStandalone(false)
> +        , m_hasEncoding(false)
> +        , m_standalone(false)

Bad indent.  :)

> Source/WebCore/xml/parser/XMLToken.h:206
> +        m_target.swap(m_data);

Is this a copy?  m_data is stored using inline capacity.  It might be better to write directly into m_target.
Comment 3 Vicki Pfau 2011-08-02 16:21:15 PDT
(In reply to comment #2)
> (From update of attachment 102707 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=102707&action=review
> 
> > Source/WebCore/xml/parser/XMLToken.h:66
> > +        : m_hasStandalone(false)
> > +        , m_hasEncoding(false)
> > +        , m_standalone(false)
> 
> Bad indent.  :)

I keep doing this; you'd have thought I'd remember this by now :(

> > Source/WebCore/xml/parser/XMLToken.h:206
> > +        m_target.swap(m_data);
> 
> Is this a copy?  m_data is stored using inline capacity.  It might be better to write directly into m_target.

m_data needs to be cleared in the process, to make way for the local name of the tag. Would an assign and a clear make more sense than a swap? It might make sense to leave this in the back of our minds, but for now, it's functional.
Comment 4 Adam Barth 2011-08-02 16:24:15 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 102707 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=102707&action=review
> > 
> > > Source/WebCore/xml/parser/XMLToken.h:206
> > > +        m_target.swap(m_data);
> > 
> > Is this a copy?  m_data is stored using inline capacity.  It might be better to write directly into m_target.
> 
> m_data needs to be cleared in the process, to make way for the local name of the tag. Would an assign and a clear make more sense than a swap? It might make sense to leave this in the back of our minds, but for now, it's functional.

Ah, the problem is you don't know ahead of time that this is a prefix, so you need to copy out.  I'd add a FIXME to try to remove the copy.  It could get expensive if every element and attribute has a prefix.
Comment 5 Vicki Pfau 2011-08-02 16:48:50 PDT
Created attachment 102715 [details]
Patch for landing
Comment 6 WebKit Review Bot 2011-08-02 17:04:20 PDT
Comment on attachment 102715 [details]
Patch for landing

Clearing flags on attachment: 102715

Committed r92249: <http://trac.webkit.org/changeset/92249>
Comment 7 WebKit Review Bot 2011-08-02 17:04:25 PDT
All reviewed patches have been landed.  Closing bug.