Issue 514552 in chromium: Android webview contenteditable content font size is getting bigger after cut/copy and paste

61 views
Skip to first unread message

chro...@googlecode.com

unread,
Jul 28, 2015, 4:08:06 AM7/28/15
to chromi...@chromium.org
Status: Unconfirmed
Owner: ----
Labels: Pri-2 Via-Wizard Type-Bug OS-Android

New issue 514552 by ttpu...@gmail.com: Android webview contenteditable
content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

Steps to reproduce the problem:
1. Install attached application and run it.(Some text zoom is applied to
webview)
2. copy the existing text and paste it
3. Observe, font size is became bigger.
4. Copy the pasted text and again paste it.
5. Observe font size is becoming bigger and bigger

What is the expected behavior?
original text and the pasted text should have the same font size.

What went wrong?
1. Pasted text has bigger font size. Observed this behavior when html
content has inline ‘font-size’ style in pt/px values and some zoom value is
applied using setTextZoom API.

Did this work before? No

Chrome version: 43.0.2357.121 Channel: stable
OS Version: Lollipop(5.1.1)
Flash Version: N/A

Observed this behavior when html content has inline ‘font-size’ style in
pt/px values and some zoom value is applied using setTextZoom API.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Jul 28, 2015, 4:09:07 AM7/28/15
to chromi...@chromium.org

Comment #1 on issue 514552 by ttpu...@gmail.com: Android webview
contenteditable content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

(No comment was entered for this change.)

Attachments:
WebViewSampleApp.apk 397 KB

chro...@googlecode.com

unread,
Jul 28, 2015, 4:10:05 AM7/28/15
to chromi...@chromium.org

Comment #2 on issue 514552 by ttpu...@gmail.com: Android webview
contenteditable content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

Attached sample APK

chro...@googlecode.com

unread,
Jul 28, 2015, 10:49:01 AM7/28/15
to chromi...@chromium.org

Comment #3 on issue 514552 by ttpu...@gmail.com: Android webview
contenteditable content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

Attached screenshot for this issue.

Attachments:
screenshot.png 143 KB

chro...@googlecode.com

unread,
Jul 28, 2015, 10:49:59 AM7/28/15
to chromi...@chromium.org

Comment #4 on issue 514552 by ttpu...@gmail.com: Android webview
contenteditable content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

This issue is observed in Nexus 5, LG G4, Samsung S6 with android 5.1 also

chro...@googlecode.com

unread,
Aug 12, 2015, 6:04:00 PM8/12/15
to chromi...@chromium.org
Updates:
Owner: paulmil...@chromium.org

Comment #7 on issue 514552 by h...@chromium.org: Android webview
contenteditable content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

Possibly a bug in the javascript itself, considering this never worked
before. I haven't done any investigations yet.

Paul, would you want to take a look?

chro...@googlecode.com

unread,
Aug 21, 2015, 6:13:23 PM8/21/15
to chromi...@chromium.org

Comment #8 on issue 514552 by paulmil...@chromium.org: Android webview
contenteditable content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

Can you share your app's code? I can repro with your app, but I wrote a
simple WebView app with zoom and copied your HTML and I can't repro in my
app.

chro...@googlecode.com

unread,
Aug 21, 2015, 10:31:42 PM8/21/15
to chromi...@chromium.org

Comment #9 on issue 514552 by ttpu...@gmail.com: Android webview
contenteditable content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

Attached Source code.

As i said earlier, issue is reproducible when we apply text zoom and font
size in Pt/px.

1. Type one word-> Copy it->Paste again -> observe pasted text font size
looks bigger.

Attachments:
WebViewSampleApp.zip 1.0 MB

chro...@googlecode.com

unread,
Aug 21, 2015, 10:36:42 PM8/21/15
to chromi...@chromium.org

Comment #10 on issue 514552 by ttpu...@gmail.com: Android webview
contenteditable content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

1. Applied fontSize property to content editable div element in Sample.html
file and loaded into webview.
2. Also applied getSettings().setTextZoom

chro...@googlecode.com

unread,
Sep 29, 2015, 9:47:14 PM9/29/15
to chromi...@chromium.org
Updates:
Cc: yo...@chromium.org

Comment #11 on issue 514552 by paulmil...@chromium.org: Android webview
contenteditable content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

Sorry, I've been caught up with other assignments.

I agree this is a bug in WebView, not in the app's JS.

I reduced the repro HTML down to this:
<html>
<head>
</head>
<body>
<div contentEditable="true" style="font-size:10pt;">
Testing font size inline style
</div>
</body>
</html>

I can repro using that in WebView with setTextZoom. More interestingly, I
can repro in WebView (without using setTextZoom) and also in Chrome if I
enable Settings > Accessibility > Large text.

It looks like extra-large text is being written to the clipboard in the
copy, when StyledMarkupAccumulator::appendTextWithInlineStyle() wraps the
text in a <span> with an inflated font-size. Conceptually, when we copy, we
should ignore font-size effects from setTextZoom or "Large text". But I'm
not familiar with this code, so I'm not sure how to best accomplish that.
+Yoshifumi from OWNERS to see if he knows.

chro...@googlecode.com

unread,
Sep 29, 2015, 9:48:11 PM9/29/15
to chromi...@chromium.org
Updates:
Labels: Cr-Blink-Editing

Comment #12 on issue 514552 by paulmil...@chromium.org: Android webview
contenteditable content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Oct 7, 2015, 6:24:15 AM10/7/15
to chromi...@chromium.org

Comment #13 on issue 514552 by lge-Syst...@lge.com: Android webview
contenteditable content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

This behavior looks very odd. Is there any update about this issue?

chro...@googlecode.com

unread,
Dec 7, 2015, 4:05:52 AM12/7/15
to chromi...@chromium.org

Comment #17 on issue 514552 by salih...@gmail.com: Android webview
contenteditable content font size is getting bigger after cut/copy and paste
https://code.google.com/p/chromium/issues/detail?id=514552

Hi,
This issue is faced by many people since the use case is very common and
hence User Impact is very High.
Could you please update on the progress?
Thank you.
Reply all
Reply to author
Forward
0 new messages