New issue
Advanced search Search tips

Issue 612119 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Text autosizing cluster multipliers are not consistent if the page loads slowly

Reported by cathiech...@gmail.com, May 16 2016

Issue description

Example URL:
http://x5.imtt.qq.com/2766651/textautosizer/bug.html

Steps to reproduce the problem:
open http://x5.imtt.qq.com/2766651/textautosizer/bug.html, and we can see the font size of contents is inconsistent.And there is a screenshot attached.

What is the expected behavior?

What went wrong?
<html>
	<head>...</head>
	<body>
	<!-- first parsed chunk-->
		<somenode>...</somenode>
		<div>have the exact fingerprint, but not enough text<div>
		<somenode>...</somenode>
		<somenode>...</somenode>
		<div>have the exact fingerprint, but not enough text<div>
		<somenode>...</somenode>
		many many nodes in here...

		<!-- first parsed chunk end-->

		<!-- second parsed chunk begin-->
		<somenode>...</somenode>
		<div>have the exact fingerprint, but not enough text<div>
		<somenode>...</somenode>
		<somenode>...</somenode>
		<div>have the exact fingerprint, have enough text, long long long long long long long long long long long long long long long enough text<div>
		<somenode>...</somenode>
		...
		<!-- second parsed chunk end-->
		...
	</body>
</html>

From my perspective:

In a long web page, clusters which have the same fingerPrint don't always in the same parsedChunk. For example: http://x5.imtt.qq.com/2766651/textautosizer/bug.html. the 'HasEnoughText' cluster isn't in the first parsedChunk (assuming it is in the second one). 
In the layout of the first parsedChunk, the clusters with the exact fingerPrint are 'NotEnoughText', so the multiplier is 1.0. And nodes in these clusters are successfully layout, and clearNeedsLayout.
Then here comes the second chunk, there is a 'HasEnoughText' cluster, so the multiplier applied is 2.0(or something bigger than 1.0). 
As the nodes in first chunk are clearNeedsLayout, they can never apply the correct multiplier. 

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? N/A 

Chrome version: 48.0.2564.95  Channel: n/a
OS Version: android 4.4.2
Flash Version: Shockwave Flash 21.0 r0
 
screenshot.jpg
52.6 KB View Download
Components: Blink>TextAutosize
Owner: pdr@chromium.org
Status: Assigned (was: Unconfirmed)
Components: -Blink

Comment 3 by pdr@chromium.org, Jul 8 2016

Cc: pdr@chromium.org
Owner: ----
Status: Available (was: Assigned)
Thanks cathiechen727@gmail.com, excellent analysis.

We could go back and synthesize the superclusters, or just keep them around between layouts. I'm going to mark this as available for now.

Comment 4 by pdr@chromium.org, Jul 12 2016

Summary: Text autosizing cluster multipliers are not consistent if the page loads slowly (was: In some forum pages, the multiplier don't apply properly)

Comment 5 by pdr@chromium.org, Jul 12 2016

Cc: skobes@chromium.org skyos...@chromium.org
 Issue 440511  has been merged into this issue.
Actually I wrote this html which can reproduce this issue easily.
jsChangedShortTextToLong.html
2.9 KB View Download

Comment 8 by pdr@chromium.org, Sep 12 2016

 Issue 358510  has been merged into this issue.
Project Member

Comment 9 by bugdroid1@chromium.org, Dec 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bf9901feb0c46cefbd5e7af40fe252a6a92d52cb

commit bf9901feb0c46cefbd5e7af40fe252a6a92d52cb
Author: cathiechen <cathiechen@tencent.com>
Date: Fri Dec 16 12:35:44 2016

Fix the inconsistent problem while the content of textNodes is changed.

If the text content of one node who share fingerPrint with others changed,
the multipiler of this node might be different from others.
This's the reason of this inconsistent problem.

The solution:
     1. Make superclusters across layouts
     2. Mark superclusters if needed
         2.1 new roots are added to superclusters
         2.2 old roots add some new contents
     3. Recalculate the multiplier of the marked superclusters during the first beginLayout().

BUG= 612119 

Review-Url: https://codereview.chromium.org/2299213003
Cr-Commit-Position: refs/heads/master@{#439093}

[modify] https://crrev.com/bf9901feb0c46cefbd5e7af40fe252a6a92d52cb/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/bf9901feb0c46cefbd5e7af40fe252a6a92d52cb/third_party/WebKit/Source/core/layout/TextAutosizer.cpp
[modify] https://crrev.com/bf9901feb0c46cefbd5e7af40fe252a6a92d52cb/third_party/WebKit/Source/core/layout/TextAutosizer.h
[modify] https://crrev.com/bf9901feb0c46cefbd5e7af40fe252a6a92d52cb/third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp

Project Member

Comment 10 by sheriffbot@chromium.org, Apr 13 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 11 by e...@chromium.org, Apr 23 2018

Status: Fixed (was: Untriaged)
Closing as per comment 9.

Sign in to add a comment