Bug 4557 - rename unusual strcmp and strcasecmp for DOMString family
Summary: rename unusual strcmp and strcasecmp for DOMString family
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Enhancement
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-21 09:52 PDT by Darin Adler
Modified: 2019-02-06 09:02 PST (History)
1 user (show)

See Also:


Attachments
patch with the abovementioned changes (203.91 KB, patch)
2005-08-21 09:53 PDT, Darin Adler
no flags Details | Formatted Diff | Diff
new patch, updated for today's TOT (95.89 KB, patch)
2005-09-05 10:59 PDT, Darin Adler
no flags Details | Formatted Diff | Diff
refined a tiny bit more (95.79 KB, patch)
2005-09-05 11:04 PDT, Darin Adler
no flags Details | Formatted Diff | Diff
uploading it again (fixed a mistake: sorry for the multiple copies) (96.25 KB, patch)
2005-09-05 11:18 PDT, Darin Adler
no flags Details | Formatted Diff | Diff
patch that just fixes a function mistakenly renamed to qstring() (8.33 KB, patch)
2005-09-06 09:05 PDT, Darin Adler
no flags Details | Formatted Diff | Diff
eliminate strcmp, and replace strcasecmp with equalIgnoringCase (62.01 KB, patch)
2005-12-29 17:54 PST, Darin Adler
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2005-08-21 09:52:51 PDT
I'm going to attach a patch with some DOMString and AtomicString improvements. Here are some of 
what's included:

    1) rename the unwieldy implementation() to impl()
    2) make more member functions inline
    3) remove the strange "strcmp" functions that return booleans
    4) replace the strange "strcasecmp" with "equalsIgnoringCase"
    5) add features so you can lowercase a string as it's created -- in the case of AtomicString, it can be 
done without copying the string
Comment 1 Darin Adler 2005-08-21 09:53:38 PDT
Created attachment 3492 [details]
patch with the abovementioned changes
Comment 2 Eric Seidel (no email) 2005-08-22 01:57:01 PDT
Just FYI... KDOM just went through and changed DOMString::implementation() to DOMString::handle()
Comment 3 Darin Adler 2005-08-22 08:50:36 PDT
Given that the name of the class is DOMStringImpl I think impl() is a better name than handle(), but I could 
be convinced otherwise.
Comment 4 Maciej Stachowiak 2005-08-28 19:07:48 PDT
impl() is a better name than handle(). It would be much nicer if these changes could be split into 
independent patches, especially the mechanical but huge implementation()/impl() converstion. I'm willing 
to rubber-stamp a global search-and-replace to do that by itself.
Comment 5 Darin Adler 2005-09-05 10:59:58 PDT
Created attachment 3769 [details]
new patch, updated for today's TOT
Comment 6 Darin Adler 2005-09-05 11:04:16 PDT
Created attachment 3770 [details]
refined a tiny bit more
Comment 7 Darin Adler 2005-09-05 11:18:05 PDT
Created attachment 3771 [details]
uploading it again (fixed a mistake: sorry for the multiple copies)
Comment 8 Darin Adler 2005-09-06 09:05:51 PDT
Created attachment 3786 [details]
patch that just fixes a function mistakenly renamed to qstring()
Comment 9 John Sullivan 2005-09-06 09:13:55 PDT
Comment on attachment 3786 [details]
patch that just fixes a function mistakenly renamed to qstring()

What does removing XMLElementImpl::XMLElementImpl have to do with the rest of
this patch?
Comment 10 Darin Adler 2005-09-06 09:26:03 PDT
Nothing.

That's just commented-out unused code that should be removed no matter what.
Comment 11 Eric Seidel (no email) 2005-09-10 20:58:38 PDT
Comment on attachment 3786 [details]
patch that just fixes a function mistakenly renamed to qstring()

Simple patch.  Looks fine to me.
Comment 12 Darin Adler 2005-09-10 22:16:18 PDT
Comment on attachment 3786 [details]
patch that just fixes a function mistakenly renamed to qstring()

I landed this patch, so I think I'll take the review flag off it.
Comment 13 Darin Adler 2005-12-29 17:54:28 PST
Created attachment 5361 [details]
eliminate strcmp, and replace strcasecmp with equalIgnoringCase
Comment 14 Maciej Stachowiak 2005-12-29 20:18:09 PST
Mostly looks good, though I'm not sure about adding new public constructors to DOMStringImpl without 
implementing them yet:

> +    DOMStringImpl(const QChar*, unsigned length, Lowercased);
Comment 15 Maciej Stachowiak 2005-12-30 02:16:09 PST
Comment on attachment 5361 [details]
eliminate strcmp, and replace strcasecmp with equalIgnoringCase

r=me but please consider the comment above. Also, perhaps ALLOC_QCHAR_VEC and
DELETE_QCHAR_VEC could be given normal looking function names now, as long as
you are renaming them.
Comment 16 Darin Adler 2005-12-30 11:41:18 PST
Making Maciej's requested changes and landing the patch.
Comment 17 Lucas Forschler 2019-02-06 09:02:46 PST
Mass moving XML DOM bugs to the "DOM" Component.