[Webkit-unassigned] [Bug 74775] WebKit editing throws exception when monochrome color dragged onto text

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 21 11:30:42 PST 2011


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





--- Comment #10 from Daniel Jalkut <jalkut at red-sweater.com>  2011-12-21 11:30:41 PST ---
(In reply to comment #6)
> (From update of attachment 120196 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=120196&action=review
> 
> > Source/WebCore/platform/mac/DragDataMac.mm:121
> >      NSColor *color = [NSColor colorFromPasteboard:m_pasteboard.get()];
> > +    
> > +    // The supplied color may not be in an RGB colorspace. This commonly occurs when e.g.
> > +    // a color is dragged from the NSColorPanel grayscale picker. Before we attempt to access RGB components,
> > +    // ensure it's appropriately converted to an RGB colorspace.
> > +    if ([[color colorSpace] colorSpaceModel] != NSRGBColorSpaceModel) {
> > +        color = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
> > +    }
> 
> Why not call that method unconditionally? Is there a case that would behave worse? We don’t put braces around a single-line if statement body in WebKit codings style.
> 
> I suggest removing the third sentence of that comment, since it just repeats what the code does.

My thinking for testing is that there could be some nuance of the color that a client wants to be conveyed and preserved without a potentially lossy conversion. Since I have to pick a specific RGB-model colorspace to convert to, doing so unilaterally would e.g. convert a device-RGB or custom-colorspace color to calibrated RGB colorspace when it's not called for.

-- 
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