Bug 87799 - Implement CSSParser::determineNameInNamespace() as a helper function for CSSGrammar.y
Summary: Implement CSSParser::determineNameInNamespace() as a helper function for CSSG...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks: 87625
  Show dependency treegraph
 
Reported: 2012-05-29 17:49 PDT by Kentaro Hara
Modified: 2012-05-30 23:25 PDT (History)
6 users (show)

See Also:


Attachments
Patch (5.13 KB, patch)
2012-05-29 17:53 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff
patch for landing (5.33 KB, patch)
2012-05-30 17:03 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2012-05-29 17:49:10 PDT
As pointed out by darin@ in https://bugs.webkit.org/show_bug.cgi?id=87627#c12, we should avoid repeating the following code in CSSGrammar.y:

>          if (p->m_styleSheet)
>            $$->setTag(QualifiedName(namespacePrefix, $2, p->m_styleSheet->determineNamespace(namespacePrefix)));
>          else
>            $$->setTag(QualifiedName(namespacePrefix, $2, p->m_defaultNamespace));

We can implement CSSParser::determineNameInNamespace() as a helper function and replace the above code.
Comment 1 Kentaro Hara 2012-05-29 17:53:52 PDT
Created attachment 144663 [details]
Patch
Comment 2 Darin Adler 2012-05-30 09:39:50 PDT
Comment on attachment 144663 [details]
Patch

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

> Source/WebCore/css/CSSGrammar.y:960
> +        $$->setTag(p->determineNameInNamespace(namespacePrefix, $2));

We should get rid of the namespacePrefix local variable and just use $1 here.

> Source/WebCore/css/CSSGrammar.y:1089
> +        $$->setAttribute(p->determineNameInNamespace(namespacePrefix, $4));

Same with $3 here.

> Source/WebCore/css/CSSGrammar.y:1096
> +        $$->setAttribute(p->determineNameInNamespace(namespacePrefix, $4));

Same with $3 here.
Comment 3 Kentaro Hara 2012-05-30 17:03:15 PDT
Created attachment 144951 [details]
patch for landing
Comment 4 WebKit Review Bot 2012-05-30 23:24:10 PDT
Comment on attachment 144951 [details]
patch for landing

Clearing flags on attachment: 144951

Committed r119060: <http://trac.webkit.org/changeset/119060>