RESOLVED FIXED 108411
TextAutosizing: adjust the maximum difference between cluster text width and its descendant width
https://bugs.webkit.org/show_bug.cgi?id=108411
Summary TextAutosizing: adjust the maximum difference between cluster text width and ...
Anton Vayvod
Reported 2013-01-30 18:01:01 PST
Adjust the maximum width difference between a narrow descendant and its parent cluster's text width if the current width difference is less than 50px bigger. This allows layouts like nested comments to be handled better: deep threads are still considered to be a part of the same cluster and the font is boosted equally for all narrow nodes.
Attachments
Patch (19.70 KB, patch)
2013-01-30 18:04 PST, Anton Vayvod
no flags
Patch (13.61 KB, patch)
2013-02-01 15:39 PST, Anton Vayvod
no flags
Patch (12.55 KB, patch)
2013-02-04 09:27 PST, Anton Vayvod
no flags
Patch (12.57 KB, patch)
2013-02-05 06:55 PST, Anton Vayvod
no flags
Patch (12.60 KB, patch)
2013-02-05 09:32 PST, Anton Vayvod
no flags
Patch (12.62 KB, patch)
2013-02-05 09:47 PST, Anton Vayvod
no flags
Anton Vayvod
Comment 1 2013-01-30 18:04:12 PST
Anton Vayvod
Comment 2 2013-02-01 15:39:58 PST
Anton Vayvod
Comment 3 2013-02-01 15:51:08 PST
Hey, Julien! Could you take a look?
Anton Vayvod
Comment 4 2013-02-04 05:41:12 PST
Hi Kenneth, could you, please, take a look? This is the next change to the one you reviewed last week. Thanks!
Kenneth Rohde Christiansen
Comment 5 2013-02-04 05:51:28 PST
Comment on attachment 186169 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=186169&action=review > Source/WebCore/ChangeLog:7 > + This allows layouts like nested comments to be handled better: deep threads are still considered to be a part > + of the same cluster and the font is boosted equally for all the arrow nodes. > + I would try to keep the lines at max 100 chars > Source/WebCore/ChangeLog:3653 > + * rendering/TextAutosizer.cpp: > + (WebCore::TextAutosizingClusterInfo::TextAutosizingClusterInfo): > + (TextAutosizingClusterInfo): > + (WebCore): > + (WebCore::TextAutosizer::processSubtree): > + (WebCore::TextAutosizer::processCluster): > + (WebCore::TextAutosizer::processContainer): > + (WebCore::TextAutosizer::isAutosizingCluster): > + (WebCore::TextAutosizer::clusterShouldBeAutosized): > + (WebCore::TextAutosizer::measureDescendantTextWidth): > + * rendering/TextAutosizer.h: > + (WebCore): > + > 2013-01-30 Dominik Röttsches <dominik.rottsches@intel.com> This seems unrelated... there is an entry by Pavel before this! > Source/WebCore/rendering/TextAutosizer.cpp:54 > + , maxAllowedDifferenceFromTextWidth(150) what kind of difference? That is not obvious
John Mellor
Comment 6 2013-02-04 05:58:52 PST
Comment on attachment 186169 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=186169&action=review Code looks good and test looks good. Might be good to explain what's going on slightly more clearly though, as this is a rather subtle patch. > Source/WebCore/ChangeLog:5 > + This allows layouts like nested comments to be handled better: deep threads are still considered to be a part Please make this description more detailed, as the purpose of the patch is somewhat subtle :) > Source/WebCore/ChangeLog:29 > + * rendering/TextAutosizer.cpp: You have 4 copies of the list of changed files. This one, one above (that you've filled in), and 2 below, one of which in the middle of pfeldman's patch. Please remove the last 3. > Source/WebCore/rendering/TextAutosizer.cpp:60 > + float maxAllowedDifferenceFromTextWidth; It might be nice to have some explanation of this property / starting value. There was a comment below ("Upper limit on the difference between the width of the parent block containing all text and that of a narrow child before the child becomes a cluster.") which gave a reasonable overview (though in this context, I'd probably s/the parent/a cluster's/ and s/a cluster/a separate cluster/). > Source/WebCore/rendering/TextAutosizer.cpp:269 > + const float maxWidthDifferenceDifference = 50; This comment probably isn't still accurate (seeing as the variable name changed).
Anton Vayvod
Comment 7 2013-02-04 09:18:50 PST
Comment on attachment 186169 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=186169&action=review >> Source/WebCore/ChangeLog:29 >> + * rendering/TextAutosizer.cpp: > > You have 4 copies of the list of changed files. This one, one above (that you've filled in), and 2 below, one of which in the middle of pfeldman's patch. Please remove the last 3. Fixed. >> Source/WebCore/ChangeLog:3653 >> 2013-01-30 Dominik Röttsches <dominik.rottsches@intel.com> > > This seems unrelated... there is an entry by Pavel before this! Yep, thanks for catching! >> Source/WebCore/rendering/TextAutosizer.cpp:54 >> + , maxAllowedDifferenceFromTextWidth(150) > > what kind of difference? That is not obvious contentWidth()'s difference between the current RenderObject and blockContainingAllText. Added a comment per John's comment for the member definition below. On a second thought, it would make sense to handle updating of this field and comparison in a method of this struct (it could even be a const method and the member could be mutable). What do you think? >> Source/WebCore/rendering/TextAutosizer.cpp:60 >> + float maxAllowedDifferenceFromTextWidth; > > It might be nice to have some explanation of this property / starting value. There was a comment below ("Upper limit on the difference between the width of the parent block containing all text and that of a narrow child before the child becomes a cluster.") which gave a reasonable overview (though in this context, I'd probably s/the parent/a cluster's/ and s/a cluster/a separate cluster/). Done. >> Source/WebCore/rendering/TextAutosizer.cpp:269 >> + const float maxWidthDifferenceDifference = 50; > > This comment probably isn't still accurate (seeing as the variable name changed). Done.
Anton Vayvod
Comment 8 2013-02-04 09:27:24 PST
John Mellor
Comment 9 2013-02-04 09:56:51 PST
Comment on attachment 186399 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=186399&action=review Thanks, that's a lot clearer. > Source/WebCore/ChangeLog:3 > + TextAutosizing: adjust the maximum difference between cluster text width and its descendant width You have two (slightly different) bug titles? > Source/WebCore/ChangeLog:7 > + a separate autosizing cluster. This doesn't work well for layouts when narrow nodes are Please include a link to webkit.org/b/105188, which introduced the narrow test (and hence contains further details). > Source/WebCore/rendering/TextAutosizer.cpp:61 > + // Upper limit on the difference between the width of a cluster's block containing all Nit: s/a cluster's/the cluster's/ (my bad!) > Source/WebCore/rendering/TextAutosizer.cpp:270 > + // The upper limit on how many pixels the difference between the object width Nit: s/object/renderer/? Object is a bit vague... > Source/WebCore/rendering/TextAutosizer.cpp:271 > + // and its parent cluster width can exceed the current maximum difference Nit: s/maximum difference/maximum difference by/. Still a little hard to read, but it's admittedly a complex thing to explain, and I don't have any immediate suggestions :)
Build Bot
Comment 10 2013-02-04 13:42:03 PST
Build Bot
Comment 11 2013-02-04 14:50:25 PST
Anton Vayvod
Comment 12 2013-02-05 06:27:52 PST
Comment on attachment 186399 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=186399&action=review >> Source/WebCore/ChangeLog:3 >> + TextAutosizing: adjust the maximum difference between cluster text width and its descendant width > > You have two (slightly different) bug titles? What can I say? Fixing two bugs with one patch ;) >> Source/WebCore/ChangeLog:7 >> + a separate autosizing cluster. This doesn't work well for layouts when narrow nodes are > > Please include a link to webkit.org/b/105188, which introduced the narrow test (and hence contains further details). Done. >> Source/WebCore/rendering/TextAutosizer.cpp:61 >> + // Upper limit on the difference between the width of a cluster's block containing all > > Nit: s/a cluster's/the cluster's/ (my bad!) I knew it! >> Source/WebCore/rendering/TextAutosizer.cpp:270 >> + // The upper limit on how many pixels the difference between the object width > > Nit: s/object/renderer/? Object is a bit vague... Done. >> Source/WebCore/rendering/TextAutosizer.cpp:271 >> + // and its parent cluster width can exceed the current maximum difference > > Nit: s/maximum difference/maximum difference by/. Still a little hard to read, but it's admittedly a complex thing to explain, and I don't have any immediate suggestions :) Done.
Anton Vayvod
Comment 13 2013-02-05 06:55:56 PST
Anton Vayvod
Comment 14 2013-02-05 09:16:53 PST
Please, take another look?
John Mellor
Comment 15 2013-02-05 09:19:37 PST
Comment on attachment 186618 [details] Patch Looks good to me. Kenneth/Julien, what do you think?
Kenneth Rohde Christiansen
Comment 16 2013-02-05 09:25:17 PST
Comment on attachment 186618 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=186618&action=review > Source/WebCore/ChangeLog:12 > + each time the width difference is not greater than 50px from the previous one. This allows these are pixels in CSS units right? > Source/WebCore/rendering/TextAutosizer.cpp:273 > + const float maxWidthDifferenceDifference = 50; DifferenceDifference... not really clear... maxDifferenceFromWidthDifference or differenceFromMaxWidthDifference...
Anton Vayvod
Comment 17 2013-02-05 09:32:48 PST
Anton Vayvod
Comment 18 2013-02-05 09:33:57 PST
Comment on attachment 186618 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=186618&action=review >> Source/WebCore/ChangeLog:12 >> + each time the width difference is not greater than 50px from the previous one. This allows > > these are pixels in CSS units right? Yes, clarified. >> Source/WebCore/rendering/TextAutosizer.cpp:273 >> + const float maxWidthDifferenceDifference = 50; > > DifferenceDifference... not really clear... > > maxDifferenceFromWidthDifference or differenceFromMaxWidthDifference... The latter. Done.
Anton Vayvod
Comment 19 2013-02-05 09:47:45 PST
WebKit Review Bot
Comment 20 2013-02-05 10:38:09 PST
Comment on attachment 186648 [details] Patch Clearing flags on attachment: 186648 Committed r141901: <http://trac.webkit.org/changeset/141901>
WebKit Review Bot
Comment 21 2013-02-05 10:38:14 PST
All reviewed patches have been landed. Closing bug.
Eric Seidel (no email)
Comment 22 2013-03-01 02:52:06 PST
Comment on attachment 186618 [details] Patch Cleared review? from obsolete attachment 186618 [details] so that this bug does not appear in http://webkit.org/pending-review. If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).
Note You need to log in before you can comment on or make changes to this bug.