Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(978)

Issue 1009703002: Changing font size with pinch gesture in Reader Mode (Closed)

Created:
5 years, 9 months ago by wychen
Modified:
5 years, 7 months ago
CC:
chromium-reviews, aelias_OOO_until_Jul13
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Changing font size with pinch gesture in Reader Mode When users pinch in Reader Mode, the page would zoom in or out as if it is a normal web page allowing user-zoom. At the end of pinch gesture, the page would do text reflow. These pinch-to-zoom and text reflow effects are not native, but are emulated using CSS and JavaScript. In order to achieve near-native zooming and panning frame rate, fake 3D transform is used so that the layer doesn't repaint for each frame. After the text reflow, the web content shown in the viewport should roughly be the same paragraph before zooming. The control point of font size is the html element, so that both "em" and "rem" are adjusted. Accordingly, font size of body is no longer specified in CSS in unit of pixel. Some CSS styles and animations are updated to fix issues specific to resizing. BUG=445632 Committed: https://crrev.com/6349c066f2a16007c0fba1684dfe2a18d40a9e20 Cr-Commit-Position: refs/heads/master@{#326945}

Patch Set 1 #

Total comments: 11

Patch Set 2 : multitouch and tests #

Total comments: 12

Patch Set 3 : address comments #

Total comments: 13

Patch Set 4 : test readability and singularity #

Total comments: 6

Patch Set 5 : address comments of jdduke #

Total comments: 10

Patch Set 6 : address tdresser's comment #

Total comments: 6

Patch Set 7 : fix typo #

Patch Set 8 : remove symlink #

Patch Set 9 : fix isolate #

Patch Set 10 : merge master #

Patch Set 11 : update pinch_tester.html for changed viewer structure #

Patch Set 12 : fix animation conflict with feedback #

Patch Set 13 : temporarily merge https://crrev.com/1093993003/ for embedded test server #

Patch Set 14 : merge master #

Patch Set 15 : revert https://crrev.com/1093993003/, fix copyright, fix embedded_test_server #

Patch Set 16 : fix relative url #

Patch Set 17 : remove redundant code, use const in js, fix feedback font size #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+663 lines, -6 lines) Patch
M components/components_browsertests.isolate View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M components/dom_distiller/content/distiller_page_web_contents_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +47 lines, -2 lines 0 comments Download
M components/dom_distiller/core/css/distilledpage.css View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +7 lines, -4 lines 0 comments Download
M components/dom_distiller/core/javascript/dom_distiller_viewer.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +206 lines, -0 lines 1 comment Download
A components/test/data/dom_distiller/pinch_tester.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +14 lines, -0 lines 0 comments Download
A components/test/data/dom_distiller/pinch_tester.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +388 lines, -0 lines 0 comments Download

Messages

