WebCore:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2005 19:09:58 +0000 (19:09 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2005 19:09:58 +0000 (19:09 +0000)
commitb681f9377b3487c1612c88ca5aa60c6c3fa9f86e
tree66b66ea8c5c9cb1c20fa1738b6d73671b32af09c
parent303c3c2486900c10daa2d5cb76b75f9a97085af7
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
12 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_text.cpp
WebCore/khtml/rendering/render_text.h
WebCore/kwq/KWQKHTMLPart.h
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/KWQPainter.mm
WebCore/kwq/WebCoreBridge.h
WebCore/kwq/WebCoreBridge.mm
WebCore/kwq/WebCoreTextRenderer.h
WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebTextRenderer.m
WebKit/WebView.subproj/WebHTMLView.m