Bug 65145 - SVG and HTML editing have conflicting inline isWhitespace functions
Summary: SVG and HTML editing have conflicting inline isWhitespace functions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-25 15:55 PDT by Darin Adler
Modified: 2011-08-18 05:25 PDT (History)
3 users (show)

See Also:


Attachments
Patch (16.90 KB, patch)
2011-08-17 16:24 PDT, Darin Adler
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2011-07-25 15:55:32 PDT
There is a function named isWhitespace in SVG and another in HTML Editing. Both are in the WebCore namespace, both are inline, but they have different contents.
Comment 1 Dirk Schulze 2011-07-25 23:26:42 PDT
Thats correct. Do you want to rename one of the functions? What is the problem? As long as you do not include SVGParserUtills.h into headers it should work.
Comment 2 Darin Adler 2011-07-26 14:30:57 PDT
(In reply to comment #1)
> Thats correct. Do you want to rename one of the functions?

Yes.

> What is the problem? As long as you do not include SVGParserUtills.h into headers it should work.

There are two problems:

    1) It's not good for us two have two different functions with the same name that do similar but different things. Even if these functions were guaranteed never to conflict, it's a recipe for confusion.

    1) Even though this currently works, it is not guaranteed to work. These functions are marked inline, but do not have internal linkage. The C++ standard does not allow two different functions with the same name with external linkage and different definitions. One thing that keeps this from being a practical problem right now is that the SVG function takes a const UChar& instead of a UChar so the functions are distinct. But that's actually a mistake. It's not good to have the function take a const UChar&.

I have a patch that fixes it by renaming the SVG parser utilities functions. I think you’ll probably like that patch.
Comment 3 Darin Adler 2011-08-17 16:24:24 PDT
Created attachment 104273 [details]
Patch
Comment 4 Nikolas Zimmermann 2011-08-18 00:33:46 PDT
Comment on attachment 104273 [details]
Patch

Looks reasonable, r=me.
Comment 5 WebKit Review Bot 2011-08-18 05:25:19 PDT
Comment on attachment 104273 [details]
Patch

Clearing flags on attachment: 104273

Committed r93300: <http://trac.webkit.org/changeset/93300>
Comment 6 WebKit Review Bot 2011-08-18 05:25:24 PDT
All reviewed patches have been landed.  Closing bug.