Total messages: 66 (20 generated)
wychen
PTAL, or try it out.
5 years, 9 months ago (2015-03-14 09:08:05 UTC) #2
cjhopman
jdduke: wdyt of this approach?
5 years, 9 months ago (2015-03-16 20:10:33 UTC) #4
jdduke (slow)
How difficult would it be to test this? Simulate a few event sequences and verify ...
5 years, 9 months ago (2015-03-16 20:27:53 UTC) #5
wychen
https://codereview.chromium.org/1009703002/diff/1/components/dom_distiller/core/javascript/dom_distiller_viewer.js File components/dom_distiller/core/javascript/dom_distiller_viewer.js (right): https://codereview.chromium.org/1009703002/diff/1/components/dom_distiller/core/javascript/dom_distiller_viewer.js#newcode114 components/dom_distiller/core/javascript/dom_distiller_viewer.js:114: if (e.touches.length != 2) return; On 2015/03/16 20:27:52, jdduke ...
5 years, 9 months ago (2015-03-17 17:36:12 UTC) #6
jdduke (slow)
https://codereview.chromium.org/1009703002/diff/1/components/dom_distiller/core/javascript/dom_distiller_viewer.js File components/dom_distiller/core/javascript/dom_distiller_viewer.js (right): https://codereview.chromium.org/1009703002/diff/1/components/dom_distiller/core/javascript/dom_distiller_viewer.js#newcode162 components/dom_distiller/core/javascript/dom_distiller_viewer.js:162: document.documentElement.style.fontSize = scaleFactor * baseSize + "px"; On 2015/03/17 ...
5 years, 9 months ago (2015-03-17 17:49:51 UTC) #7
wychen
Multi-touch (more than 2 fingers) and tests are added. PTAL.
5 years, 9 months ago (2015-03-20 23:54:47 UTC) #8
jdduke (slow)
This looks very reasonable, thanks! +rbyers as another set of eyes on the pinch code. ...
5 years, 9 months ago (2015-03-23 15:42:07 UTC) #10
wychen
PTAL https://codereview.chromium.org/1009703002/diff/20001/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc File components/dom_distiller/content/distiller_page_web_contents_browsertest.cc (right): https://codereview.chromium.org/1009703002/diff/20001/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc#newcode549 components/dom_distiller/content/distiller_page_web_contents_browsertest.cc:549: callback_ = run_loop.QuitClosure(); On 2015/03/23 15:42:06, jdduke wrote: ...
5 years, 9 months ago (2015-03-24 22:52:08 UTC) #11
jdduke (slow)
-rbyers as he'll be pretty busy this week. Tim, would you mind doing a sanity ...
5 years, 9 months ago (2015-03-24 23:24:47 UTC) #13
tdresser
Can features be implemented as extensions on Android? If so, should this be implemented as ...
5 years, 9 months ago (2015-03-25 13:45:37 UTC) #14
jdduke (slow)
On 2015/03/25 13:45:37, tdresser wrote: > Can features be implemented as extensions on Android? If ...
5 years, 9 months ago (2015-03-25 18:02:08 UTC) #15
tdresser
+bokan@, for insight on pinch behavior. I don't think you can adjust the pinch scale ...
5 years, 9 months ago (2015-03-25 18:40:08 UTC) #17
jdduke (slow)
On 2015/03/25 18:40:08, tdresser wrote: > +bokan@, for insight on pinch behavior. > > I ...
5 years, 9 months ago (2015-03-25 18:53:27 UTC) #18
bokan
On 2015/03/25 18:40:08, tdresser wrote: > +bokan@, for insight on pinch behavior. > > I ...
5 years, 9 months ago (2015-03-25 19:09:30 UTC) #19
jdduke (slow)
On 2015/03/25 19:09:30, bokan wrote: > Page scale isn't explicitly exposed to authors at all ...
5 years, 9 months ago (2015-03-25 19:17:28 UTC) #20
cjhopman
> > Maybe a bit late in the process, but have you thought about going ...
5 years, 9 months ago (2015-03-26 22:03:41 UTC) #21
jdduke (slow)
Talking offline with aelias@, we both agreed that having custom JS-driven pinch behavior here is ...
5 years, 9 months ago (2015-03-27 01:20:05 UTC) #22
jdduke (slow)
https://codereview.chromium.org/1009703002/diff/40001/components/dom_distiller/core/javascript/dom_distiller_viewer.js File components/dom_distiller/core/javascript/dom_distiller_viewer.js (right): https://codereview.chromium.org/1009703002/diff/40001/components/dom_distiller/core/javascript/dom_distiller_viewer.js#newcode145 components/dom_distiller/core/javascript/dom_distiller_viewer.js:145: var count = e.touches.length; We'll probably want some kind ...
5 years, 9 months ago (2015-03-27 01:26:25 UTC) #23
wychen
On 2015/03/26 at 22:03:41, cjhopman wrote: > Just resizing the divs to have width == ...
5 years, 9 months ago (2015-03-27 01:38:04 UTC) #24
tdresser
On 2015/03/27 01:38:04, Wei-Yin Chen wrote: > On 2015/03/26 at 22:03:41, cjhopman wrote: > > ...
5 years, 9 months ago (2015-03-27 12:38:52 UTC) #25
wychen
PTAL. https://codereview.chromium.org/1009703002/diff/40001/components/dom_distiller/core/javascript/dom_distiller_viewer.js File components/dom_distiller/core/javascript/dom_distiller_viewer.js (right): https://codereview.chromium.org/1009703002/diff/40001/components/dom_distiller/core/javascript/dom_distiller_viewer.js#newcode145 components/dom_distiller/core/javascript/dom_distiller_viewer.js:145: var count = e.touches.length; On 2015/03/27 01:26:25, jdduke ...
5 years, 8 months ago (2015-04-02 02:05:59 UTC) #26
jdduke (slow)
I'll defer to Tim on the JS test code, but the pinch code itself lgtm ...
5 years, 8 months ago (2015-04-02 23:34:22 UTC) #27
wychen
PTAL. https://codereview.chromium.org/1009703002/diff/60001/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc File components/dom_distiller/content/distiller_page_web_contents_browsertest.cc (right): https://codereview.chromium.org/1009703002/diff/60001/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc#newcode97 components/dom_distiller/content/distiller_page_web_contents_browsertest.cc:97: const base::Value* js_result_; On 2015/04/02 23:34:22, jdduke wrote: ...
5 years, 8 months ago (2015-04-03 07:04:39 UTC) #28
tdresser
https://codereview.chromium.org/1009703002/diff/40001/components/test/data/dom_distiller/pinch_tester.js File components/test/data/dom_distiller/pinch_tester.js (right): https://codereview.chromium.org/1009703002/diff/40001/components/test/data/dom_distiller/pinch_tester.js#newcode4 components/test/data/dom_distiller/pinch_tester.js:4: function assertTrue(condition, message) { On 2015/04/02 02:05:59, wychen wrote: ...
5 years, 8 months ago (2015-04-07 13:56:16 UTC) #29
wychen
Tim, PTAL. Thanks! https://codereview.chromium.org/1009703002/diff/80001/components/dom_distiller/core/javascript/dom_distiller_viewer.js File components/dom_distiller/core/javascript/dom_distiller_viewer.js (right): https://codereview.chromium.org/1009703002/diff/80001/components/dom_distiller/core/javascript/dom_distiller_viewer.js#newcode169 components/dom_distiller/core/javascript/dom_distiller_viewer.js:169: function touchPageMid(e) { On 2015/04/07 13:56:15, ...
5 years, 8 months ago (2015-04-20 22:46:47 UTC) #30
tdresser
Looks great, thanks. LGTM with nit. https://codereview.chromium.org/1009703002/diff/100001/components/test/data/dom_distiller/pinch_tester.js File components/test/data/dom_distiller/pinch_tester.js (right): https://codereview.chromium.org/1009703002/diff/100001/components/test/data/dom_distiller/pinch_tester.js#newcode56 components/test/data/dom_distiller/pinch_tester.js:56: var touch = ...
5 years, 8 months ago (2015-04-21 12:28:45 UTC) #31
cjhopman
https://codereview.chromium.org/1009703002/diff/100001/components/test/data/dom_distiller/dom_distiller_viewer.js File components/test/data/dom_distiller/dom_distiller_viewer.js (right): https://codereview.chromium.org/1009703002/diff/100001/components/test/data/dom_distiller/dom_distiller_viewer.js#newcode1 components/test/data/dom_distiller/dom_distiller_viewer.js:1: ../../../dom_distiller/core/javascript/dom_distiller_viewer.js Is this a symlink? We shouldn't be using ...
5 years, 8 months ago (2015-04-22 00:41:28 UTC) #32
wychen
https://codereview.chromium.org/1009703002/diff/100001/components/test/data/dom_distiller/pinch_tester.js File components/test/data/dom_distiller/pinch_tester.js (right): https://codereview.chromium.org/1009703002/diff/100001/components/test/data/dom_distiller/pinch_tester.js#newcode56 components/test/data/dom_distiller/pinch_tester.js:56: var touch = (function() { On 2015/04/21 12:28:45, tdresser ...
5 years, 8 months ago (2015-04-22 04:25:17 UTC) #33
wychen
https://codereview.chromium.org/1009703002/diff/100001/components/test/data/dom_distiller/dom_distiller_viewer.js File components/test/data/dom_distiller/dom_distiller_viewer.js (right): https://codereview.chromium.org/1009703002/diff/100001/components/test/data/dom_distiller/dom_distiller_viewer.js#newcode1 components/test/data/dom_distiller/dom_distiller_viewer.js:1: ../../../dom_distiller/core/javascript/dom_distiller_viewer.js On 2015/04/22 00:41:28, cjhopman wrote: > Is this ...
5 years, 8 months ago (2015-04-22 04:31:33 UTC) #34
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1009703002/240001
5 years, 8 months ago (2015-04-23 22:34:33 UTC) #37
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/18043) ios_rel_device_ninja on ...
5 years, 8 months ago (2015-04-23 22:40:02 UTC) #39
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1009703002/260001
5 years, 8 months ago (2015-04-23 23:18:04 UTC) #42
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/58667)
5 years, 8 months ago (2015-04-23 23:24:50 UTC) #44
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1009703002/280001
5 years, 8 months ago (2015-04-24 00:35:03 UTC) #47
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/57605)
5 years, 8 months ago (2015-04-24 01:49:06 UTC) #49
wychen
+csharp as owner of components/components_browsertests.isolate
5 years, 8 months ago (2015-04-24 03:09:44 UTC) #51
csharp
components/components_browsertests.isolate lgtm
5 years, 8 months ago (2015-04-24 13:59:05 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1009703002/320001
5 years, 8 months ago (2015-04-24 21:27:01 UTC) #55
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/58954)
5 years, 8 months ago (2015-04-24 21:37:23 UTC) #57
wychen
On 2015/04/22 04:31:33, wychen wrote: > https://codereview.chromium.org/1009703002/diff/100001/components/test/data/dom_distiller/dom_distiller_viewer.js > File components/test/data/dom_distiller/dom_distiller_viewer.js (right): > > https://codereview.chromium.org/1009703002/diff/100001/components/test/data/dom_distiller/dom_distiller_viewer.js#newcode1 > ...
5 years, 8 months ago (2015-04-24 22:13:28 UTC) #58
cjhopman
lgtm
5 years, 8 months ago (2015-04-24 22:27:02 UTC) #59
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1009703002/320001
5 years, 8 months ago (2015-04-25 00:07:00 UTC) #61
commit-bot: I haz the power
Committed patchset #17 (id:320001)
5 years, 8 months ago (2015-04-25 01:03:57 UTC) #62
commit-bot: I haz the power
Patchset 17 (id:??) landed as https://crrev.com/6349c066f2a16007c0fba1684dfe2a18d40a9e20 Cr-Commit-Position: refs/heads/master@{#326945}
5 years, 8 months ago (2015-04-25 01:04:44 UTC) #63
mdjones
This change causes a regression in the distiller HTML feedback form positioning; it should remain ...
5 years, 7 months ago (2015-04-30 20:27:06 UTC) #65
mdjones
5 years, 7 months ago (2015-05-20 16:58:36 UTC) #66
Message was sent while issue was closed.
https://codereview.chromium.org/1009703002/diff/320001/components/dom_distill...
File components/dom_distiller/core/javascript/dom_distiller_viewer.js (right):

https://codereview.chromium.org/1009703002/diff/320001/components/dom_distill...
components/dom_distiller/core/javascript/dom_distiller_viewer.js:207: const
FONT_SCALE_MULTIPLIER = 0.5;
The use of the "const" keyword breaks distiller on iOS.

Fix: https://codereview.chromium.org/1148083003

Powered by Google App Engine
This is Rietveld 408576698