Bug 65578 - Add namespace prefix support in XML tokenizer
Summary: Add namespace prefix support in XML tokenizer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Vicki Pfau
URL:
Keywords:
Depends on:
Blocks: 64396
  Show dependency treegraph
 
Reported: 2011-08-02 15:44 PDT by Vicki Pfau
Modified: 2011-08-02 17:04 PDT (History)
2 users (show)

See Also:


Attachments
Patch (16.70 KB, patch)
2011-08-02 15:48 PDT, Vicki Pfau
no flags Details | Formatted Diff | Diff
Patch for landing (16.78 KB, patch)
2011-08-02 16:48 PDT, Vicki Pfau
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.