Changeset 129195 in webkit
- Timestamp:
- Sep 20, 2012 11:20:57 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 11 added
- 42 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r129194 r129195 1 2012-09-20 John Mellor <johnme@chromium.org> 2 3 Text Autosizing: Cluster text at flow roots, for consistency and to avoid autosizing headers/footers. 4 https://bugs.webkit.org/show_bug.cgi?id=97025 5 6 Reviewed by Julien Chaffraix. 7 8 Added 6 tests (cluster*.html). Updated various other tests to have 9 enough text so that they continue to pass, or that if they fail, it's 10 for the reason that was being tested, not just because clustering 11 decided they had insufficient text. 12 13 * fast/text-autosizing/cluster-narrow-in-wide-expected.html: Added. 14 * fast/text-autosizing/cluster-narrow-in-wide.html: Copied from LayoutTests/fast/text-autosizing/em-margin-border-padding.html. 15 * fast/text-autosizing/cluster-wide-in-narrow-expected.html: Added. 16 * fast/text-autosizing/cluster-wide-in-narrow.html: Added. 17 * fast/text-autosizing/clusters-insufficient-text-expected.html: Added. 18 * fast/text-autosizing/clusters-insufficient-text.html: Added. 19 * fast/text-autosizing/clusters-insufficient-width-expected.html: Added. 20 * fast/text-autosizing/clusters-insufficient-width.html: Added. 21 * fast/text-autosizing/clusters-sufficient-text-except-in-root-expected.html: Added. 22 * fast/text-autosizing/clusters-sufficient-text-except-in-root.html: Added. 23 * fast/text-autosizing/clusters-sufficient-width-expected.html: Added. 24 * fast/text-autosizing/clusters-sufficient-width.html: Added. 25 * fast/text-autosizing/constrained-and-overflow-auto-ancestor-expected.html: 26 * fast/text-autosizing/constrained-and-overflow-auto-ancestor.html: 27 * fast/text-autosizing/constrained-and-overflow-hidden-ancestor-expected.html: 28 * fast/text-autosizing/constrained-and-overflow-hidden-ancestor.html: 29 * fast/text-autosizing/constrained-and-overflow-paged-x-ancestor-expected.html: 30 * fast/text-autosizing/constrained-and-overflow-paged-x-ancestor.html: 31 * fast/text-autosizing/constrained-and-overflow-scroll-ancestor-expected.html: 32 * fast/text-autosizing/constrained-and-overflow-scroll-ancestor.html: 33 * fast/text-autosizing/constrained-height-ancestor-expected.html: 34 * fast/text-autosizing/constrained-height-ancestor.html: 35 * fast/text-autosizing/constrained-maxheight-ancestor-expected.html: 36 * fast/text-autosizing/constrained-maxheight-ancestor.html: 37 * fast/text-autosizing/constrained-maxheight-expected.html: 38 * fast/text-autosizing/constrained-maxheight.html: 39 * fast/text-autosizing/constrained-percent-maxheight-expected.html: 40 * fast/text-autosizing/constrained-percent-maxheight.html: 41 * fast/text-autosizing/constrained-percent-of-viewport-maxheight-expected.html: 42 * fast/text-autosizing/constrained-percent-of-viewport-maxheight.html: 43 * fast/text-autosizing/constrained-then-overflow-ancestors-expected.html: 44 * fast/text-autosizing/constrained-then-overflow-ancestors.html: 45 * fast/text-autosizing/constrained-then-overflow-then-positioned-ancestors-expected.html: 46 * fast/text-autosizing/constrained-then-overflow-then-positioned-ancestors.html: 47 * fast/text-autosizing/constrained-then-position-absolute-ancestors-expected.html: 48 * fast/text-autosizing/constrained-then-position-absolute-ancestors.html: 49 * fast/text-autosizing/constrained-then-position-fixed-ancestors-expected.html: 50 * fast/text-autosizing/constrained-then-position-fixed-ancestors.html: 51 * fast/text-autosizing/constrained-within-overflow-ancestor-expected.html: 52 * fast/text-autosizing/constrained-within-overflow-ancestor.html: 53 * fast/text-autosizing/em-margin-border-padding-expected.html: 54 * fast/text-autosizing/em-margin-border-padding.html: 55 * fast/text-autosizing/narrow-child-expected.html: 56 * fast/text-autosizing/narrow-child.html: 57 * fast/text-autosizing/wide-child-expected.html: 58 * fast/text-autosizing/wide-child.html: 59 * fast/text-autosizing/wide-iframe-expected.html: 60 * fast/text-autosizing/wide-iframe.html: 61 1 62 2012-09-20 Yury Semikhatsky <yurys@chromium.org> 2 63 -
trunk/LayoutTests/fast/text-autosizing/cluster-narrow-in-wide.html
r129194 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css"> 7 body { width: 800px; margin: 0; } 6 <style> 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; overflow-y: hidden; } 8 9 </style> 9 10 10 <script type="text/javascript">11 <script> 11 12 if (window.internals) { 12 13 window.internals.settings.setTextAutosizingEnabled(true); … … 20 21 <body> 21 22 22 <p style="margin: 1em; border: 1em solid blue; padding: 1em"> 23 <div style="width: 400px; float: left"> 24 This text should be autosized to just 20px computed font size (16 * 400/320), since the float:left causes this to be a new cluster, and it is only 400px wide. 25 </div> 26 27 <div style="width: 320px"> 28 This text should be autosized to 40px computed font-size (16 * 800/320), since despite its width:320px it is part of the 800px wide root cluster. 29 </div> 30 31 <div> 32 This text should similarly be autosized to 40px.<br> 23 33 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 24 </ p>34 </div> 25 35 26 36 </body> -
trunk/LayoutTests/fast/text-autosizing/constrained-and-overflow-auto-ancestor-expected.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; }8 body { width: 800px; margin: 0; overflow-y: hidden; } 9 9 </style> 10 10 … … 15 15 <div> 16 16 <div style="font-size: 2.5rem"> 17 This text should be autosized to 40px computed font-size, since the grandparent's overflow-y:auto means the available height is unconstrained (despite the grandparent also having a max-height). 17 This text should be autosized to 40px computed font-size, since the grandparent's overflow-y:auto means the available height is unconstrained (despite the grandparent also having a max-height).<br> 18 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 18 19 </div> 19 20 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-and-overflow-auto-ancestor.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; }8 body { width: 800px; margin: 0; overflow-y: hidden; } 9 9 </style> 10 10 11 <script type="text/javascript">11 <script> 12 12 if (window.internals) { 13 13 window.internals.settings.setTextAutosizingEnabled(true); … … 24 24 <div> 25 25 <div> 26 This text should be autosized to 40px computed font-size, since the grandparent's overflow-y:auto means the available height is unconstrained (despite the grandparent also having a max-height). 26 This text should be autosized to 40px computed font-size, since the grandparent's overflow-y:auto means the available height is unconstrained (despite the grandparent also having a max-height).<br> 27 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 27 28 </div> 28 29 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-and-overflow-hidden-ancestor-expected.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } … … 15 15 <div> 16 16 <div> 17 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the grandparent's max-height (the grandparent's overflow-y:hidden doesn't prevent this, as hidden doesn't extend the available content height). 17 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the grandparent's max-height (the grandparent's overflow-y:hidden doesn't prevent this, as hidden doesn't extend the available content height).<br> 18 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 18 19 </div> 19 20 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-and-overflow-hidden-ancestor.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } 9 9 </style> 10 10 11 <script type="text/javascript">11 <script> 12 12 if (window.internals) { 13 13 window.internals.settings.setTextAutosizingEnabled(true); … … 24 24 <div> 25 25 <div> 26 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the grandparent's max-height (the grandparent's overflow-y:hidden doesn't prevent this, as hidden doesn't extend the available content height). 26 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the grandparent's max-height (the grandparent's overflow-y:hidden doesn't prevent this, as hidden doesn't extend the available content height).<br> 27 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 27 28 </div> 28 29 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-and-overflow-paged-x-ancestor-expected.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; }8 body { width: 800px; margin: 0; overflow-y: hidden; } 9 9 </style> 10 10 … … 15 15 <div> 16 16 <div style="font-size: 2.5rem"> 17 This text should be autosized to 40px computed font-size, since the grandparent's overflow-y:-webkit-paged-x means the available height is unconstrained (despite the grandparent also having a max-height). 17 This text should be autosized to 40px computed font-size, since the grandparent's overflow-y:-webkit-paged-x means the available height is unconstrained (despite the grandparent also having a max-height).<br> 18 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 18 19 </div> 19 20 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-and-overflow-paged-x-ancestor.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; }8 body { width: 800px; margin: 0; overflow-y: hidden; } 9 9 </style> 10 10 11 <script type="text/javascript">11 <script> 12 12 if (window.internals) { 13 13 window.internals.settings.setTextAutosizingEnabled(true); … … 24 24 <div> 25 25 <div> 26 This text should be autosized to 40px computed font-size, since the grandparent's overflow-y:-webkit-paged-x means the available height is unconstrained (despite the grandparent also having a max-height). 26 This text should be autosized to 40px computed font-size, since the grandparent's overflow-y:-webkit-paged-x means the available height is unconstrained (despite the grandparent also having a max-height).<br> 27 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 27 28 </div> 28 29 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-and-overflow-scroll-ancestor-expected.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; }8 body { width: 800px; margin: 0; overflow-y: hidden; } 9 9 ::-webkit-scrollbar { 10 10 /* Keeps the text size multiplier a round number. */ … … 19 19 <div> 20 20 <div style="font-size: 2.5rem"> 21 This text should be autosized to 40px computed font-size, since the grandparent's overflow-y:scroll means the available height is unconstrained (despite the grandparent also having a max-height). 21 This text should be autosized to 40px computed font-size, since the grandparent's overflow-y:scroll means the available height is unconstrained (despite the grandparent also having a max-height).<br> 22 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 22 23 </div> 23 24 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-and-overflow-scroll-ancestor.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; }8 body { width: 800px; margin: 0; overflow-y: hidden; } 9 9 ::-webkit-scrollbar { 10 10 /* Keeps the text size multiplier a round number. */ … … 13 13 </style> 14 14 15 <script type="text/javascript">15 <script> 16 16 if (window.internals) { 17 17 window.internals.settings.setTextAutosizingEnabled(true); … … 28 28 <div> 29 29 <div> 30 This text should be autosized to 40px computed font-size, since the grandparent's overflow-y:scroll means the available height is unconstrained (despite the grandparent also having a max-height). 30 This text should be autosized to 40px computed font-size, since the grandparent's overflow-y:scroll means the available height is unconstrained (despite the grandparent also having a max-height).<br> 31 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 31 32 </div> 32 33 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-height-ancestor-expected.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } … … 15 15 <div> 16 16 <div> 17 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the grandparent's height. 17 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the grandparent's height.<br> 18 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 18 19 </div> 19 20 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-height-ancestor.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } 9 9 </style> 10 10 11 <script type="text/javascript">11 <script> 12 12 if (window.internals) { 13 13 window.internals.settings.setTextAutosizingEnabled(true); … … 24 24 <div> 25 25 <div> 26 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the grandparent's height. 26 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the grandparent's height.<br> 27 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 27 28 </div> 28 29 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-height-body-expected.html
r128927 r129195 13 13 14 14 <div style="font-size: 2.5rem"> 15 This text should be autosized to 40px computed font-size, since the constrained height on the html and body elements gets ignored (a hack to fix some sites that appear to set this accidentally). 15 This text should be autosized to 40px computed font-size, since the constrained height on the html and body elements gets ignored (a hack to fix some sites that appear to set this accidentally).<br> 16 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 16 17 </div> 17 18 -
trunk/LayoutTests/fast/text-autosizing/constrained-height-body.html
r128927 r129195 22 22 23 23 <div> 24 This text should be autosized to 40px computed font-size, since the constrained height on the html and body elements gets ignored (a hack to fix some sites that appear to set this accidentally). 24 This text should be autosized to 40px computed font-size, since the constrained height on the html and body elements gets ignored (a hack to fix some sites that appear to set this accidentally).<br> 25 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 25 26 </div> 26 27 -
trunk/LayoutTests/fast/text-autosizing/constrained-maxheight-ancestor-expected.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } … … 15 15 <div> 16 16 <div> 17 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the grandparent's max-height. 17 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the grandparent's max-height.<br> 18 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 18 19 </div> 19 20 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-maxheight-ancestor.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } 9 9 </style> 10 10 11 <script type="text/javascript">11 <script> 12 12 if (window.internals) { 13 13 window.internals.settings.setTextAutosizingEnabled(true); … … 24 24 <div> 25 25 <div> 26 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the grandparent's max-height. 26 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the grandparent's max-height.<br> 27 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 27 28 </div> 28 29 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-maxheight-expected.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } … … 13 13 14 14 <div style="max-height: 500px"> 15 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the block's max-height. 15 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the block's max-height.<br> 16 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 16 17 </div> 17 18 -
trunk/LayoutTests/fast/text-autosizing/constrained-maxheight.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } 9 9 </style> 10 10 11 <script type="text/javascript">11 <script> 12 12 if (window.internals) { 13 13 window.internals.settings.setTextAutosizingEnabled(true); … … 22 22 23 23 <div style="max-height: 500px"> 24 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the block's max-height. 24 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the block's max-height.<br> 25 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 25 26 </div> 26 27 -
trunk/LayoutTests/fast/text-autosizing/constrained-percent-maxheight-expected.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } … … 13 13 14 14 <div style="max-height: 100%"> 15 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the block's max-height (provided as a percentage). 15 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the block's max-height (provided as a percentage).<br> 16 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 16 17 </div> 17 18 -
trunk/LayoutTests/fast/text-autosizing/constrained-percent-maxheight.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } 9 9 </style> 10 10 11 <script type="text/javascript">11 <script> 12 12 if (window.internals) { 13 13 window.internals.settings.setTextAutosizingEnabled(true); … … 22 22 23 23 <div style="max-height: 100%"> 24 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the block's max-height (provided as a percentage). 24 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the block's max-height (provided as a percentage).<br> 25 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 25 26 </div> 26 27 -
trunk/LayoutTests/fast/text-autosizing/constrained-percent-of-viewport-maxheight-expected.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } … … 13 13 14 14 <div style="max-height: 100vh"> 15 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the block's max-height (provided as a viewport percentage). 15 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the block's max-height (provided as a viewport percentage).<br> 16 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 16 17 </div> 17 18 -
trunk/LayoutTests/fast/text-autosizing/constrained-percent-of-viewport-maxheight.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } 9 9 </style> 10 10 11 <script type="text/javascript">11 <script> 12 12 if (window.internals) { 13 13 window.internals.settings.setTextAutosizingEnabled(true); … … 22 22 23 23 <div style="max-height: 100vh"> 24 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the block's max-height (provided as a viewport percentage). 24 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the block's max-height (provided as a viewport percentage).<br> 25 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 25 26 </div> 26 27 -
trunk/LayoutTests/fast/text-autosizing/constrained-then-float-ancestors-expected.html
r128927 r129195 15 15 <div style="float: left"> 16 16 <div style="font-size: 2.5rem"> 17 This text should be autosized to 40px computed font-size, since the parent is float:left so the height is considered to be unconstrained (ancestors of the parent are ignored). 17 This text should be autosized to 40px computed font-size, since the parent is float:left so the height is considered to be unconstrained (ancestors of the parent are ignored).<br> 18 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 18 19 </div> 19 20 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-then-float-ancestors.html
r128927 r129195 24 24 <div style="float: left"> 25 25 <div> 26 This text should be autosized to 40px computed font-size, since the parent is float:left so the height is considered to be unconstrained (ancestors of the parent are ignored). 26 This text should be autosized to 40px computed font-size, since the parent is float:left so the height is considered to be unconstrained (ancestors of the parent are ignored).<br> 27 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 27 28 </div> 28 29 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-then-overflow-ancestors-expected.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; }8 body { width: 800px; margin: 0; overflow-y: hidden; } 9 9 </style> 10 10 … … 15 15 <div style="overflow-y: auto"> 16 16 <div style="font-size: 2.5rem"> 17 This text should be autosized to 40px computed font-size, since the parent's overflow-y:auto means the available height is unconstrained (despite the grandparent having a max-height). 17 This text should be autosized to 40px computed font-size, since the parent's overflow-y:auto means the available height is unconstrained (despite the grandparent having a max-height).<br> 18 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 18 19 </div> 19 20 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-then-overflow-ancestors.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; }8 body { width: 800px; margin: 0; overflow-y: hidden; } 9 9 </style> 10 10 11 <script type="text/javascript">11 <script> 12 12 if (window.internals) { 13 13 window.internals.settings.setTextAutosizingEnabled(true); … … 24 24 <div style="overflow-y: auto"> 25 25 <div> 26 This text should be autosized to 40px computed font-size, since the parent's overflow-y:auto means the available height is unconstrained (despite the grandparent having a max-height). 26 This text should be autosized to 40px computed font-size, since the parent's overflow-y:auto means the available height is unconstrained (despite the grandparent having a max-height).<br> 27 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 27 28 </div> 28 29 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-then-position-absolute-ancestors-expected.html
r128927 r129195 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } 9 ::-webkit-scrollbar { 10 /* Keeps the text size multiplier a round number. */ 11 width: 0px; 12 } 9 13 </style> 10 14 … … 15 19 <div style="position: absolute"> 16 20 <div style="font-size: 2.5rem"> 17 This text should be autosized to 40px computed font-size, since the parent is position:absolute so the height is considered to be unconstrained (ancestors of the parent are ignored, even if they have position:relative). 21 This text should be autosized to 40px computed font-size, since the parent is position:absolute so the height is considered to be unconstrained (ancestors of the parent are ignored, even if they have position:relative).<br> 22 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 18 23 </div> 19 24 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-then-position-absolute-ancestors.html
r128927 r129195 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } 9 ::-webkit-scrollbar { 10 /* Keeps the text size multiplier a round number. */ 11 width: 0px; 12 } 9 13 </style> 10 14 … … 24 28 <div style="position: absolute"> 25 29 <div> 26 This text should be autosized to 40px computed font-size, since the parent is position:absolute so the height is considered to be unconstrained (ancestors of the parent are ignored, even if they have position:relative). 30 This text should be autosized to 40px computed font-size, since the parent is position:absolute so the height is considered to be unconstrained (ancestors of the parent are ignored, even if they have position:relative).<br> 31 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 27 32 </div> 28 33 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-then-position-fixed-ancestors-expected.html
r128927 r129195 15 15 <div style="position: fixed"> 16 16 <div style="font-size: 2.5rem"> 17 This text should be autosized to 40px computed font-size, since the parent is position:fixed so the height is considered to be unconstrained (ancestors of the parent are ignored). 17 This text should be autosized to 40px computed font-size, since the parent is position:fixed so the height is considered to be unconstrained (ancestors of the parent are ignored).<br> 18 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 18 19 </div> 19 20 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-then-position-fixed-ancestors.html
r128927 r129195 24 24 <div style="position: fixed"> 25 25 <div> 26 This text should be autosized to 40px computed font-size, since the parent is position:fixed so the height is considered to be unconstrained (ancestors of the parent are ignored). 26 This text should be autosized to 40px computed font-size, since the parent is position:fixed so the height is considered to be unconstrained (ancestors of the parent are ignored).<br> 27 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 27 28 </div> 28 29 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-within-overflow-ancestor-expected.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } … … 15 15 <div style="max-height: 500px"> 16 16 <div> 17 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the parent's max-height (the grandparent's overflow-y:auto doesn't prevent this). 17 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the parent's max-height (the grandparent's overflow-y:auto doesn't prevent this).<br> 18 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 18 19 </div> 19 20 </div> -
trunk/LayoutTests/fast/text-autosizing/constrained-within-overflow-ancestor.html
r128317 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">6 <style> 7 7 html { font-size: 16px; } 8 8 body { width: 800px; margin: 0; } 9 9 </style> 10 10 11 <script type="text/javascript">11 <script> 12 12 if (window.internals) { 13 13 window.internals.settings.setTextAutosizingEnabled(true); … … 24 24 <div style="max-height: 500px"> 25 25 <div> 26 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the parent's max-height (the grandparent's overflow-y:auto doesn't prevent this). 26 This text should not be autosized (its computed font-size should remain 16px), as autosizing usually causes text to wrap onto more lines, which might cause it to overflow the parent's max-height (the grandparent's overflow-y:auto doesn't prevent this).<br> 27 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 27 28 </div> 28 29 </div> -
trunk/LayoutTests/fast/text-autosizing/em-margin-border-padding-expected.html
r125925 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css"> 7 body { width: 800px; margin: 0; } 6 <style> 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; overflow-y: hidden; } 8 9 </style> 9 10 … … 11 12 <body> 12 13 13 <!-- Note that em margins, borders and padding do not get scaled in proportion 14 to the font size. While unusual, this probably looks more consistent. --> 15 <p style="font-size: 2.375rem; margin: 1rem; border: 1rem solid blue; padding: 1rem"> 16 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 14 <p style="font-size: 2.5rem; margin: 1rem; border: 1rem solid blue; padding: 1rem"> 15 This text should get autosized to 40px computed font size, but the 1em margins, borders and padding should remain just 16px. While debatable, this generally looks more consistent than having them be scaled.<br> 16 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 17 17 </p> 18 18 -
trunk/LayoutTests/fast/text-autosizing/em-margin-border-padding.html
r125925 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css"> 7 body { width: 800px; margin: 0; } 6 <style> 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; overflow-y: hidden; } 8 9 </style> 9 10 10 <script type="text/javascript">11 <script> 11 12 if (window.internals) { 12 13 window.internals.settings.setTextAutosizingEnabled(true); … … 21 22 22 23 <p style="margin: 1em; border: 1em solid blue; padding: 1em"> 23 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 24 This text should get autosized to 40px computed font size, but the 1em margins, borders and padding should remain just 16px. While debatable, this generally looks more consistent than having them be scaled.<br> 25 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 24 26 </p> 25 27 -
trunk/LayoutTests/fast/text-autosizing/narrow-child-expected.html
r125925 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css"> 7 body { width: 800px; margin: 0; } 6 <style> 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; overflow-y: hidden; } 8 9 </style> 9 10 … … 12 13 13 14 <div style="font-size: 2.5rem"> 14 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.15 <div style="width: 320px ; font-size: 1rem">15 This text should all be autosized to 40px computed font-size, since although this has a narrow child block, the cluster will still be wide and need autosizing. 16 <div style="width: 320px"> 16 17 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 17 18 </div> -
trunk/LayoutTests/fast/text-autosizing/narrow-child.html
r125925 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css"> 7 body { width: 800px; margin: 0; } 6 <style> 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; overflow-y: hidden; } 8 9 </style> 9 10 10 <script type="text/javascript">11 <script> 11 12 if (window.internals) { 12 13 window.internals.settings.setTextAutosizingEnabled(true); … … 21 22 22 23 <div> 23 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.24 This text should all be autosized to 40px computed font-size, since although this has a narrow child block, the cluster will still be wide and need autosizing. 24 25 <div style="width: 320px"> 25 26 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. -
trunk/LayoutTests/fast/text-autosizing/wide-child-expected.html
r125925 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css"> 7 body { width: 800px; margin: 0; } 6 <style> 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; overflow-y: hidden; } 8 9 </style> 9 10 … … 11 12 <body> 12 13 13 <div style="width: 320px ">14 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.15 <div style="width: 800px ; font-size: 2.5rem">14 <div style="width: 320px; font-size: 2.5rem"> 15 This text should all be autosized to 40px computed font-size, since although this block is narrow, it has a wide child block, so the cluster will be wide and need autosizing. 16 <div style="width: 800px"> 16 17 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 17 18 </div> -
trunk/LayoutTests/fast/text-autosizing/wide-child.html
r125925 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css"> 7 body { width: 800px; margin: 0; } 6 <style> 7 html { font-size: 16px; } 8 body { width: 800px; margin: 0; overflow-y: hidden; } 8 9 </style> 9 10 10 <script type="text/javascript">11 <script> 11 12 if (window.internals) { 12 13 window.internals.settings.setTextAutosizingEnabled(true); … … 21 22 22 23 <div style="width: 320px"> 23 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.24 This text should all be autosized to 40px computed font-size, since although this block is narrow, it has a wide child block, so the cluster will be wide and need autosizing. 24 25 <div style="width: 800px"> 25 26 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. -
trunk/LayoutTests/fast/text-autosizing/wide-iframe-expected.html
r126058 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">7 body { width: 800px; margin: 0; overflow-y: hidden;}6 <style> 7 body { width: 800px; margin: 0; } 8 8 </style> 9 9 … … 12 12 13 13 <iframe style="width: 3200px; height: 50%; border: 0" src='data:text/html, 14 <html><body style="margin: 0; overflow-y: hidden"><div style="width: 1600px; font-size: 2.5rem"> 15 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 14 <html style="font-size: 16px"><body style="margin: 0; overflow-y: hidden"><div style="width: 1600px; font-size: 2.5rem"> 15 This text should be autosized to just 40px computed font size, i.e. scaled up by 2.5x, since although this block is 1600px wide and is in a 3200px wide iframe, the top level frame is only 800px wide, and min(1600, 3200, 800) / 320 = 2.5.<br> 16 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 16 17 </div></body></html>'> 17 18 -
trunk/LayoutTests/fast/text-autosizing/wide-iframe.html
r126058 r129195 4 4 5 5 <meta name="viewport" content="width=800"> 6 <style type="text/css">7 body { width: 800px; margin: 0; overflow-y: hidden;}6 <style> 7 body { width: 800px; margin: 0; } 8 8 </style> 9 9 10 <script type="text/javascript">10 <script> 11 11 if (window.internals) { 12 12 window.internals.settings.setTextAutosizingEnabled(true); … … 21 21 22 22 <iframe style="width: 3200px; height: 50%; border: 0" src='data:text/html, 23 <html><body style="margin: 0; overflow-y: hidden"><div style="width: 1600px"> 24 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 23 <html style="font-size: 16px"><body style="margin: 0; overflow-y: hidden"><div style="width: 1600px"> 24 This text should be autosized to just 40px computed font size, i.e. scaled up by 2.5x, since although this block is 1600px wide and is in a 3200px wide iframe, the top level frame is only 800px wide, and min(1600, 3200, 800) / 320 = 2.5.<br> 25 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 25 26 </div></body></html>'> 26 27 -
trunk/Source/WebCore/ChangeLog
r129191 r129195 1 2012-09-20 John Mellor <johnme@chromium.org> 2 3 Text Autosizing: Cluster text at flow roots, for consistency and to avoid autosizing headers/footers. 4 https://bugs.webkit.org/show_bug.cgi?id=97025 5 6 Reviewed by Julien Chaffraix. 7 8 This patch has 3 main changes: 9 10 1. All text within a "cluster" (roughly equivalent to a CSS flow root / 11 block formatting context) must have a uniform textAutosizingMultiplier, 12 except for subtrees which are themselves clusters. This improves the 13 consistency of the final output, since sibling blocks are now more 14 likely to have the same multiplier (hence grow in proportion). 15 16 2. Clusters must contain a minimum amount of text in order to be 17 autosized (4 lines of text, assuming each char is 1em wide, so about 18 2 lines of text in practice). This is to reduce the likelihood of 19 autosizing things like headers and footers, which can be quite 20 visually distracting. The rationale is that if a cluster contains 21 very few lines of text then it's ok to have to zoom in and pan from 22 side to side to read each line, since if there are very few lines of 23 text you'll only need to pan across once or twice. 24 25 3. To avoid adding a 3rd tree traversal, processSubtree/processBox were 26 refactored such that all of Text Autosizing now happens as a single 27 tree traversal (hence halving the number of tree traversals done). 28 29 Tests: fast/text-autosizing/cluster-narrow-in-wide.html 30 fast/text-autosizing/cluster-wide-in-narrow.html 31 fast/text-autosizing/clusters-insufficient-text.html 32 fast/text-autosizing/clusters-insufficient-width.html 33 fast/text-autosizing/clusters-sufficient-text-except-in-root.html 34 fast/text-autosizing/clusters-sufficient-width.html 35 36 * rendering/TextAutosizer.cpp: 37 (TextAutosizingWindowInfo): 38 39 Added this struct to bundle together the various sizes that 40 processSubtree needs to pass to every recursive call to 41 processCluster and processContainer. 42 43 (WebCore::TextAutosizer::processSubtree): 44 45 - Bundle windowSize and minLayoutSize together as a single struct, 46 TextAutosizingWindowInfo, rather than passing them separately. 47 - Walk up the tree to find the current cluster and container, rather 48 than (incorrectly) assuming that the layoutRoot is always a 49 container. 50 - Call processCluster instead of traversing the tree. 51 52 (WebCore::TextAutosizer::processCluster): 53 54 Calculates the multiplier based on the width of the cluster (moved 55 the calculation here from processBox, since now the multiplier is 56 fixed per cluster), and delegates to processContainer for the actual 57 tree traversal (since clusters are also containers). 58 59 (WebCore::contentHeightIsConstrained): 60 61 Changed parameter to RenderBlock. 62 63 (WebCore::TextAutosizer::processContainer): 64 65 This now takes care of the whole tree traversal, recursively calling 66 processCluster/processContainer when it encounters such an object, 67 and setMultiplier on RenderText objects (as processBox used to). 68 Also added a check that the RenderText's multiplier is not already 69 equal to the target multiplier (to save needlessly setting it). 70 71 (WebCore::TextAutosizer::isContainer): 72 73 - Changed to be a positive (is) instead of negative (isNot) check. 74 - Require objects to be RenderBlocks so it's easier to find them 75 using containingBlock, and there don't seem to be many interesting 76 RenderBoxes that aren't RenderBlocks. 77 78 (WebCore::TextAutosizer::isAutosizingCluster): 79 80 A container that is also a flow root / block formatting context 81 (approximately), hence demarcates an independent region of the page, 82 within which we want consistent autosizing. 83 84 (WebCore::TextAutosizer::clusterShouldBeAutosized): 85 86 Uses measureDescendantTextWidth and to check whether the cluster 87 contains enough text to be worth autosizing. 88 89 (WebCore::TextAutosizer::measureDescendantTextWidth): 90 91 Recursively traverse the cluster, skipping constrained height 92 containers as processContainer does, to measure how much autosizable 93 text it contains. Early out as soon as the minimum text width is 94 reached. 95 96 (WebCore::TextAutosizer::nextInPreOrderSkippingDescendantsOfContainers): 97 98 Replaces nextInPreOrderMatchingFilter. The filter is now fixed to 99 isContainer (we no longer need an isAutosizingCluster filter, since 100 I consolidated the tree traversal), and filtered objects are 101 actually returned (so they can in turn be recursively traversed), 102 it's just their descendants that get skipped. 103 104 * rendering/TextAutosizer.h: 105 (TextAutosizer): 106 107 - Deleted RenderObjectFilterFunctor, since the filter of 108 nextInPreOrderSkippingDescendantsOfContainers is now fixed. 109 1 110 2012-09-20 Yoshifumi Inoue <yosin@chromium.org> 2 111 -
trunk/Source/WebCore/rendering/TextAutosizer.cpp
r128927 r129195 36 36 namespace WebCore { 37 37 38 struct TextAutosizingWindowInfo { 39 IntSize windowSize; 40 IntSize minLayoutSize; 41 }; 42 38 43 TextAutosizer::TextAutosizer(Document* document) 39 44 : m_document(document) … … 54 59 Frame* mainFrame = m_document->page()->mainFrame(); 55 60 61 TextAutosizingWindowInfo windowInfo; 62 56 63 // Window area, in logical (density-independent) pixels. 57 IntSizewindowSize = m_document->settings()->textAutosizingWindowSizeOverride();58 if (window Size.isEmpty()) {64 windowInfo.windowSize = m_document->settings()->textAutosizingWindowSizeOverride(); 65 if (windowInfo.windowSize.isEmpty()) { 59 66 bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWidthOverride(mainFrame); 60 window Size = mainFrame->view()->visibleContentRect(includeScrollbars).size(); // FIXME: Check that this is always in logical (density-independent) pixels (see wkbug.com/87440).67 windowInfo.windowSize = mainFrame->view()->visibleContentRect(includeScrollbars).size(); // FIXME: Check that this is always in logical (density-independent) pixels (see wkbug.com/87440). 61 68 } 62 69 63 70 // Largest area of block that can be visible at once (assuming the main 64 71 // frame doesn't get scaled to less than overview scale), in CSS pixels. 65 IntSizeminLayoutSize = mainFrame->view()->layoutSize();72 windowInfo.minLayoutSize = mainFrame->view()->layoutSize(); 66 73 for (Frame* frame = m_document->frame(); frame; frame = frame->tree()->parent()) { 67 74 if (!frame->view()->isInChildFrameWithFrameFlattening()) 68 minLayoutSize = minLayoutSize.shrunkTo(frame->view()->layoutSize()); 69 } 70 71 for (RenderObject* descendant = layoutRoot->nextInPreOrder(layoutRoot); descendant; descendant = descendant->nextInPreOrder(layoutRoot)) { 72 if (isNotAnAutosizingContainer(descendant)) 73 continue; 74 processBox(toRenderBox(descendant), windowSize, minLayoutSize); 75 } 76 75 windowInfo.minLayoutSize = windowInfo.minLayoutSize.shrunkTo(frame->view()->layoutSize()); 76 } 77 78 // The layoutRoot could be neither a container nor a cluster, so walk up the tree till we find each of these. 79 RenderBlock* container = layoutRoot->isRenderBlock() ? toRenderBlock(layoutRoot) : layoutRoot->containingBlock(); 80 while (container && !isAutosizingContainer(container)) 81 container = container->containingBlock(); 82 83 RenderBlock* cluster = container; 84 while (cluster && (!isAutosizingContainer(cluster) || !isAutosizingCluster(cluster))) 85 cluster = cluster->containingBlock(); 86 87 processCluster(cluster, container, layoutRoot, windowInfo); 77 88 return true; 78 89 } 79 90 80 static bool contentHeightIsConstrained(const RenderBox* box) 91 void TextAutosizer::processCluster(RenderBlock* cluster, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo& windowInfo) 92 { 93 ASSERT(isAutosizingCluster(cluster)); 94 95 // FIXME: Many pages set a max-width on their content. So especially for the RenderView, 96 // instead of just taking the width of |cluster| we should find the lowest common ancestor of 97 // the first and last descendant text node of the cluster (i.e. the deepest wrapper block that 98 // contains all the text), and use its width instead. 99 RenderBlock* lowestCommonAncestor = cluster; 100 float commonAncestorWidth = lowestCommonAncestor->contentLogicalWidth(); 101 102 float multiplier = 1; 103 if (clusterShouldBeAutosized(lowestCommonAncestor, commonAncestorWidth)) { 104 int logicalWindowWidth = cluster->isHorizontalWritingMode() ? windowInfo.windowSize.width() : windowInfo.windowSize.height(); 105 int logicalLayoutWidth = cluster->isHorizontalWritingMode() ? windowInfo.minLayoutSize.width() : windowInfo.minLayoutSize.height(); 106 // Ignore box width in excess of the layout width, to avoid extreme multipliers. 107 float logicalClusterWidth = std::min<float>(commonAncestorWidth, logicalLayoutWidth); 108 109 multiplier = logicalClusterWidth / logicalWindowWidth; 110 multiplier *= m_document->settings()->textAutosizingFontScaleFactor(); 111 multiplier = std::max(1.0f, multiplier); 112 } 113 114 processContainer(multiplier, container, subtreeRoot, windowInfo); 115 } 116 117 static bool contentHeightIsConstrained(const RenderBlock* container) 81 118 { 82 119 // FIXME: Propagate constrainedness down the tree, to avoid inefficiently walking back up from each box. 83 120 // FIXME: This code needs to take into account vertical writing modes. 84 121 // FIXME: Consider additional heuristics, such as ignoring fixed heights if the content is already overflowing before autosizing kicks in. 85 for ( const RenderBox* container = box; container; container = container->containingBlock()) {122 for (; container; container = container->containingBlock()) { 86 123 RenderStyle* style = container->style(); 87 124 if (style->overflowY() >= OSCROLL) … … 98 135 } 99 136 100 void TextAutosizer::processBox(RenderBox* box, const IntSize& windowSize, const IntSize& layoutSize) 101 { 102 if (contentHeightIsConstrained(box)) 103 return; 104 105 int logicalWindowWidth = box->isHorizontalWritingMode() ? windowSize.width() : windowSize.height(); 106 int logicalLayoutWidth = box->isHorizontalWritingMode() ? layoutSize.width() : layoutSize.height(); 107 // Ignore box width in excess of the layout width, to avoid extreme multipliers. 108 float logicalBoxWidth = std::min<float>(box->logicalWidth(), logicalLayoutWidth); 109 110 float multiplier = logicalBoxWidth / logicalWindowWidth; 111 multiplier *= m_document->settings()->textAutosizingFontScaleFactor(); 112 113 if (multiplier < 1) 114 return; 115 RenderObject* descendant = nextInPreOrderMatchingFilter(box, box, isNotAnAutosizingContainer); 137 void TextAutosizer::processContainer(float multiplier, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo& windowInfo) 138 { 139 ASSERT(isAutosizingContainer(container)); 140 141 float localMultiplier = contentHeightIsConstrained(container) ? 1 : multiplier; 142 143 RenderObject* descendant = nextInPreOrderSkippingDescendantsOfContainers(subtreeRoot, subtreeRoot); 116 144 while (descendant) { 117 145 if (descendant->isText()) { 118 setMultiplier(descendant, multiplier); 119 setMultiplier(descendant->parent(), multiplier); // Parent does line spacing. 146 if (localMultiplier != descendant->style()->textAutosizingMultiplier()) { 147 setMultiplier(descendant, localMultiplier); 148 setMultiplier(descendant->parent(), localMultiplier); // Parent does line spacing. 149 } 120 150 // FIXME: Increase list marker size proportionately. 151 } else if (isAutosizingContainer(descendant)) { 152 RenderBlock* descendantBlock = toRenderBlock(descendant); 153 if (isAutosizingCluster(descendantBlock)) 154 processCluster(descendantBlock, descendantBlock, descendantBlock, windowInfo); 155 else 156 processContainer(multiplier, descendantBlock, descendantBlock, windowInfo); 121 157 } 122 descendant = nextInPreOrder MatchingFilter(descendant, box, isNotAnAutosizingContainer);158 descendant = nextInPreOrderSkippingDescendantsOfContainers(descendant, subtreeRoot); 123 159 } 124 160 } … … 159 195 } 160 196 161 bool TextAutosizer::isNotAnAutosizingContainer(const RenderObject* renderer) 162 { 163 // "Autosizing containers" are the smallest unit for which we can enable/disable 164 // Text Autosizing. A uniform text size multiplier is enforced within them. 165 // - Must be RenderBoxes since they need a well-defined logicalWidth(). 197 bool TextAutosizer::isAutosizingContainer(const RenderObject* renderer) 198 { 199 // "Autosizing containers" are the smallest unit for which we can 200 // enable/disable Text Autosizing. 166 201 // - Must not be inline, as different multipliers on one line looks terrible. 167 202 // - Must not be list items, as items in the same list should look consistent. 168 return !renderer->isBox() || renderer->isInline() || renderer->isListItem(); 169 } 170 171 RenderObject* TextAutosizer::nextInPreOrderMatchingFilter(RenderObject* current, const RenderObject* stayWithin, RenderObjectFilterFunctor filter) 172 { 173 for (RenderObject* child = current->firstChild(); child; child = child->nextSibling()) 174 if (filter(child)) 203 return renderer->isRenderBlock() && !renderer->isInline() && !renderer->isListItem(); 204 } 205 206 bool TextAutosizer::isAutosizingCluster(const RenderBlock* renderer) 207 { 208 // "Autosizing clusters" are special autosizing containers within which we 209 // want to enforce a uniform text size multiplier, in the hopes of making 210 // the major sections of the page look internally consistent. 211 // All their descendents (including other autosizing containers) must share 212 // the same multiplier, except for subtrees which are themselves clusters, 213 // and some of their descendent containers might not be autosized at all 214 // (for example if their height is constrained). 215 // Additionally, clusterShouldBeAutosized requires each cluster to contain a 216 // minimum amount of text, without which it won't be autosized. 217 // 218 // Clusters are chosen using very similar criteria to CSS flow roots, aka 219 // block formatting contexts (http://w3.org/TR/css3-box/#flow-root), since 220 // flow roots correspond to box containers that behave somewhat 221 // independently from their parent (for example they don't overlap floats). 222 // The definition of a flow flow root also conveniently includes most of the 223 // ways that a box and its children can have significantly different width 224 // from the box's parent (we want to avoid having significantly different 225 // width blocks within a cluster, since the narrower blocks would end up 226 // larger than would otherwise be necessary). 227 ASSERT(isAutosizingContainer(renderer)); 228 229 return renderer->isRenderView() 230 || renderer->isFloating() 231 || renderer->isOutOfFlowPositioned() 232 || renderer->isTableCell() 233 || renderer->isTableCaption() 234 || renderer->isFlexibleBoxIncludingDeprecated() 235 || renderer->hasColumns() 236 || renderer->style()->overflowX() != OVISIBLE 237 || renderer->style()->overflowY() != OVISIBLE 238 || renderer->containingBlock()->isHorizontalWritingMode() != renderer->isHorizontalWritingMode(); 239 // FIXME: Tables need special handling to multiply all their columns by 240 // the same amount even if they're different widths; so do hasColumns() 241 // renderers, and probably flexboxes... 242 } 243 244 bool TextAutosizer::clusterShouldBeAutosized(const RenderBlock* lowestCommonAncestor, float commonAncestorWidth) 245 { 246 // Don't autosize clusters that contain less than 4 lines of text (in 247 // practice less lines are required, since measureDescendantTextWidth 248 // assumes that characters are 1em wide, but most characters are narrower 249 // than that, so we're overestimating their contribution to the linecount). 250 // 251 // This is to reduce the likelihood of autosizing things like headers and 252 // footers, which can be quite visually distracting. The rationale is that 253 // if a cluster contains very few lines of text then it's ok to have to zoom 254 // in and pan from side to side to read each line, since if there are very 255 // few lines of text you'll only need to pan across once or twice. 256 const float minLinesOfText = 4; 257 float minTextWidth = commonAncestorWidth * minLinesOfText; 258 float textWidth = 0; 259 measureDescendantTextWidth(lowestCommonAncestor, minTextWidth, textWidth); 260 if (textWidth >= minTextWidth) 261 return true; 262 return false; 263 } 264 265 void TextAutosizer::measureDescendantTextWidth(const RenderBlock* container, float minTextWidth, float& textWidth) 266 { 267 bool skipLocalText = contentHeightIsConstrained(container); 268 269 RenderObject* descendant = nextInPreOrderSkippingDescendantsOfContainers(container, container); 270 while (descendant) { 271 if (!skipLocalText && descendant->isText()) { 272 textWidth += toRenderText(descendant)->renderedTextLength() * descendant->style()->specifiedFontSize(); 273 } else if (isAutosizingContainer(descendant)) { 274 RenderBlock* descendantBlock = toRenderBlock(descendant); 275 if (!isAutosizingCluster(descendantBlock)) 276 measureDescendantTextWidth(descendantBlock, minTextWidth, textWidth); 277 } 278 if (textWidth >= minTextWidth) 279 return; 280 descendant = nextInPreOrderSkippingDescendantsOfContainers(descendant, container); 281 } 282 } 283 284 RenderObject* TextAutosizer::nextInPreOrderSkippingDescendantsOfContainers(const RenderObject* current, const RenderObject* stayWithin) 285 { 286 if (current == stayWithin || !isAutosizingContainer(current)) 287 for (RenderObject* child = current->firstChild(); child; child = child->nextSibling()) 175 288 return child; 176 289 … … 179 292 return 0; 180 293 for (RenderObject* sibling = ancestor->nextSibling(); sibling; sibling = sibling->nextSibling()) 181 if (filter(sibling)) 182 return sibling; 294 return sibling; 183 295 } 184 296 -
trunk/Source/WebCore/rendering/TextAutosizer.h
r126816 r129195 37 37 38 38 class Document; 39 class RenderB ox;39 class RenderBlock; 40 40 class RenderObject; 41 41 class RenderStyle; 42 42 class RenderText; 43 struct TextAutosizingWindowInfo; 43 44 44 45 class TextAutosizer { … … 57 58 explicit TextAutosizer(Document*); 58 59 59 void processBox(RenderBox*, const IntSize& windowSize, const IntSize& layoutSize); 60 void processCluster(RenderBlock* cluster, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&); 61 void processContainer(float multiplier, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&); 62 60 63 void setMultiplier(RenderObject*, float); 61 64 62 static bool isNotAnAutosizingContainer(const RenderObject*); 65 static bool isAutosizingContainer(const RenderObject*); 66 static bool isAutosizingCluster(const RenderBlock*); 63 67 64 typedef bool (*RenderObjectFilterFunctor)(const RenderObject*); 65 // Use to traverse the tree of descendants, excluding any subtrees within that whose root doesn't pass the filter. 66 static RenderObject* nextInPreOrderMatchingFilter(RenderObject* current, const RenderObject* stayWithin, RenderObjectFilterFunctor); 68 static bool clusterShouldBeAutosized(const RenderBlock* lowestCommonAncestor, float commonAncestorWidth); 69 static void measureDescendantTextWidth(const RenderBlock* container, float minTextWidth, float& textWidth); 70 71 // Use to traverse the tree of descendants, excluding descendants of containers (but returning the containers themselves). 72 static RenderObject* nextInPreOrderSkippingDescendantsOfContainers(const RenderObject* current, const RenderObject* stayWithin); 67 73 68 74 Document* m_document;
Note: See TracChangeset
for help on using the changeset viewer.