Bug 16994 - SmartReplace.cpp isn't implemented for platforms without CoreFoundation
Summary: SmartReplace.cpp isn't implemented for platforms without CoreFoundation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-24 12:44 PST by Tony Chang
Modified: 2008-02-04 21:50 PST (History)
0 users

See Also:


Attachments
implement WebCore::isCharacterSmartReplaceExempt (3.51 KB, patch)
2008-01-24 12:45 PST, Tony Chang
darin: review-
Details | Formatted Diff | Diff
take 2 (3.54 KB, patch)
2008-01-28 18:02 PST, Tony Chang
darin: review-
Details | Formatted Diff | Diff
take 3 (3.54 KB, patch)
2008-02-01 17:23 PST, Tony Chang
darin: review+
Details | Formatted Diff | Diff
in a separate file (5.07 KB, patch)
2008-02-01 17:24 PST, Tony Chang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chang 2008-01-24 12:44:23 PST
The method WebCore::isCharacterSmartReplaceExempt is needed for smart paste to work.  It's currently unimplemented unless CoreFoundation is in the build.  I have a patch coming up that implements this method using ICU directly.
Comment 1 Tony Chang 2008-01-24 12:45:47 PST
Created attachment 18638 [details]
implement WebCore::isCharacterSmartReplaceExempt

This is mostly translation of the method found in SmartReplaceCF.cpp.  No new tests since this behavior is tested by existing layout tests.
Comment 2 Darin Adler 2008-01-26 08:25:25 PST
Comment on attachment 18638 [details]
implement WebCore::isCharacterSmartReplaceExempt

Code looks fine, but it's not platform-independent since it uses ICU; not all ports of WebCore have ICU, and it's not acceptable to just have ICU code without any ifdefs. It should go into a file named SmartReplaceICU.cpp and be properly ifdef'd. Otherwise, fine.

+        // Nice to have, added in ICU 3.8.
+        //uset_freeze(smartSet);

This can be ifdef'd based on the ICU headers. It would be better to either include it for real or not. We don't normally include commented out code.

The if is "#if USE (ICU_UNICODE)" I believe. You should look for an example.
Comment 3 Tony Chang 2008-01-28 18:02:14 PST
Created attachment 18752 [details]
take 2

Same as before with #ifdef USE(ICU_UNICODE) guards.
Comment 4 Eric Seidel (no email) 2008-01-28 23:01:13 PST
Comment on attachment 18752 [details]
take 2

This still should be in its own SmartReplaceICU.cpp instead of an #ifdef in SmartReplace.cpp.  We're trying to kill all the #ifdefs over time.
Comment 5 Darin Adler 2008-01-29 07:49:03 PST
Comment on attachment 18752 [details]
take 2

+#ifdef USE(ICU_UNICODE)

That's incorrect. It needs to be:

#if USE(ICU_UNICODE)

And the ICU version should really be in a different file, as the CF version is.

review- because of the ifdef/if issue.
Comment 6 Darin Adler 2008-01-29 07:49:04 PST
Comment on attachment 18752 [details]
take 2

+#ifdef USE(ICU_UNICODE)

That's incorrect. It needs to be:

#if USE(ICU_UNICODE)

And the ICU version should really be in a different file, as the CF version is.

review- because of the ifdef/if issue.
Comment 7 Tony Chang 2008-02-01 17:23:10 PST
Created attachment 18861 [details]
take 3

Fix the preprocessor commands.
Comment 8 Tony Chang 2008-02-01 17:24:14 PST
Created attachment 18862 [details]
in a separate file

Here's a version with the code in a separate file.  I'm not sure which build config files needed to be updated to pick up the new file (as in, I don't know which builds use ICU and which don't).
Comment 9 Darin Adler 2008-02-03 13:22:13 PST
Comment on attachment 18861 [details]
take 3

OK. r=me
Comment 10 Mark Rowe (bdash) 2008-02-04 21:50:21 PST
Landed in r29990 with the necessary tweaks to be used in the Gtk and wxWidget ports.  Thanks for the patch!