Bug 123496 - Unguard Element::childShouldCreateRenderer
Summary: Unguard Element::childShouldCreateRenderer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: MathML (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: ChangSeok Oh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-29 23:49 PDT by ChangSeok Oh
Modified: 2013-10-30 10:19 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.30 KB, patch)
2013-10-30 00:47 PDT, ChangSeok Oh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ChangSeok Oh 2013-10-29 23:49:15 PDT
The declaration of 1Element::childShouldCreateRenderer is guarded with MATHML and SVG.
But it causes a link error when disabling svg because of missing MATHML flag for the definition of Element::childShouldCreateRenderer.
Even we add a MATHML flag for it, you would face a compile error caused by SVGNames. we could avoid it like following but I think it's an abuse of flags.

#if ENABLE(SVG) || ENABLE(MATHML)
bool Element::childShouldCreateRenderer(const Node* child) const
{
#if ENABLE(SVG)
    // Only create renderers for SVG elements whose parents are SVG elements, or for proper <svg xmlns="svgNS"> subdocuments.                                                    
    if (child->isSVGElement())
        return child->hasTagName(SVGNames::svgTag) || isSVGElement();
#endif
    return ContainerNode::childShouldCreateRenderer(child);
}

So I propose removing the two guards from Element::childShouldCreateRenderer. I believe there would be no harm.
Comment 1 ChangSeok Oh 2013-10-30 00:47:13 PDT
Created attachment 215477 [details]
Patch
Comment 2 WebKit Commit Bot 2013-10-30 10:19:24 PDT
Comment on attachment 215477 [details]
Patch

Clearing flags on attachment: 215477

Committed r158275: <http://trac.webkit.org/changeset/158275>
Comment 3 WebKit Commit Bot 2013-10-30 10:19:26 PDT
All reviewed patches have been landed.  Closing bug.