Bug 115931 - REGRESSION: Lines jump up and down while typing Chinese or Japanese
Summary: REGRESSION: Lines jump up and down while typing Chinese or Japanese
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-05-10 13:32 PDT by Ryosuke Niwa
Modified: 2013-06-07 10:58 PDT (History)
7 users (show)

See Also:


Attachments
Fix (without change log) (3.18 KB, patch)
2013-05-10 13:35 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Fixes one bug (4.33 KB, patch)
2013-05-10 17:09 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Reverted erroneous test change (3.20 KB, patch)
2013-05-10 17:10 PDT, Ryosuke Niwa
darin: review+
Details | Formatted Diff | Diff
More comprehensive WIP fix (15.49 KB, patch)
2013-06-05 17:17 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Fixes the bug (17.80 KB, patch)
2013-06-06 19:12 PDT, Ryosuke Niwa
darin: review+
Details | Formatted Diff | Diff
A/B test results (39.33 KB, text/html)
2013-06-06 21:31 PDT, Ryosuke Niwa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-05-10 13:32:08 PDT
Fallback fonts are not used when computing line heights in some cases.
Comment 1 Ryosuke Niwa 2013-05-10 13:35:22 PDT
Created attachment 201416 [details]
Fix (without change log)
Comment 2 Ryosuke Niwa 2013-05-10 13:35:32 PDT
<rdar://problem/12803147>
Comment 3 Ryosuke Niwa 2013-05-10 17:09:46 PDT
Created attachment 201441 [details]
Fixes one bug
Comment 4 Ryosuke Niwa 2013-05-10 17:10:39 PDT
Created attachment 201442 [details]
Reverted erroneous test change
Comment 5 Darin Adler 2013-05-10 17:55:38 PDT
Comment on attachment 201442 [details]
Reverted erroneous test change

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

> Source/WebCore/rendering/RenderBlockLineLayout.cpp:3094
> +                    if (wordMeasurement.fallbackFonts.isEmpty() && !fallbackFonts.isEmpty())
> +                        wordMeasurement.fallbackFonts.swap(fallbackFonts);

Sure could use a why comment.
Comment 6 Ryosuke Niwa 2013-06-05 17:17:24 PDT
Created attachment 203893 [details]
More comprehensive WIP fix

There was more fundamental flaw in our code.
Comment 7 Ryosuke Niwa 2013-06-06 19:12:16 PDT
Created attachment 203991 [details]
Fixes the bug
Comment 8 mitz 2013-06-06 19:18:56 PDT
I thought passing a NULL fallbackFonts pointer into floatWidthFor{Simple,Complex}Text was a significant optimization. Have you checked whether this patch has any impact performance?
Comment 9 Ryosuke Niwa 2013-06-06 19:41:41 PDT
(In reply to comment #8)
> I thought passing a NULL fallbackFonts pointer into floatWidthFor{Simple,Complex}Text was a significant optimization. Have you checked whether this patch has any impact performance?

Yeah, I'm getting the numbers now.
Comment 10 Ryosuke Niwa 2013-06-06 21:31:52 PDT
Created attachment 203994 [details]
A/B test results

Thankfully I don't see any regression from running some perf. tests but please let me know if there is some other benchmark or page where this patch may cause a regression.
Comment 11 Darin Adler 2013-06-07 07:15:05 PDT
Comment on attachment 203991 [details]
Fixes the bug

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

I hope creating and destroying these empty hash sets is inexpensive enough.

> Source/WebCore/platform/graphics/Font.cpp:325
> +    ASSERT(fallbackFonts);

This assertion is really unnecessary. The code that guarantees this is non-zero is just a couple lines up from here.
Comment 12 Ryosuke Niwa 2013-06-07 10:58:36 PDT
(In reply to comment #11)
> (From update of attachment 203991 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=203991&action=review
> 
> I hope creating and destroying these empty hash sets is inexpensive enough.

I think andersca optimized empty hash maps recently to reduce the memory usage, etc... so HashTable only initializes various member variables to 0 now.

> > Source/WebCore/platform/graphics/Font.cpp:325
> > +    ASSERT(fallbackFonts);
> 
> This assertion is really unnecessary. The code that guarantees this is non-zero is just a couple lines up from here.

Removed.
Comment 13 Ryosuke Niwa 2013-06-07 10:58:59 PDT
Committed r151327: <http://trac.webkit.org/changeset/151327>