Bug 43866

Summary: The #if clause enabling a feature should avoid the all includes of the feature
Product: WebKit Reporter: Alejandro G. Castro <alex>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 42266    
Attachments:
Description Flags
Proposed patch levin: review+

Description Alejandro G. Castro 2010-08-11 12:21:54 PDT
In this moment we are generating code like this:

...
#include "config.h"
#include "MathMLElementFactory.h"
#include "MathMLNames.h"

#if ENABLE(MATHML)

#include "MathMLMathElement.h"
#include "MathMLInlineContainerElement.h"
#include "MathMLTextElement.h"
#include "MathMLElement.h"
#include <wtf/HashMap.h>
...

This causes problems when you disable a feature because the includes add the symbols from the .h which are going to be undefined when you try to link the library, in gtk it fails linking our unit tests. To solve this issue we could generate something like this:

...
#include "config.h"

#if ENABLE(MATHML)

#include "MathMLElementFactory.h"
#include "MathMLNames.h"
#include "MathMLMathElement.h"
#include "MathMLInlineContainerElement.h"
#include "MathMLTextElement.h"
#include "MathMLElement.h"
#include <wtf/HashMap.h>
...
Comment 1 Alejandro G. Castro 2010-08-11 12:23:50 PDT
Created attachment 64146 [details]
Proposed patch
Comment 2 Alejandro G. Castro 2010-08-12 01:07:21 PDT
Landed r65223
Comment 3 Lucas Forschler 2019-02-06 09:02:50 PST
Mass moving XML DOM bugs to the "DOM" Component.