[Webkit-unassigned] [Bug 34030] ClipboardMac::setData() should be case-insensitive for the format parameter

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 4 15:35:19 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=34030





--- Comment #10 from dcheng at google.com  2010-02-04 15:35:19 PST ---
(In reply to comment #9)
> (From update of attachment 48090 [details])
> Change seems OK.
> 
> The preferred way to compare and ignore case differences is to use the
> equalIgnoringCase function and the CaseFoldingHash hash function. I'd prefer to
> see it working that way.

The way I interpret the spec, the UA ought to lower case all formats. That
being said, I think there are problems with either approach.

If we only use equalIgnoringCase and CaseFoldingHash, it becomes much harder to
deal with the system pasteboard. For example, in qt, removing a format from the
clipboard is done with this snippet:
  m_writableData->removeFormat(qType);
To implement that, a UA would need to enumerate all types in the clipboard and
then compare each one in a case-insensitive manner. In addition, what happens
when multiple formats match?

However, if we convert everything to lowercase, then there are native
pasteboard/drag and drop types the interface will never be able to retrieve.

Given the problems with both approaches, maybe the spec should actually say:
Only "text" and "url" should be treated in a case-insensitive manner; all other
format names must be handled in a case-sensitive manner. What do you think?

> 
> The use of "q" in "qType" is an ancient relic from when WebCore/platform didn’t
> exist and the code was using QString. So it’s strange to introduce it in new
> code.

Interesting. I didn't know that; I took the naming from WebCore/platform/win.
I'll change it with next update to this patch.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list