WebCore:
Reviewed by Darin.
<rdar://problem/
3758033> REGRESSION (Mail): Support attributes in marked text (International input)
* khtml/rendering/render_text.cpp:
(InlineTextBox::paint): Support painting custom underline markers for
marked text in place of generic yellow.
(InlineTextBox::paintMarkedTextUnderline): New method that handles this.
* khtml/rendering/render_text.h:
* kwq/KWQKHTMLPart.h: Declare new methods and structs.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::clear): Clear marked test underlines.
(KWQKHTMLPart::setMarkedTextRange): Takes attributes and ranges now.
(convertAttributesToUnderlines): Converts NSAttributedString attributes
to simplified and C++-friendly form.
(KWQKHTMLPart::markedTextUsesUnderlines): New method.
(KWQKHTMLPart::markedTextUnderlines): New method.
* kwq/KWQPainter.mm:
(QPainter::drawLineForText): Handle pen width.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge setMarkedTextDOMRange:customAttributes:ranges:]): Take attributes
and ranges.
* kwq/WebCoreTextRenderer.h:
WebKit:
Reviewed by Darin.
<rdar://problem/
3758033> REGRESSION (Mail): Support attributes in marked text (International input)
* WebCoreSupport.subproj/WebTextRenderer.m:
(-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]): Changed to support
underline thickness. Also added a bit of a hack here to move thickness 2 underlines down by
.5 pixels, since the rendering engine can't give a fractional pixel offset.
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView validAttributesForMarkedText]): Support underline, underline color and marked
clause attributes. Others that NSText supports are unimplemented for now.
(-[WebHTMLView firstRectForCharacterRange:]): Remove needless logging.
(-[WebHTMLView unmarkText]): Updated for new WebCore SPI.
(-[WebHTMLView _extractAttributes:ranges:fromAttributedString:]): New method to pull the attributes
and ranges out of an attributed string.
(-[WebHTMLView setMarkedText:selectedRange:]): Extract attributes and pass to WebCore.
(-[WebHTMLView insertText:]): Add comment noting that we don't really handle attributed strings
here.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8360
268f45cc-cd09-0410-ab3c-
d52691b4dbfc