diff options
author | commit-queue@webkit.org <commit-queue@webkit.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2012-09-21 06:20:57 +0000 |
---|---|---|
committer | commit-queue@webkit.org <commit-queue@webkit.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2012-09-21 06:20:57 +0000 |
commit | 4c33c8b64e190f0753828bdde5a03140437c2c72 (patch) | |
tree | 4be774a799cc90088b44da17b6fa108afe9643f5 /third_party/WebKit | |
parent | 649dde1d0881279bea5d621d48f95ef5003e43e1 (diff) | |
download | chromium_src-4c33c8b64e190f0753828bdde5a03140437c2c72.zip chromium_src-4c33c8b64e190f0753828bdde5a03140437c2c72.tar.gz chromium_src-4c33c8b64e190f0753828bdde5a03140437c2c72.tar.bz2 |
Text Autosizing: Cluster text at flow roots, for consistency and to avoid autosizing headers/footers.
https://bugs.webkit.org/show_bug.cgi?id=97025
Patch by John Mellor <johnme@chromium.org> on 2012-09-20
Reviewed by Julien Chaffraix.
Source/WebCore:
This patch has 3 main changes:
1. All text within a "cluster" (roughly equivalent to a CSS flow root /
block formatting context) must have a uniform textAutosizingMultiplier,
except for subtrees which are themselves clusters. This improves the
consistency of the final output, since sibling blocks are now more
likely to have the same multiplier (hence grow in proportion).
2. Clusters must contain a minimum amount of text in order to be
autosized (4 lines of text, assuming each char is 1em wide, so about
2 lines of text in practice). This is to reduce the likelihood of
autosizing things like headers and footers, which can be quite
visually distracting. The rationale is that if a cluster contains
very few lines of text then it's ok to have to zoom in and pan from
side to side to read each line, since if there are very few lines of
text you'll only need to pan across once or twice.
3. To avoid adding a 3rd tree traversal, processSubtree/processBox were
refactored such that all of Text Autosizing now happens as a single
tree traversal (hence halving the number of tree traversals done).
Tests: fast/text-autosizing/cluster-narrow-in-wide.html
fast/text-autosizing/cluster-wide-in-narrow.html
fast/text-autosizing/clusters-insufficient-text.html
fast/text-autosizing/clusters-insufficient-width.html
fast/text-autosizing/clusters-sufficient-text-except-in-root.html
fast/text-autosizing/clusters-sufficient-width.html
* rendering/TextAutosizer.cpp:
(TextAutosizingWindowInfo):
Added this struct to bundle together the various sizes that
processSubtree needs to pass to every recursive call to
processCluster and processContainer.
(WebCore::TextAutosizer::processSubtree):
- Bundle windowSize and minLayoutSize together as a single struct,
TextAutosizingWindowInfo, rather than passing them separately.
- Walk up the tree to find the current cluster and container, rather
than (incorrectly) assuming that the layoutRoot is always a
container.
- Call processCluster instead of traversing the tree.
(WebCore::TextAutosizer::processCluster):
Calculates the multiplier based on the width of the cluster (moved
the calculation here from processBox, since now the multiplier is
fixed per cluster), and delegates to processContainer for the actual
tree traversal (since clusters are also containers).
(WebCore::contentHeightIsConstrained):
Changed parameter to RenderBlock.
(WebCore::TextAutosizer::processContainer):
This now takes care of the whole tree traversal, recursively calling
processCluster/processContainer when it encounters such an object,
and setMultiplier on RenderText objects (as processBox used to).
Also added a check that the RenderText's multiplier is not already
equal to the target multiplier (to save needlessly setting it).
(WebCore::TextAutosizer::isContainer):
- Changed to be a positive (is) instead of negative (isNot) check.
- Require objects to be RenderBlocks so it's easier to find them
using containingBlock, and there don't seem to be many interesting
RenderBoxes that aren't RenderBlocks.
(WebCore::TextAutosizer::isAutosizingCluster):
A container that is also a flow root / block formatting context
(approximately), hence demarcates an independent region of the page,
within which we want consistent autosizing.
(WebCore::TextAutosizer::clusterShouldBeAutosized):
Uses measureDescendantTextWidth and to check whether the cluster
contains enough text to be worth autosizing.
(WebCore::TextAutosizer::measureDescendantTextWidth):
Recursively traverse the cluster, skipping constrained height
containers as processContainer does, to measure how much autosizable
text it contains. Early out as soon as the minimum text width is
reached.
(WebCore::TextAutosizer::nextInPreOrderSkippingDescendantsOfContainers):
Replaces nextInPreOrderMatchingFilter. The filter is now fixed to
isContainer (we no longer need an isAutosizingCluster filter, since
I consolidated the tree traversal), and filtered objects are
actually returned (so they can in turn be recursively traversed),
it's just their descendants that get skipped.
* rendering/TextAutosizer.h:
(TextAutosizer):
- Deleted RenderObjectFilterFunctor, since the filter of
nextInPreOrderSkippingDescendantsOfContainers is now fixed.
LayoutTests:
Added 6 tests (cluster*.html). Updated various other tests to have
enough text so that they continue to pass, or that if they fail, it's
for the reason that was being tested, not just because clustering
decided they had insufficient text.
* fast/text-autosizing/cluster-narrow-in-wide-expected.html: Added.
* fast/text-autosizing/cluster-narrow-in-wide.html: Copied from LayoutTests/fast/text-autosizing/em-margin-border-padding.html.
* fast/text-autosizing/cluster-wide-in-narrow-expected.html: Added.
* fast/text-autosizing/cluster-wide-in-narrow.html: Added.
* fast/text-autosizing/clusters-insufficient-text-expected.html: Added.
* fast/text-autosizing/clusters-insufficient-text.html: Added.
* fast/text-autosizing/clusters-insufficient-width-expected.html: Added.
* fast/text-autosizing/clusters-insufficient-width.html: Added.
* fast/text-autosizing/clusters-sufficient-text-except-in-root-expected.html: Added.
* fast/text-autosizing/clusters-sufficient-text-except-in-root.html: Added.
* fast/text-autosizing/clusters-sufficient-width-expected.html: Added.
* fast/text-autosizing/clusters-sufficient-width.html: Added.
* fast/text-autosizing/constrained-and-overflow-auto-ancestor-expected.html:
* fast/text-autosizing/constrained-and-overflow-auto-ancestor.html:
* fast/text-autosizing/constrained-and-overflow-hidden-ancestor-expected.html:
* fast/text-autosizing/constrained-and-overflow-hidden-ancestor.html:
* fast/text-autosizing/constrained-and-overflow-paged-x-ancestor-expected.html:
* fast/text-autosizing/constrained-and-overflow-paged-x-ancestor.html:
* fast/text-autosizing/constrained-and-overflow-scroll-ancestor-expected.html:
* fast/text-autosizing/constrained-and-overflow-scroll-ancestor.html:
* fast/text-autosizing/constrained-height-ancestor-expected.html:
* fast/text-autosizing/constrained-height-ancestor.html:
* fast/text-autosizing/constrained-maxheight-ancestor-expected.html:
* fast/text-autosizing/constrained-maxheight-ancestor.html:
* fast/text-autosizing/constrained-maxheight-expected.html:
* fast/text-autosizing/constrained-maxheight.html:
* fast/text-autosizing/constrained-percent-maxheight-expected.html:
* fast/text-autosizing/constrained-percent-maxheight.html:
* fast/text-autosizing/constrained-percent-of-viewport-maxheight-expected.html:
* fast/text-autosizing/constrained-percent-of-viewport-maxheight.html:
* fast/text-autosizing/constrained-then-overflow-ancestors-expected.html:
* fast/text-autosizing/constrained-then-overflow-ancestors.html:
* fast/text-autosizing/constrained-then-overflow-then-positioned-ancestors-expected.html:
* fast/text-autosizing/constrained-then-overflow-then-positioned-ancestors.html:
* fast/text-autosizing/constrained-then-position-absolute-ancestors-expected.html:
* fast/text-autosizing/constrained-then-position-absolute-ancestors.html:
* fast/text-autosizing/constrained-then-position-fixed-ancestors-expected.html:
* fast/text-autosizing/constrained-then-position-fixed-ancestors.html:
* fast/text-autosizing/constrained-within-overflow-ancestor-expected.html:
* fast/text-autosizing/constrained-within-overflow-ancestor.html:
* fast/text-autosizing/em-margin-border-padding-expected.html:
* fast/text-autosizing/em-margin-border-padding.html:
* fast/text-autosizing/narrow-child-expected.html:
* fast/text-autosizing/narrow-child.html:
* fast/text-autosizing/wide-child-expected.html:
* fast/text-autosizing/wide-child.html:
* fast/text-autosizing/wide-iframe-expected.html:
* fast/text-autosizing/wide-iframe.html:
git-svn-id: svn://svn.chromium.org/blink/trunk@129195 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit')
54 files changed, 982 insertions, 156 deletions
diff --git a/third_party/WebKit/LayoutTests/ChangeLog b/third_party/WebKit/LayoutTests/ChangeLog index aab1ac0..e0f1a5f 100644 --- a/third_party/WebKit/LayoutTests/ChangeLog +++ b/third_party/WebKit/LayoutTests/ChangeLog @@ -1,3 +1,64 @@ +2012-09-20 John Mellor <johnme@chromium.org> + + Text Autosizing: Cluster text at flow roots, for consistency and to avoid autosizing headers/footers. + https://bugs.webkit.org/show_bug.cgi?id=97025 + + Reviewed by Julien Chaffraix. + + Added 6 tests (cluster*.html). Updated various other tests to have + enough text so that they continue to pass, or that if they fail, it's + for the reason that was being tested, not just because clustering + decided they had insufficient text. + + * fast/text-autosizing/cluster-narrow-in-wide-expected.html: Added. + * fast/text-autosizing/cluster-narrow-in-wide.html: Copied from LayoutTests/fast/text-autosizing/em-margin-border-padding.html. + * fast/text-autosizing/cluster-wide-in-narrow-expected.html: Added. + * fast/text-autosizing/cluster-wide-in-narrow.html: Added. + * fast/text-autosizing/clusters-insufficient-text-expected.html: Added. + * fast/text-autosizing/clusters-insufficient-text.html: Added. + * fast/text-autosizing/clusters-insufficient-width-expected.html: Added. + * fast/text-autosizing/clusters-insufficient-width.html: Added. + * fast/text-autosizing/clusters-sufficient-text-except-in-root-expected.html: Added. + * fast/text-autosizing/clusters-sufficient-text-except-in-root.html: Added. + * fast/text-autosizing/clusters-sufficient-width-expected.html: Added. + * fast/text-autosizing/clusters-sufficient-width.html: Added. + * fast/text-autosizing/constrained-and-overflow-auto-ancestor-expected.html: + * fast/text-autosizing/constrained-and-overflow-auto-ancestor.html: + * fast/text-autosizing/constrained-and-overflow-hidden-ancestor-expected.html: + * fast/text-autosizing/constrained-and-overflow-hidden-ancestor.html: + * fast/text-autosizing/constrained-and-overflow-paged-x-ancestor-expected.html: + * fast/text-autosizing/constrained-and-overflow-paged-x-ancestor.html: + * fast/text-autosizing/constrained-and-overflow-scroll-ancestor-expected.html: + * fast/text-autosizing/constrained-and-overflow-scroll-ancestor.html: + * fast/text-autosizing/constrained-height-ancestor-expected.html: + * fast/text-autosizing/constrained-height-ancestor.html: + * fast/text-autosizing/constrained-maxheight-ancestor-expected.html: + * fast/text-autosizing/constrained-maxheight-ancestor.html: + * fast/text-autosizing/constrained-maxheight-expected.html: + * fast/text-autosizing/constrained-maxheight.html: + * fast/text-autosizing/constrained-percent-maxheight-expected.html: + * fast/text-autosizing/constrained-percent-maxheight.html: + * fast/text-autosizing/constrained-percent-of-viewport-maxheight-expected.html: + * fast/text-autosizing/constrained-percent-of-viewport-maxheight.html: + * fast/text-autosizing/constrained-then-overflow-ancestors-expected.html: + * fast/text-autosizing/constrained-then-overflow-ancestors.html: + * fast/text-autosizing/constrained-then-overflow-then-positioned-ancestors-expected.html: + * fast/text-autosizing/constrained-then-overflow-then-positioned-ancestors.html: + * fast/text-autosizing/constrained-then-position-absolute-ancestors-expected.html: + * fast/text-autosizing/constrained-then-position-absolute-ancestors.html: + * fast/text-autosizing/constrained-then-position-fixed-ancestors-expected.html: + * fast/text-autosizing/constrained-then-position-fixed-ancestors.html: + * fast/text-autosizing/constrained-within-overflow-ancestor-expected.html: + * fast/text-autosizing/constrained-within-overflow-ancestor.html: + * fast/text-autosizing/em-margin-border-padding-expected.html: + * fast/text-autosizing/em-margin-border-padding.html: + * fast/text-autosizing/narrow-child-expected.html: + * fast/text-autosizing/narrow-child.html: + * fast/text-autosizing/wide-child-expected.html: + * fast/text-autosizing/wide-child.html: + * fast/text-autosizing/wide-iframe-expected.html: + * fast/text-autosizing/wide-iframe.html: + 2012-09-20 Yury Semikhatsky <yurys@chromium.org> Unreviewed. Mark fast/text/international/hebrew-selection.html as failing diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/cluster-narrow-in-wide-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/cluster-narrow-in-wide-expected.html new file mode 100644 index 0000000..44e6572 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/cluster-narrow-in-wide-expected.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> +<head> + +<meta name="viewport" content="width=800"> +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } +</style> + +</head> +<body> + +<div style="width: 400px; float: left; font-size: 1.25rem"> + 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. +</div> + +<div style="width: 320px; font-size: 2.5rem"> + 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. +</div> + +<div style="font-size: 2.5rem"> + This text should similarly be autosized to 40px.<br> + 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. +</div> + +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/cluster-narrow-in-wide.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/cluster-narrow-in-wide.html new file mode 100644 index 0000000..6da71ee --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/cluster-narrow-in-wide.html @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<html> +<head> + +<meta name="viewport" content="width=800"> +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } +</style> + +<script> +if (window.internals) { + window.internals.settings.setTextAutosizingEnabled(true); + window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); +} else if (window.console && console.warn) { + console.warn("This test depends on the Text Autosizing setting being true, so run it in DumpRenderTree, or manually enable Text Autosizing, and either use a mobile device with 320px device-width (like Nexus S or iPhone), or define HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP."); +} +</script> + +</head> +<body> + +<div style="width: 400px; float: left"> + 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. +</div> + +<div style="width: 320px"> + 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. +</div> + +<div> + This text should similarly be autosized to 40px.<br> + 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. +</div> + +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/cluster-wide-in-narrow-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/cluster-wide-in-narrow-expected.html new file mode 100644 index 0000000..6cff06e --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/cluster-wide-in-narrow-expected.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html> +<head> + +<meta name="viewport" content="width=800"> +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } +</style> + +</head> +<body> + +<div style="width: 400px; float: left"> + <div style="width: 800px; float: left; font-size: 2.5rem"> + This text should be autosized to 40px computed font size (16 * 800/320), since the float:left causes this to be a new cluster, and it is 800px wide.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + </div> + + <div style="width: 800px; font-size: 1.25rem"> + This text should be autosized to just 20px computed font-size (16 * 400/320), since despite its width:800px it is part of the 400px wide root cluster.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + </div> + + <div style="font-size: 1.25rem"> + This text should similarly be autosized to 20px.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + </div> +</div> + +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/cluster-wide-in-narrow.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/cluster-wide-in-narrow.html new file mode 100644 index 0000000..b2ef010 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/cluster-wide-in-narrow.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<html> +<head> + +<meta name="viewport" content="width=800"> +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } +</style> + +<script> +if (window.internals) { + window.internals.settings.setTextAutosizingEnabled(true); + window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); +} else if (window.console && console.warn) { + console.warn("This test depends on the Text Autosizing setting being true, so run it in DumpRenderTree, or manually enable Text Autosizing, and either use a mobile device with 320px device-width (like Nexus S or iPhone), or define HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP."); +} +</script> + +</head> +<body> + +<div style="width: 400px; float: left"> + <div style="width: 800px; float: left"> + This text should be autosized to 40px computed font size (16 * 800/320), since the float:left causes this to be a new cluster, and it is 800px wide.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + </div> + + <div style="width: 800px"> + This text should be autosized to just 20px computed font-size (16 * 400/320), since despite its width:800px it is part of the 400px wide root cluster.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + </div> + + <div> + This text should similarly be autosized to 20px.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + </div> +</div> + +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-insufficient-text-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-insufficient-text-expected.html new file mode 100644 index 0000000..7e68754 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-insufficient-text-expected.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> +<head> + +<meta name="viewport" content="width=800"> +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } +</style> + +</head> +<body> + +<div style="position: absolute"> + This text should not be autosized (its computed font size should remain 16px), since the position:absolute causes this to be a new cluster, and this cluster doesn't contain enough text. +</div> + +<div style="margin-top: 3em; float: left"> + This text should not be autosized (its computed font size should remain 16px), since the float:left causes this to be a new cluster, and this cluster doesn't contain enough text. +</div> + +<table> + <tr> + <td style="width: 50%"> + This shouldn't be autosized: table cell => new cluster, and it doesn't contain enough text. + </td> + <td style="width: 50%; font-size: 1.25rem"> + However this text should be autosized to 20px computed font size, since this table cell does contain enough text.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit. + </td> + </tr> +</table> + +<div style="-webkit-writing-mode: vertical-rl"> + This text should not be autosized (its computed font size should remain 16px), since the perpendicular writing-mode compared to its containing block causes this to be a new cluster, and this cluster doesn't contain enough text (or have large enough logicalWidth). +</div> + +<div style="font-size: 2.5rem"> + This text is here to make sure the root cluster has enough text and hence gets autosized, so when the divs above don't get autosized it's because they formed a new cluster.<br> + 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. +</div> + +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-insufficient-text.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-insufficient-text.html new file mode 100644 index 0000000..216b1f1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-insufficient-text.html @@ -0,0 +1,53 @@ +<!DOCTYPE html> +<html> +<head> + +<meta name="viewport" content="width=800"> +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } +</style> + +<script> +if (window.internals) { + window.internals.settings.setTextAutosizingEnabled(true); + window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); +} else if (window.console && console.warn) { + console.warn("This test depends on the Text Autosizing setting being true, so run it in DumpRenderTree, or manually enable Text Autosizing, and either use a mobile device with 320px device-width (like Nexus S or iPhone), or define HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP."); +} +</script> + +</head> +<body> + +<div style="position: absolute"> + This text should not be autosized (its computed font size should remain 16px), since the position:absolute causes this to be a new cluster, and this cluster doesn't contain enough text. +</div> + +<div style="margin-top: 3em; float: left"> + This text should not be autosized (its computed font size should remain 16px), since the float:left causes this to be a new cluster, and this cluster doesn't contain enough text. +</div> + +<table> + <tr> + <td style="width: 50%"> + This shouldn't be autosized: table cell => new cluster, and it doesn't contain enough text. + </td> + <td style="width: 50%"> + However this text should be autosized to 20px computed font size, since this table cell does contain enough text.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit. + </td> + </tr> +</table> + +<div style="-webkit-writing-mode: vertical-rl"> + This text should not be autosized (its computed font size should remain 16px), since the perpendicular writing-mode compared to its containing block causes this to be a new cluster, and this cluster doesn't contain enough text (or have large enough logicalWidth). +</div> + +<div> + This text is here to make sure the root cluster has enough text and hence gets autosized, so when the divs above don't get autosized it's because they formed a new cluster.<br> + 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. +</div> + +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-insufficient-width-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-insufficient-width-expected.html new file mode 100644 index 0000000..21c5ad3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-insufficient-width-expected.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<html> +<head> + +<meta name="viewport" content="width=800"> +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } +</style> + +</head> +<body> + +<div style="position: absolute; width: 320px"> + This text should not be autosized (its computed font size should remain 16px), since the position:absolute causes this to be a new cluster, and this cluster isn't wide enough. +</div> + +<div style="margin-top: 6em; float: left; width: 320px"> + This text should not be autosized (its computed font size should remain 16px), since the float:left causes this to be a new cluster, and this cluster isn't wide enough. +</div> + +<table> + <tr> + <td style="width: 320px"> + This text should not be autosized (its computed font size should remain 16px), since being a table cell causes this to be a new cluster, and this cluster isn't wide enough. + </td> + </tr> +</table> + +<div style="-webkit-writing-mode: vertical-rl; height: 320px"> + This text should not be autosized (its computed font size should remain 16px), since the perpendicular writing-mode compared to its containing block causes this to be a new cluster, and this cluster's logicalWidth isn't high enough. +</div> + +<div style="font-size: 2.5rem"> + This text is here to make sure the root cluster has enough text and hence gets autosized, so when the divs above don't get autosized it's because they formed a new cluster.<br> + 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. +</div> + +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-insufficient-width.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-insufficient-width.html new file mode 100644 index 0000000..64d5d35 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-insufficient-width.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<html> +<head> + +<meta name="viewport" content="width=800"> +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } +</style> + +<script> +if (window.internals) { + window.internals.settings.setTextAutosizingEnabled(true); + window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); +} else if (window.console && console.warn) { + console.warn("This test depends on the Text Autosizing setting being true, so run it in DumpRenderTree, or manually enable Text Autosizing, and either use a mobile device with 320px device-width (like Nexus S or iPhone), or define HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP."); +} +</script> + +</head> +<body> + +<div style="position: absolute; width: 320px"> + This text should not be autosized (its computed font size should remain 16px), since the position:absolute causes this to be a new cluster, and this cluster isn't wide enough. +</div> + +<div style="margin-top: 6em; float: left; width: 320px"> + This text should not be autosized (its computed font size should remain 16px), since the float:left causes this to be a new cluster, and this cluster isn't wide enough. +</div> + +<table> + <tr> + <td style="width: 320px"> + This text should not be autosized (its computed font size should remain 16px), since being a table cell causes this to be a new cluster, and this cluster isn't wide enough. + </td> + </tr> +</table> + +<div style="-webkit-writing-mode: vertical-rl; height: 320px"> + This text should not be autosized (its computed font size should remain 16px), since the perpendicular writing-mode compared to its containing block causes this to be a new cluster, and this cluster's logicalWidth isn't high enough. +</div> + +<div> + This text is here to make sure the root cluster has enough text and hence gets autosized, so when the divs above don't get autosized it's because they formed a new cluster.<br> + 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. +</div> + +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-sufficient-text-except-in-root-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-sufficient-text-except-in-root-expected.html new file mode 100644 index 0000000..94a711a --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-sufficient-text-except-in-root-expected.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<html> +<head> + +<meta name="viewport" content="width=800"> +<style> +html { font-size: 16px; } +body { margin: 0; overflow-y: hidden; } +</style> + +</head> +<body style="width: 640px; position: relative"> + +<div style="position: absolute; font-size: 2rem"> + This text should be autosized to 32px computed font size, but the position:absolute causes this to be a new cluster, so it shouldn't affect the footer.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit. +</div> + +<div style="margin-top: 185px; float: left; font-size: 2rem"> + This text should be autosized to 32px computed font size, but the float:left causes this to be a new cluster, so it shouldn't affect the footer.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit. +</div> + +<table> + <tr> + <td style="font-size: 2rem"> + This text should be autosized to 32px computed font size, but being a table cell causes this to be a new cluster, so it shouldn't affect the footer.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit. + </td> + </tr> +</table> + +<!-- FIXME: Include vertical writing-mode example once http://webkit.org/b/96557 is fixed. --> + +<div> + This shouldn't be autosized (computed font size should remain 16px), as all text above is in other clusters, so the root cluster doesn't contain enough text. +</div> + +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-sufficient-text-except-in-root.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-sufficient-text-except-in-root.html new file mode 100644 index 0000000..46b8d15 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-sufficient-text-except-in-root.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<html> +<head> + +<meta name="viewport" content="width=800"> +<style> +html { font-size: 16px; } +body { margin: 0; overflow-y: hidden; } +</style> + +<script> +if (window.internals) { + window.internals.settings.setTextAutosizingEnabled(true); + window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); +} else if (window.console && console.warn) { + console.warn("This test depends on the Text Autosizing setting being true, so run it in DumpRenderTree, or manually enable Text Autosizing, and either use a mobile device with 320px device-width (like Nexus S or iPhone), or define HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP."); +} +</script> + +</head> +<body style="width: 640px; position: relative"> + +<div style="position: absolute"> + This text should be autosized to 32px computed font size, but the position:absolute causes this to be a new cluster, so it shouldn't affect the footer.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit. +</div> + +<div style="margin-top: 185px; float: left"> + This text should be autosized to 32px computed font size, but the float:left causes this to be a new cluster, so it shouldn't affect the footer.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit. +</div> + +<table> + <tr> + <td> + This text should be autosized to 32px computed font size, but being a table cell causes this to be a new cluster, so it shouldn't affect the footer.<br> + Lorem ipsum dolor sit amet, consectetur adipisicing elit. + </td> + </tr> +</table> + +<!-- FIXME: Include vertical writing-mode example once http://webkit.org/b/96557 is fixed. --> + +<div> + This shouldn't be autosized (computed font size should remain 16px), as all text above is in other clusters, so the root cluster doesn't contain enough text. +</div> + +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-sufficient-width-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-sufficient-width-expected.html new file mode 100644 index 0000000..e5df03f --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-sufficient-width-expected.html @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<html> +<head> + +<meta name="viewport" content="width=800"> +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } +</style> + +</head> +<body> + +<div style="position: absolute; width: 400px; font-size: 20px"> + This text should be autosized to 20px computed font size (16 * 400/320), since the position:absolute causes this to be a new cluster. +</div> + +<div style="margin-top: 100px; float: left; width: 420px; font-size: 21px"> + This text should be autosized to 21px computed font size (16 * 420/320), since the float:left causes this to be a new cluster. +</div> + +<table> + <tr> + <td style="width: 380px; font-size: 19px"> + This text should be autosized to 19px computed font size (16 * 380/320), since being a table cell causes this to be a new cluster. + </td> + </tr> +</table> + +<div style="-webkit-writing-mode: vertical-rl; height: 440px"> + This text should be autosized to 22px computed font size (16 * 440/320), since the perpendicular writing-mode compared to its containing block causes this to be a new cluster. Unfortunately due to <a href="https://bugs.webkit.org/show_bug.cgi?id=96557">http://webkit.org/b/96557</a> the height:440px is incorrectly interpreted as constraining the logicalHeight, so it doesn't get autosized. +</div> + +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-sufficient-width.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-sufficient-width.html new file mode 100644 index 0000000..eefba64 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/clusters-sufficient-width.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> +<head> + +<meta name="viewport" content="width=800"> +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } +</style> + +<script> +if (window.internals) { + window.internals.settings.setTextAutosizingEnabled(true); + window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); +} else if (window.console && console.warn) { + console.warn("This test depends on the Text Autosizing setting being true, so run it in DumpRenderTree, or manually enable Text Autosizing, and either use a mobile device with 320px device-width (like Nexus S or iPhone), or define HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP."); +} +</script> + +</head> +<body> + +<div style="position: absolute; width: 400px"> + This text should be autosized to 20px computed font size (16 * 400/320), since the position:absolute causes this to be a new cluster. +</div> + +<div style="margin-top: 100px; float: left; width: 420px"> + This text should be autosized to 21px computed font size (16 * 420/320), since the float:left causes this to be a new cluster. +</div> + +<table> + <tr> + <td style="width: 380px"> + This text should be autosized to 19px computed font size (16 * 380/320), since being a table cell causes this to be a new cluster. + </td> + </tr> +</table> + +<div style="-webkit-writing-mode: vertical-rl; height: 440px"> + This text should be autosized to 22px computed font size (16 * 440/320), since the perpendicular writing-mode compared to its containing block causes this to be a new cluster. Unfortunately due to <a href="https://bugs.webkit.org/show_bug.cgi?id=96557">http://webkit.org/b/96557</a> the height:440px is incorrectly interpreted as constraining the logicalHeight, so it doesn't get autosized. +</div> + +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-auto-ancestor-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-auto-ancestor-expected.html index b632b237..58ad9ba 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-auto-ancestor-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-auto-ancestor-expected.html @@ -3,9 +3,9 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } -body { width: 800px; margin: 0; } +body { width: 800px; margin: 0; overflow-y: hidden; } </style> </head> @@ -14,7 +14,8 @@ body { width: 800px; margin: 0; } <div style="max-height: 500px; overflow-y: auto"> <div> <div style="font-size: 2.5rem"> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-auto-ancestor.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-auto-ancestor.html index 1e17395..cd92d37 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-auto-ancestor.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-auto-ancestor.html @@ -3,12 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } -body { width: 800px; margin: 0; } +body { width: 800px; margin: 0; overflow-y: hidden; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -23,7 +23,8 @@ if (window.internals) { <div style="max-height: 500px; overflow-y: auto"> <div> <div> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-hidden-ancestor-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-hidden-ancestor-expected.html index aa0aa09..72ee912 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-hidden-ancestor-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-hidden-ancestor-expected.html @@ -3,7 +3,7 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> @@ -14,7 +14,8 @@ body { width: 800px; margin: 0; } <div style="max-height: 500px; overflow-y: hidden"> <div> <div> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-hidden-ancestor.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-hidden-ancestor.html index 94d6acf..fed7a8b 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-hidden-ancestor.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-hidden-ancestor.html @@ -3,12 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -23,7 +23,8 @@ if (window.internals) { <div style="max-height: 500px; overflow-y: hidden"> <div> <div> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-paged-x-ancestor-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-paged-x-ancestor-expected.html index 396c1bc..6d03243 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-paged-x-ancestor-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-paged-x-ancestor-expected.html @@ -3,9 +3,9 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } -body { width: 800px; margin: 0; } +body { width: 800px; margin: 0; overflow-y: hidden; } </style> </head> @@ -14,7 +14,8 @@ body { width: 800px; margin: 0; } <div style="max-height: 500px; overflow-y: -webkit-paged-x"> <div> <div style="font-size: 2.5rem"> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-paged-x-ancestor.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-paged-x-ancestor.html index 2b9029d..24c875e 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-paged-x-ancestor.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-paged-x-ancestor.html @@ -3,12 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } -body { width: 800px; margin: 0; } +body { width: 800px; margin: 0; overflow-y: hidden; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -23,7 +23,8 @@ if (window.internals) { <div style="max-height: 500px; overflow-y: -webkit-paged-x"> <div> <div> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-scroll-ancestor-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-scroll-ancestor-expected.html index 35784c9..b44cd77 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-scroll-ancestor-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-scroll-ancestor-expected.html @@ -3,9 +3,9 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } -body { width: 800px; margin: 0; } +body { width: 800px; margin: 0; overflow-y: hidden; } ::-webkit-scrollbar { /* Keeps the text size multiplier a round number. */ width: 0px; @@ -18,7 +18,8 @@ body { width: 800px; margin: 0; } <div style="max-height: 500px; overflow-y: scroll"> <div> <div style="font-size: 2.5rem"> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-scroll-ancestor.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-scroll-ancestor.html index 98248b1..20dfd33 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-scroll-ancestor.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-and-overflow-scroll-ancestor.html @@ -3,16 +3,16 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } -body { width: 800px; margin: 0; } +body { width: 800px; margin: 0; overflow-y: hidden; } ::-webkit-scrollbar { /* Keeps the text size multiplier a round number. */ width: 0px; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -27,7 +27,8 @@ if (window.internals) { <div style="max-height: 500px; overflow-y: scroll"> <div> <div> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-ancestor-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-ancestor-expected.html index b6f8b7e..84dcc67 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-ancestor-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-ancestor-expected.html @@ -3,7 +3,7 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> @@ -14,7 +14,8 @@ body { width: 800px; margin: 0; } <div style="height: 500px"> <div> <div> - 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. + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-ancestor.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-ancestor.html index f46ffad..6058dcd 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-ancestor.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-ancestor.html @@ -3,12 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -23,7 +23,8 @@ if (window.internals) { <div style="height: 500px"> <div> <div> - 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. + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-body-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-body-expected.html index 87b94d5..59a1080 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-body-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-body-expected.html @@ -12,7 +12,8 @@ body { width: 800px; margin: 0; } <body style="height: 100%"> <div style="font-size: 2.5rem"> - 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). + 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> + 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. </div> </body> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-body.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-body.html index 901877b..26ec70a2 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-body.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-height-body.html @@ -21,7 +21,8 @@ if (window.internals) { <body style="height: 100%"> <div> - 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). + 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> + 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. </div> </body> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight-ancestor-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight-ancestor-expected.html index cd8040c..a4ed07a 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight-ancestor-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight-ancestor-expected.html @@ -3,7 +3,7 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> @@ -14,7 +14,8 @@ body { width: 800px; margin: 0; } <div style="max-height: 500px"> <div> <div> - 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. + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight-ancestor.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight-ancestor.html index bd17f1b..98bd22d 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight-ancestor.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight-ancestor.html @@ -3,12 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -23,7 +23,8 @@ if (window.internals) { <div style="max-height: 500px"> <div> <div> - 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. + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight-expected.html index 6a3d0b3..665df8b 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight-expected.html @@ -3,7 +3,7 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> @@ -12,7 +12,8 @@ body { width: 800px; margin: 0; } <body> <div style="max-height: 500px"> - 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. + 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> + 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. </div> </body> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight.html index 5b3aac8..82f70906 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-maxheight.html @@ -3,12 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -21,7 +21,8 @@ if (window.internals) { <body> <div style="max-height: 500px"> - 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. + 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> + 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. </div> </body> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-maxheight-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-maxheight-expected.html index e9db7c9..b4df65b 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-maxheight-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-maxheight-expected.html @@ -3,7 +3,7 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> @@ -12,7 +12,8 @@ body { width: 800px; margin: 0; } <body style="height: 100%"> <div style="max-height: 100%"> - 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). + 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> + 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. </div> </body> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-maxheight.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-maxheight.html index 1783bfc..2e991d1 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-maxheight.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-maxheight.html @@ -3,12 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -21,7 +21,8 @@ if (window.internals) { <body style="height: 100%"> <div style="max-height: 100%"> - 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). + 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> + 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. </div> </body> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-of-viewport-maxheight-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-of-viewport-maxheight-expected.html index e8f628e..2fc3ff5 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-of-viewport-maxheight-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-of-viewport-maxheight-expected.html @@ -3,7 +3,7 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> @@ -12,7 +12,8 @@ body { width: 800px; margin: 0; } <body> <div style="max-height: 100vh"> - 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). + 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> + 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. </div> </body> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-of-viewport-maxheight.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-of-viewport-maxheight.html index a5e2176..9fdc318 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-of-viewport-maxheight.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-percent-of-viewport-maxheight.html @@ -3,12 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -21,7 +21,8 @@ if (window.internals) { <body> <div style="max-height: 100vh"> - 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). + 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> + 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. </div> </body> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-float-ancestors-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-float-ancestors-expected.html index 79b77eb..1e67107 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-float-ancestors-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-float-ancestors-expected.html @@ -14,7 +14,8 @@ body { width: 800px; margin: 0; } <div style="max-height: 500px"> <div style="float: left"> <div style="font-size: 2.5rem"> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-float-ancestors.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-float-ancestors.html index f13393f..83c9bb2 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-float-ancestors.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-float-ancestors.html @@ -23,10 +23,11 @@ if (window.internals) { <div style="max-height: 500px"> <div style="float: left"> <div> - 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). + 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> + 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. </div> </div> </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-overflow-ancestors-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-overflow-ancestors-expected.html index 8ea9647..211518a 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-overflow-ancestors-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-overflow-ancestors-expected.html @@ -3,9 +3,9 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } -body { width: 800px; margin: 0; } +body { width: 800px; margin: 0; overflow-y: hidden; } </style> </head> @@ -14,7 +14,8 @@ body { width: 800px; margin: 0; } <div style="max-height: 500px"> <div style="overflow-y: auto"> <div style="font-size: 2.5rem"> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-overflow-ancestors.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-overflow-ancestors.html index eb7e879..21fe186 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-overflow-ancestors.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-overflow-ancestors.html @@ -3,12 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } -body { width: 800px; margin: 0; } +body { width: 800px; margin: 0; overflow-y: hidden; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -23,7 +23,8 @@ if (window.internals) { <div style="max-height: 500px"> <div style="overflow-y: auto"> <div> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-absolute-ancestors-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-absolute-ancestors-expected.html index 5fbeeec..6a35c45 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-absolute-ancestors-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-absolute-ancestors-expected.html @@ -6,6 +6,10 @@ <style> html { font-size: 16px; } body { width: 800px; margin: 0; } +::-webkit-scrollbar { + /* Keeps the text size multiplier a round number. */ + width: 0px; +} </style> </head> @@ -14,10 +18,11 @@ body { width: 800px; margin: 0; } <div style="max-height: 500px; position: relative"> <div style="position: absolute"> <div style="font-size: 2.5rem"> - 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). + 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> + 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. </div> </div> </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-absolute-ancestors.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-absolute-ancestors.html index 3b07dc5..a26d15e 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-absolute-ancestors.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-absolute-ancestors.html @@ -6,6 +6,10 @@ <style> html { font-size: 16px; } body { width: 800px; margin: 0; } +::-webkit-scrollbar { + /* Keeps the text size multiplier a round number. */ + width: 0px; +} </style> <script> @@ -23,10 +27,11 @@ if (window.internals) { <div style="max-height: 500px; position: relative"> <div style="position: absolute"> <div> - 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). + 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> + 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. </div> </div> </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-fixed-ancestors-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-fixed-ancestors-expected.html index 7ac8c89..783a512 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-fixed-ancestors-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-fixed-ancestors-expected.html @@ -14,10 +14,11 @@ body { width: 800px; margin: 0; } <div style="max-height: 500px"> <div style="position: fixed"> <div style="font-size: 2.5rem"> - 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). + 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> + 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. </div> </div> </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-fixed-ancestors.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-fixed-ancestors.html index b221f51..24c77d4 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-fixed-ancestors.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-then-position-fixed-ancestors.html @@ -23,10 +23,11 @@ if (window.internals) { <div style="max-height: 500px"> <div style="position: fixed"> <div> - 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). + 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> + 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. </div> </div> </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-within-overflow-ancestor-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-within-overflow-ancestor-expected.html index 9900ef8..aba6b1f 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-within-overflow-ancestor-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-within-overflow-ancestor-expected.html @@ -3,7 +3,7 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> @@ -14,7 +14,8 @@ body { width: 800px; margin: 0; } <div style="overflow-y: auto"> <div style="max-height: 500px"> <div> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-within-overflow-ancestor.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-within-overflow-ancestor.html index 9a3171b..5a2808e 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-within-overflow-ancestor.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/constrained-within-overflow-ancestor.html @@ -3,12 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> +<style> html { font-size: 16px; } body { width: 800px; margin: 0; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -23,7 +23,8 @@ if (window.internals) { <div style="overflow-y: auto"> <div style="max-height: 500px"> <div> - 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). + 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> + 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. </div> </div> </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/em-margin-border-padding-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/em-margin-border-padding-expected.html index 9bb798d..43bd1c0 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/em-margin-border-padding-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/em-margin-border-padding-expected.html @@ -3,17 +3,17 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> -body { width: 800px; margin: 0; } +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } </style> </head> <body> -<!-- Note that em margins, borders and padding do not get scaled in proportion - to the font size. While unusual, this probably looks more consistent. --> -<p style="font-size: 2.375rem; margin: 1rem; border: 1rem solid blue; padding: 1rem"> - 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. +<p style="font-size: 2.5rem; margin: 1rem; border: 1rem solid blue; padding: 1rem"> + 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> + 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. </p> </body> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/em-margin-border-padding.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/em-margin-border-padding.html index 6d9a9f7..395e814 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/em-margin-border-padding.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/em-margin-border-padding.html @@ -3,11 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> -body { width: 800px; margin: 0; } +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -20,7 +21,8 @@ if (window.internals) { <body> <p style="margin: 1em; border: 1em solid blue; padding: 1em"> - 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. + 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> + 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. </p> </body> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/narrow-child-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/narrow-child-expected.html index 00cf42c..d078224 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/narrow-child-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/narrow-child-expected.html @@ -3,16 +3,17 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> -body { width: 800px; margin: 0; } +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } </style> </head> <body> <div style="font-size: 2.5rem"> - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - <div style="width: 320px; font-size: 1rem"> + 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. + <div style="width: 320px"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </div> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/narrow-child.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/narrow-child.html index f206019..355adb6 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/narrow-child.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/narrow-child.html @@ -3,11 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> -body { width: 800px; margin: 0; } +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -20,7 +21,7 @@ if (window.internals) { <body> <div> - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + 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. <div style="width: 320px"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-child-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-child-expected.html index 529facd..4b000f6 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-child-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-child-expected.html @@ -3,16 +3,17 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> -body { width: 800px; margin: 0; } +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } </style> </head> <body> -<div style="width: 320px"> - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - <div style="width: 800px; font-size: 2.5rem"> +<div style="width: 320px; font-size: 2.5rem"> + 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. + <div style="width: 800px"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </div> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-child.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-child.html index 5c1d788..0a5b1214f 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-child.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-child.html @@ -3,11 +3,12 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> -body { width: 800px; margin: 0; } +<style> +html { font-size: 16px; } +body { width: 800px; margin: 0; overflow-y: hidden; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -20,7 +21,7 @@ if (window.internals) { <body> <div style="width: 320px"> - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + 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. <div style="width: 800px"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </div> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-iframe-expected.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-iframe-expected.html index c2e0d0c..1a71c0b 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-iframe-expected.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-iframe-expected.html @@ -3,16 +3,17 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> -body { width: 800px; margin: 0; overflow-y: hidden; } +<style> +body { width: 800px; margin: 0; } </style> </head> <body> <iframe style="width: 3200px; height: 50%; border: 0" src='data:text/html, -<html><body style="margin: 0; overflow-y: hidden"><div style="width: 1600px; font-size: 2.5rem"> -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. +<html style="font-size: 16px"><body style="margin: 0; overflow-y: hidden"><div style="width: 1600px; font-size: 2.5rem"> +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> +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. </div></body></html>'> </body> diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-iframe.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-iframe.html index be75328..f183a79 100644 --- a/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-iframe.html +++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/wide-iframe.html @@ -3,11 +3,11 @@ <head> <meta name="viewport" content="width=800"> -<style type="text/css"> -body { width: 800px; margin: 0; overflow-y: hidden; } +<style> +body { width: 800px; margin: 0; } </style> -<script type="text/javascript"> +<script> if (window.internals) { window.internals.settings.setTextAutosizingEnabled(true); window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); @@ -20,8 +20,9 @@ if (window.internals) { <body> <iframe style="width: 3200px; height: 50%; border: 0" src='data:text/html, -<html><body style="margin: 0; overflow-y: hidden"><div style="width: 1600px"> -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. +<html style="font-size: 16px"><body style="margin: 0; overflow-y: hidden"><div style="width: 1600px"> +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> +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. </div></body></html>'> </body> diff --git a/third_party/WebKit/Source/WebCore/ChangeLog b/third_party/WebKit/Source/WebCore/ChangeLog index b19c2d2..b66ef91 100644 --- a/third_party/WebKit/Source/WebCore/ChangeLog +++ b/third_party/WebKit/Source/WebCore/ChangeLog @@ -1,3 +1,112 @@ +2012-09-20 John Mellor <johnme@chromium.org> + + Text Autosizing: Cluster text at flow roots, for consistency and to avoid autosizing headers/footers. + https://bugs.webkit.org/show_bug.cgi?id=97025 + + Reviewed by Julien Chaffraix. + + This patch has 3 main changes: + + 1. All text within a "cluster" (roughly equivalent to a CSS flow root / + block formatting context) must have a uniform textAutosizingMultiplier, + except for subtrees which are themselves clusters. This improves the + consistency of the final output, since sibling blocks are now more + likely to have the same multiplier (hence grow in proportion). + + 2. Clusters must contain a minimum amount of text in order to be + autosized (4 lines of text, assuming each char is 1em wide, so about + 2 lines of text in practice). This is to reduce the likelihood of + autosizing things like headers and footers, which can be quite + visually distracting. The rationale is that if a cluster contains + very few lines of text then it's ok to have to zoom in and pan from + side to side to read each line, since if there are very few lines of + text you'll only need to pan across once or twice. + + 3. To avoid adding a 3rd tree traversal, processSubtree/processBox were + refactored such that all of Text Autosizing now happens as a single + tree traversal (hence halving the number of tree traversals done). + + Tests: fast/text-autosizing/cluster-narrow-in-wide.html + fast/text-autosizing/cluster-wide-in-narrow.html + fast/text-autosizing/clusters-insufficient-text.html + fast/text-autosizing/clusters-insufficient-width.html + fast/text-autosizing/clusters-sufficient-text-except-in-root.html + fast/text-autosizing/clusters-sufficient-width.html + + * rendering/TextAutosizer.cpp: + (TextAutosizingWindowInfo): + + Added this struct to bundle together the various sizes that + processSubtree needs to pass to every recursive call to + processCluster and processContainer. + + (WebCore::TextAutosizer::processSubtree): + + - Bundle windowSize and minLayoutSize together as a single struct, + TextAutosizingWindowInfo, rather than passing them separately. + - Walk up the tree to find the current cluster and container, rather + than (incorrectly) assuming that the layoutRoot is always a + container. + - Call processCluster instead of traversing the tree. + + (WebCore::TextAutosizer::processCluster): + + Calculates the multiplier based on the width of the cluster (moved + the calculation here from processBox, since now the multiplier is + fixed per cluster), and delegates to processContainer for the actual + tree traversal (since clusters are also containers). + + (WebCore::contentHeightIsConstrained): + + Changed parameter to RenderBlock. + + (WebCore::TextAutosizer::processContainer): + + This now takes care of the whole tree traversal, recursively calling + processCluster/processContainer when it encounters such an object, + and setMultiplier on RenderText objects (as processBox used to). + Also added a check that the RenderText's multiplier is not already + equal to the target multiplier (to save needlessly setting it). + + (WebCore::TextAutosizer::isContainer): + + - Changed to be a positive (is) instead of negative (isNot) check. + - Require objects to be RenderBlocks so it's easier to find them + using containingBlock, and there don't seem to be many interesting + RenderBoxes that aren't RenderBlocks. + + (WebCore::TextAutosizer::isAutosizingCluster): + + A container that is also a flow root / block formatting context + (approximately), hence demarcates an independent region of the page, + within which we want consistent autosizing. + + (WebCore::TextAutosizer::clusterShouldBeAutosized): + + Uses measureDescendantTextWidth and to check whether the cluster + contains enough text to be worth autosizing. + + (WebCore::TextAutosizer::measureDescendantTextWidth): + + Recursively traverse the cluster, skipping constrained height + containers as processContainer does, to measure how much autosizable + text it contains. Early out as soon as the minimum text width is + reached. + + (WebCore::TextAutosizer::nextInPreOrderSkippingDescendantsOfContainers): + + Replaces nextInPreOrderMatchingFilter. The filter is now fixed to + isContainer (we no longer need an isAutosizingCluster filter, since + I consolidated the tree traversal), and filtered objects are + actually returned (so they can in turn be recursively traversed), + it's just their descendants that get skipped. + + * rendering/TextAutosizer.h: + (TextAutosizer): + + - Deleted RenderObjectFilterFunctor, since the filter of + nextInPreOrderSkippingDescendantsOfContainers is now fixed. + 2012-09-20 Yoshifumi Inoue <yosin@chromium.org> [Platform] There are memory leak in LocaleICU diff --git a/third_party/WebKit/Source/WebCore/rendering/TextAutosizer.cpp b/third_party/WebKit/Source/WebCore/rendering/TextAutosizer.cpp index c4503a1..304bdb3 100644 --- a/third_party/WebKit/Source/WebCore/rendering/TextAutosizer.cpp +++ b/third_party/WebKit/Source/WebCore/rendering/TextAutosizer.cpp @@ -35,6 +35,11 @@ namespace WebCore { +struct TextAutosizingWindowInfo { + IntSize windowSize; + IntSize minLayoutSize; +}; + TextAutosizer::TextAutosizer(Document* document) : m_document(document) { @@ -53,36 +58,68 @@ bool TextAutosizer::processSubtree(RenderObject* layoutRoot) Frame* mainFrame = m_document->page()->mainFrame(); + TextAutosizingWindowInfo windowInfo; + // Window area, in logical (density-independent) pixels. - IntSize windowSize = m_document->settings()->textAutosizingWindowSizeOverride(); - if (windowSize.isEmpty()) { + windowInfo.windowSize = m_document->settings()->textAutosizingWindowSizeOverride(); + if (windowInfo.windowSize.isEmpty()) { bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWidthOverride(mainFrame); - windowSize = mainFrame->view()->visibleContentRect(includeScrollbars).size(); // FIXME: Check that this is always in logical (density-independent) pixels (see wkbug.com/87440). + windowInfo.windowSize = mainFrame->view()->visibleContentRect(includeScrollbars).size(); // FIXME: Check that this is always in logical (density-independent) pixels (see wkbug.com/87440). } // Largest area of block that can be visible at once (assuming the main // frame doesn't get scaled to less than overview scale), in CSS pixels. - IntSize minLayoutSize = mainFrame->view()->layoutSize(); + windowInfo.minLayoutSize = mainFrame->view()->layoutSize(); for (Frame* frame = m_document->frame(); frame; frame = frame->tree()->parent()) { if (!frame->view()->isInChildFrameWithFrameFlattening()) - minLayoutSize = minLayoutSize.shrunkTo(frame->view()->layoutSize()); + windowInfo.minLayoutSize = windowInfo.minLayoutSize.shrunkTo(frame->view()->layoutSize()); } - for (RenderObject* descendant = layoutRoot->nextInPreOrder(layoutRoot); descendant; descendant = descendant->nextInPreOrder(layoutRoot)) { - if (isNotAnAutosizingContainer(descendant)) - continue; - processBox(toRenderBox(descendant), windowSize, minLayoutSize); - } + // The layoutRoot could be neither a container nor a cluster, so walk up the tree till we find each of these. + RenderBlock* container = layoutRoot->isRenderBlock() ? toRenderBlock(layoutRoot) : layoutRoot->containingBlock(); + while (container && !isAutosizingContainer(container)) + container = container->containingBlock(); + + RenderBlock* cluster = container; + while (cluster && (!isAutosizingContainer(cluster) || !isAutosizingCluster(cluster))) + cluster = cluster->containingBlock(); + processCluster(cluster, container, layoutRoot, windowInfo); return true; } -static bool contentHeightIsConstrained(const RenderBox* box) +void TextAutosizer::processCluster(RenderBlock* cluster, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo& windowInfo) +{ + ASSERT(isAutosizingCluster(cluster)); + + // FIXME: Many pages set a max-width on their content. So especially for the RenderView, + // instead of just taking the width of |cluster| we should find the lowest common ancestor of + // the first and last descendant text node of the cluster (i.e. the deepest wrapper block that + // contains all the text), and use its width instead. + RenderBlock* lowestCommonAncestor = cluster; + float commonAncestorWidth = lowestCommonAncestor->contentLogicalWidth(); + + float multiplier = 1; + if (clusterShouldBeAutosized(lowestCommonAncestor, commonAncestorWidth)) { + int logicalWindowWidth = cluster->isHorizontalWritingMode() ? windowInfo.windowSize.width() : windowInfo.windowSize.height(); + int logicalLayoutWidth = cluster->isHorizontalWritingMode() ? windowInfo.minLayoutSize.width() : windowInfo.minLayoutSize.height(); + // Ignore box width in excess of the layout width, to avoid extreme multipliers. + float logicalClusterWidth = std::min<float>(commonAncestorWidth, logicalLayoutWidth); + + multiplier = logicalClusterWidth / logicalWindowWidth; + multiplier *= m_document->settings()->textAutosizingFontScaleFactor(); + multiplier = std::max(1.0f, multiplier); + } + + processContainer(multiplier, container, subtreeRoot, windowInfo); +} + +static bool contentHeightIsConstrained(const RenderBlock* container) { // FIXME: Propagate constrainedness down the tree, to avoid inefficiently walking back up from each box. // FIXME: This code needs to take into account vertical writing modes. // FIXME: Consider additional heuristics, such as ignoring fixed heights if the content is already overflowing before autosizing kicks in. - for (const RenderBox* container = box; container; container = container->containingBlock()) { + for (; container; container = container->containingBlock()) { RenderStyle* style = container->style(); if (style->overflowY() >= OSCROLL) return false; @@ -97,29 +134,28 @@ static bool contentHeightIsConstrained(const RenderBox* box) return false; } -void TextAutosizer::processBox(RenderBox* box, const IntSize& windowSize, const IntSize& layoutSize) +void TextAutosizer::processContainer(float multiplier, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo& windowInfo) { - if (contentHeightIsConstrained(box)) - return; - - int logicalWindowWidth = box->isHorizontalWritingMode() ? windowSize.width() : windowSize.height(); - int logicalLayoutWidth = box->isHorizontalWritingMode() ? layoutSize.width() : layoutSize.height(); - // Ignore box width in excess of the layout width, to avoid extreme multipliers. - float logicalBoxWidth = std::min<float>(box->logicalWidth(), logicalLayoutWidth); + ASSERT(isAutosizingContainer(container)); - float multiplier = logicalBoxWidth / logicalWindowWidth; - multiplier *= m_document->settings()->textAutosizingFontScaleFactor(); + float localMultiplier = contentHeightIsConstrained(container) ? 1 : multiplier; - if (multiplier < 1) - return; - RenderObject* descendant = nextInPreOrderMatchingFilter(box, box, isNotAnAutosizingContainer); + RenderObject* descendant = nextInPreOrderSkippingDescendantsOfContainers(subtreeRoot, subtreeRoot); while (descendant) { if (descendant->isText()) { - setMultiplier(descendant, multiplier); - setMultiplier(descendant->parent(), multiplier); // Parent does line spacing. + if (localMultiplier != descendant->style()->textAutosizingMultiplier()) { + setMultiplier(descendant, localMultiplier); + setMultiplier(descendant->parent(), localMultiplier); // Parent does line spacing. + } // FIXME: Increase list marker size proportionately. + } else if (isAutosizingContainer(descendant)) { + RenderBlock* descendantBlock = toRenderBlock(descendant); + if (isAutosizingCluster(descendantBlock)) + processCluster(descendantBlock, descendantBlock, descendantBlock, windowInfo); + else + processContainer(multiplier, descendantBlock, descendantBlock, windowInfo); } - descendant = nextInPreOrderMatchingFilter(descendant, box, isNotAnAutosizingContainer); + descendant = nextInPreOrderSkippingDescendantsOfContainers(descendant, subtreeRoot); } } @@ -158,28 +194,104 @@ float TextAutosizer::computeAutosizedFontSize(float specifiedSize, float multipl return computedSize; } -bool TextAutosizer::isNotAnAutosizingContainer(const RenderObject* renderer) +bool TextAutosizer::isAutosizingContainer(const RenderObject* renderer) { - // "Autosizing containers" are the smallest unit for which we can enable/disable - // Text Autosizing. A uniform text size multiplier is enforced within them. - // - Must be RenderBoxes since they need a well-defined logicalWidth(). + // "Autosizing containers" are the smallest unit for which we can + // enable/disable Text Autosizing. // - Must not be inline, as different multipliers on one line looks terrible. // - Must not be list items, as items in the same list should look consistent. - return !renderer->isBox() || renderer->isInline() || renderer->isListItem(); + return renderer->isRenderBlock() && !renderer->isInline() && !renderer->isListItem(); +} + +bool TextAutosizer::isAutosizingCluster(const RenderBlock* renderer) +{ + // "Autosizing clusters" are special autosizing containers within which we + // want to enforce a uniform text size multiplier, in the hopes of making + // the major sections of the page look internally consistent. + // All their descendents (including other autosizing containers) must share + // the same multiplier, except for subtrees which are themselves clusters, + // and some of their descendent containers might not be autosized at all + // (for example if their height is constrained). + // Additionally, clusterShouldBeAutosized requires each cluster to contain a + // minimum amount of text, without which it won't be autosized. + // + // Clusters are chosen using very similar criteria to CSS flow roots, aka + // block formatting contexts (http://w3.org/TR/css3-box/#flow-root), since + // flow roots correspond to box containers that behave somewhat + // independently from their parent (for example they don't overlap floats). + // The definition of a flow flow root also conveniently includes most of the + // ways that a box and its children can have significantly different width + // from the box's parent (we want to avoid having significantly different + // width blocks within a cluster, since the narrower blocks would end up + // larger than would otherwise be necessary). + ASSERT(isAutosizingContainer(renderer)); + + return renderer->isRenderView() + || renderer->isFloating() + || renderer->isOutOfFlowPositioned() + || renderer->isTableCell() + || renderer->isTableCaption() + || renderer->isFlexibleBoxIncludingDeprecated() + || renderer->hasColumns() + || renderer->style()->overflowX() != OVISIBLE + || renderer->style()->overflowY() != OVISIBLE + || renderer->containingBlock()->isHorizontalWritingMode() != renderer->isHorizontalWritingMode(); + // FIXME: Tables need special handling to multiply all their columns by + // the same amount even if they're different widths; so do hasColumns() + // renderers, and probably flexboxes... +} + +bool TextAutosizer::clusterShouldBeAutosized(const RenderBlock* lowestCommonAncestor, float commonAncestorWidth) +{ + // Don't autosize clusters that contain less than 4 lines of text (in + // practice less lines are required, since measureDescendantTextWidth + // assumes that characters are 1em wide, but most characters are narrower + // than that, so we're overestimating their contribution to the linecount). + // + // This is to reduce the likelihood of autosizing things like headers and + // footers, which can be quite visually distracting. The rationale is that + // if a cluster contains very few lines of text then it's ok to have to zoom + // in and pan from side to side to read each line, since if there are very + // few lines of text you'll only need to pan across once or twice. + const float minLinesOfText = 4; + float minTextWidth = commonAncestorWidth * minLinesOfText; + float textWidth = 0; + measureDescendantTextWidth(lowestCommonAncestor, minTextWidth, textWidth); + if (textWidth >= minTextWidth) + return true; + return false; +} + +void TextAutosizer::measureDescendantTextWidth(const RenderBlock* container, float minTextWidth, float& textWidth) +{ + bool skipLocalText = contentHeightIsConstrained(container); + + RenderObject* descendant = nextInPreOrderSkippingDescendantsOfContainers(container, container); + while (descendant) { + if (!skipLocalText && descendant->isText()) { + textWidth += toRenderText(descendant)->renderedTextLength() * descendant->style()->specifiedFontSize(); + } else if (isAutosizingContainer(descendant)) { + RenderBlock* descendantBlock = toRenderBlock(descendant); + if (!isAutosizingCluster(descendantBlock)) + measureDescendantTextWidth(descendantBlock, minTextWidth, textWidth); + } + if (textWidth >= minTextWidth) + return; + descendant = nextInPreOrderSkippingDescendantsOfContainers(descendant, container); + } } -RenderObject* TextAutosizer::nextInPreOrderMatchingFilter(RenderObject* current, const RenderObject* stayWithin, RenderObjectFilterFunctor filter) +RenderObject* TextAutosizer::nextInPreOrderSkippingDescendantsOfContainers(const RenderObject* current, const RenderObject* stayWithin) { - for (RenderObject* child = current->firstChild(); child; child = child->nextSibling()) - if (filter(child)) + if (current == stayWithin || !isAutosizingContainer(current)) + for (RenderObject* child = current->firstChild(); child; child = child->nextSibling()) return child; for (const RenderObject* ancestor = current; ancestor; ancestor = ancestor->parent()) { if (ancestor == stayWithin) return 0; for (RenderObject* sibling = ancestor->nextSibling(); sibling; sibling = sibling->nextSibling()) - if (filter(sibling)) - return sibling; + return sibling; } return 0; diff --git a/third_party/WebKit/Source/WebCore/rendering/TextAutosizer.h b/third_party/WebKit/Source/WebCore/rendering/TextAutosizer.h index ae9fd83..2e2e70e 100644 --- a/third_party/WebKit/Source/WebCore/rendering/TextAutosizer.h +++ b/third_party/WebKit/Source/WebCore/rendering/TextAutosizer.h @@ -36,10 +36,11 @@ namespace WebCore { class Document; -class RenderBox; +class RenderBlock; class RenderObject; class RenderStyle; class RenderText; +struct TextAutosizingWindowInfo; class TextAutosizer { WTF_MAKE_NONCOPYABLE(TextAutosizer); @@ -56,14 +57,19 @@ public: private: explicit TextAutosizer(Document*); - void processBox(RenderBox*, const IntSize& windowSize, const IntSize& layoutSize); + void processCluster(RenderBlock* cluster, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&); + void processContainer(float multiplier, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&); + void setMultiplier(RenderObject*, float); - static bool isNotAnAutosizingContainer(const RenderObject*); + static bool isAutosizingContainer(const RenderObject*); + static bool isAutosizingCluster(const RenderBlock*); + + static bool clusterShouldBeAutosized(const RenderBlock* lowestCommonAncestor, float commonAncestorWidth); + static void measureDescendantTextWidth(const RenderBlock* container, float minTextWidth, float& textWidth); - typedef bool (*RenderObjectFilterFunctor)(const RenderObject*); - // Use to traverse the tree of descendants, excluding any subtrees within that whose root doesn't pass the filter. - static RenderObject* nextInPreOrderMatchingFilter(RenderObject* current, const RenderObject* stayWithin, RenderObjectFilterFunctor); + // Use to traverse the tree of descendants, excluding descendants of containers (but returning the containers themselves). + static RenderObject* nextInPreOrderSkippingDescendantsOfContainers(const RenderObject* current, const RenderObject* stayWithin); Document* m_document; }; |