Bug 127324

Summary: REGRESSION (r160259): text-combine glyphs are not rendered
Product: WebKit Reporter: hro.sug1no
Component: TextAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, d-r, esprehn+autocc, fmalita, glenn, gyuyoung.kim, koivisto, kondapallykalyan, pdr, schenney, sergio, webkit-bug-importer, yuki.sekiguchi
Priority: P1 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: OS X 10.9   
URL: http://trac.webkit.org/browser/trunk/LayoutTests/fast/text/emphasis-combined-text.html
Attachments:
Description Flags
result image (safari 7.0.1 and r161096, osx 10.9.1 )
none
Patch
dino: review+
Removed const and fixed typo
none
Patch
none
Patch
none
patch kling: review+

Description hro.sug1no 2014-01-20 17:27:19 PST
Created attachment 221706 [details]
result image (safari 7.0.1 and r161096, osx 10.9.1 )

r161096, osx 10.9.1.

text-combine glyphs are not rendered.

please refer to the attached image.
Comment 1 Yuki Sekiguchi 2014-02-06 03:00:52 PST
Created attachment 223322 [details]
Patch
Comment 2 Yuki Sekiguchi 2014-02-06 03:01:08 PST
This may be regression of r160259.
Comment 3 Yuki Sekiguchi 2014-02-06 03:08:55 PST
Hi Antti, Darin,

Could you review this patch?

This may be regression of r160259.
It is written by Antti and reviewed by Darin.
Comment 4 Radar WebKit Bug Importer 2014-02-06 09:33:37 PST
<rdar://problem/16002163>
Comment 5 Dean Jackson 2014-02-13 17:19:14 PST
Comment on attachment 223322 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=223322&action=review

> Source/WebCore/rendering/RenderCombineText.cpp:54
> +void RenderCombineText::setTextInternal(const String& text, const bool replace)

No need for const in front of bool.

> Source/WebCore/rendering/RenderCombineText.h:52
> +    virtual void setTextInternal(const String&, const bool repace = false) override;

Same here. Also, you have a typo "replace" not "repace"

> Source/WebCore/rendering/RenderText.cpp:1027
> +void RenderText::setTextInternal(const String& text, const bool replace)

And here.
Comment 6 Yuki Sekiguchi 2014-02-13 20:12:14 PST
Created attachment 224153 [details]
Removed const and fixed typo
Comment 7 Yuki Sekiguchi 2014-02-13 20:16:06 PST
(In reply to comment #5)
> (From update of attachment 223322 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=223322&action=review
> 
> > Source/WebCore/rendering/RenderCombineText.cpp:54
> > +void RenderCombineText::setTextInternal(const String& text, const bool replace)
> 
> No need for const in front of bool.

Fixed.

> > Source/WebCore/rendering/RenderCombineText.h:52
> > +    virtual void setTextInternal(const String&, const bool repace = false) override;
> 
> Same here. Also, you have a typo "replace" not "repace"

Fixed.

> > Source/WebCore/rendering/RenderText.cpp:1027
> > +void RenderText::setTextInternal(const String& text, const bool replace)
> 
> And here.

Fixed.
Comment 8 Yuki Sekiguchi 2014-02-17 21:25:40 PST
Created attachment 224467 [details]
Patch
Comment 9 Antti Koivisto 2014-02-17 22:07:07 PST
Comment on attachment 224467 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=224467&action=review

I think at minimum this needs to have a good test case.

> Source/WebCore/ChangeLog:16
> +        No new tests.
> +        Image test of fast/text/international/text-combine-image-test.html covers this.

It shouldn't be hard to add a proper test for this that doesn't require running in pixel mode. Reftest (that is test.html/test-expected.html pair) might be easiest.

> Source/WebCore/rendering/svg/RenderSVGInlineText.h:55
> +    virtual void setTextInternal(const String&, bool replace = false) override;

It would be better to add an explicit API, RenderText::overrideOriginalTextForTextCombine or similar instead of adding a confusing new parameter. (Also I don't fully understand why RenderCombineText needs this special behavior.)
Comment 10 Yuki Sekiguchi 2014-02-18 02:55:08 PST
Hi Koivisto,

Thank you for reviewing.

(In reply to comment #9)
> (From update of attachment 224467 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=224467&action=review
> 
> I think at minimum this needs to have a good test case.
> 
> > Source/WebCore/ChangeLog:16
> > +        No new tests.
> > +        Image test of fast/text/international/text-combine-image-test.html covers this.
> 
> It shouldn't be hard to add a proper test for this that doesn't require running in pixel mode. Reftest (that is test.html/test-expected.html pair) might be easiest.

I tried to create reftest using text-orientation: upright, transform: rotate(-90deg) or writing-mode: vertical, but all of them draw horizontal text to different position from text-combine: horizontal.
Do you have any idea to create reftests?

> > Source/WebCore/rendering/svg/RenderSVGInlineText.h:55
> > +    virtual void setTextInternal(const String&, bool replace = false) override;
> 
> It would be better to add an explicit API, RenderText::overrideOriginalTextForTextCombine or similar instead of adding a confusing new parameter. (Also I don't fully understand why RenderCombineText needs this special behavior.)

r77153 says "If a new font found, we replace the text with 0xFFFC. This is needed for a combined text block to be able to behave like a single character against text decorations."
However, I don't think this replacement is not needed in the current code.

I'm creating removing replacement patch. This also fix odd line break in red border block in fast/text/international/text-combine-image-test.html. I'm investigating why this bug is fixed.

After the investigation is finished, I'll upload a patch and ask review. If you think this method is wrong, please correct me.
Comment 11 Yuki Sekiguchi 2014-02-18 21:15:11 PST
Created attachment 224586 [details]
Patch
Comment 12 Yuki Sekiguchi 2014-02-18 22:00:57 PST
(In reply to comment #10)
> Hi Koivisto,
> 
> Thank you for reviewing.
> 
> (In reply to comment #9)
> > (From update of attachment 224467 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=224467&action=review
> > > Source/WebCore/rendering/svg/RenderSVGInlineText.h:55
> > > +    virtual void setTextInternal(const String&, bool replace = false) override;
> > 
> > It would be better to add an explicit API, RenderText::overrideOriginalTextForTextCombine or similar instead of adding a confusing new parameter. (Also I don't fully understand why RenderCombineText needs this special behavior.)
> 
> r77153 says "If a new font found, we replace the text with 0xFFFC. This is needed for a combined text block to be able to behave like a single character against text decorations."
> However, I don't think this replacement is not needed in the current code.
> I'm creating removing replacement patch. This also fix odd line break in red border block in fast/text/international/text-combine-image-test.html. I'm investigating why this bug is fixed.
> 
> After the investigation is finished, I'll upload a patch and ask review. If you think this method is wrong, please correct me.

I noticed that line breaking needed this replacement. If we don't replace the original text, line breaking uses the original text to break lines, and it calculates wrong width for text-combine.
Added overrideOriginalTextForTextCombine() and used it instead of setTextInternal().
Comment 13 Antti Koivisto 2014-05-18 02:55:28 PDT
Created attachment 231655 [details]
patch
Comment 14 Andreas Kling 2014-05-18 03:10:11 PDT
Comment on attachment 231655 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=231655&action=review

r=me

> Source/WebCore/ChangeLog:8
> +        The original text gets overwriten by change that is supposed to affect rendered text only. 

Typo, overwritten.

> LayoutTests/ChangeLog:3
> +        REGRESSION (r160259?): text-combine glyphs are not rendered

Why the "?"
Comment 15 Antti Koivisto 2014-05-18 03:52:34 PDT
http://trac.webkit.org/changeset/169011