| Differences between
and this patch
- a/Source/WebCore/ChangeLog +28 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-12-14  Tim Volodine  <timvolodine@chromium.org>
2
3
        Text Autosizing: Work out what to do about form controls
4
        https://bugs.webkit.org/show_bug.cgi?id=102560
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Disallow autosizing of form input controls like buttons, text input fields, selection controls, radio buttons
9
        and check boxes. This is a short term solution to avoid inconsistent autosizing of form controls (which is
10
        worse than not autosizing at all).
11
12
        Tests: fast/text-autosizing/form-controls-autosizing-button-input-elements.html
13
               fast/text-autosizing/form-controls-autosizing-checkbox-input-element.html
14
               fast/text-autosizing/form-controls-autosizing-radio-input-element.html
15
               fast/text-autosizing/form-controls-autosizing-select-element.html
16
               fast/text-autosizing/form-controls-autosizing-textfield-input-elements.html
17
18
        * rendering/TextAutosizer.cpp:
19
        (WebCore):
20
        (WebCore::formInputTags):
21
        (WebCore::TextAutosizer::processContainer):
22
        (WebCore::TextAutosizer::isAutosizingContainer):
23
        (WebCore::TextAutosizer::contentHeightIsConstrained):
24
        (WebCore::TextAutosizer::containerShouldBeAutosized):
25
        (WebCore::TextAutosizer::containerContainsTags):
26
        (WebCore::TextAutosizer::measureDescendantTextWidth):
27
        * rendering/TextAutosizer.h:
28
1
2012-12-14  Kentaro Hara  <haraken@chromium.org>
29
2012-12-14  Kentaro Hara  <haraken@chromium.org>
2
30
3
        ChildNodesLazySnapshot::nextNode() can crash in Debug builds
31
        ChildNodesLazySnapshot::nextNode() can crash in Debug builds
- a/Source/WebCore/rendering/TextAutosizer.cpp -4 / +44 lines
Lines 25-30 a/Source/WebCore/rendering/TextAutosizer.cpp_sec1
25
#include "TextAutosizer.h"
25
#include "TextAutosizer.h"
26
26
27
#include "Document.h"
27
#include "Document.h"
28
#include "HTMLElement.h"
28
#include "InspectorInstrumentation.h"
29
#include "InspectorInstrumentation.h"
29
#include "RenderObject.h"
30
#include "RenderObject.h"
30
#include "RenderStyle.h"
31
#include "RenderStyle.h"
Lines 34-47 a/Source/WebCore/rendering/TextAutosizer.cpp_sec2
34
#include "StyleInheritedData.h"
35
#include "StyleInheritedData.h"
35
36
36
#include <algorithm>
37
#include <algorithm>
38
#include <wtf/StdLibExtras.h>
37
39
38
namespace WebCore {
40
namespace WebCore {
39
41
42
using namespace HTMLNames;
43
40
struct TextAutosizingWindowInfo {
44
struct TextAutosizingWindowInfo {
41
    IntSize windowSize;
45
    IntSize windowSize;
42
    IntSize minLayoutSize;
46
    IntSize minLayoutSize;
43
};
47
};
44
48
49
50
static const Vector<QualifiedName>& formInputTags()
51
{
52
    // Returns the tags for the form input elements.
53
    DEFINE_STATIC_LOCAL(Vector<QualifiedName>, formInputTags, ());
54
    if (formInputTags.isEmpty()) {
55
        formInputTags.append(inputTag);
56
        formInputTags.append(buttonTag);
57
        formInputTags.append(selectTag);
58
    }
59
    return formInputTags;
60
}
61
45
TextAutosizer::TextAutosizer(Document* document)
62
TextAutosizer::TextAutosizer(Document* document)
46
    : m_document(document)
63
    : m_document(document)
47
{
64
{
Lines 123-129 void TextAutosizer::processContainer(float multiplier, RenderBlock* container, R a/Source/WebCore/rendering/TextAutosizer.cpp_sec3
123
{
140
{
124
    ASSERT(isAutosizingContainer(container));
141
    ASSERT(isAutosizingContainer(container));
125
142
126
    float localMultiplier = containerShouldbeAutosized(container) ? multiplier: 1;
143
    float localMultiplier = containerShouldBeAutosized(container) ? multiplier : 1;
127
144
128
    RenderObject* descendant = nextInPreOrderSkippingDescendantsOfContainers(subtreeRoot, subtreeRoot);
145
    RenderObject* descendant = nextInPreOrderSkippingDescendantsOfContainers(subtreeRoot, subtreeRoot);
129
    while (descendant) {
146
    while (descendant) {
Lines 191-196 bool TextAutosizer::isAutosizingContainer(const RenderObject* renderer) a/Source/WebCore/rendering/TextAutosizer.cpp_sec4
191
        return false;
208
        return false;
192
    if (renderer->isListItem())
209
    if (renderer->isListItem())
193
        return renderer->isFloating() || renderer->isOutOfFlowPositioned();
210
        return renderer->isFloating() || renderer->isOutOfFlowPositioned();
211
    // Avoid creating containers for text within text controls, buttons, or <select> buttons.
212
    Node* parentNode = renderer->parent() ? renderer->parent()->generatingNode() : 0;
213
    if (parentNode && parentNode->isElementNode() && formInputTags().contains(toElement(parentNode)->tagQName()))
214
        return false;
215
194
    return true;
216
    return true;
195
}
217
}
196
218
Lines 230-236 bool TextAutosizer::isAutosizingCluster(const RenderBlock* renderer) a/Source/WebCore/rendering/TextAutosizer.cpp_sec5
230
    // renderers, and probably flexboxes...
252
    // renderers, and probably flexboxes...
231
}
253
}
232
254
233
static bool contentHeightIsConstrained(const RenderBlock* container)
255
bool TextAutosizer::contentHeightIsConstrained(const RenderBlock* container)
234
{
256
{
235
    // FIXME: Propagate constrainedness down the tree, to avoid inefficiently walking back up from each box.
257
    // FIXME: Propagate constrainedness down the tree, to avoid inefficiently walking back up from each box.
236
    // FIXME: This code needs to take into account vertical writing modes.
258
    // FIXME: This code needs to take into account vertical writing modes.
Lines 250-257 static bool contentHeightIsConstrained(const RenderBlock* container) a/Source/WebCore/rendering/TextAutosizer.cpp_sec6
250
    return false;
272
    return false;
251
}
273
}
252
274
253
bool TextAutosizer::containerShouldbeAutosized(const RenderBlock* container)
275
bool TextAutosizer::containerShouldBeAutosized(const RenderBlock* container)
254
{
276
{
277
    if (containerContainsOneOfTags(container, formInputTags()))
278
        return false;
279
255
    // Don't autosize block-level text that can't wrap (as it's likely to
280
    // Don't autosize block-level text that can't wrap (as it's likely to
256
    // expand sideways and break the page's layout).
281
    // expand sideways and break the page's layout).
257
    if (!container->style()->autoWrap())
282
    if (!container->style()->autoWrap())
Lines 281-289 bool TextAutosizer::clusterShouldBeAutosized(const RenderBlock* lowestCommonAnce a/Source/WebCore/rendering/TextAutosizer.cpp_sec7
281
    return false;
306
    return false;
282
}
307
}
283
308
309
bool TextAutosizer::containerContainsOneOfTags(const RenderBlock* container, const Vector<QualifiedName>& tags)
310
{
311
    const RenderObject* renderer = container;
312
    while (renderer) {
313
        const Node* rendererNode = renderer->node();
314
        if (rendererNode && rendererNode->isElementNode()) {
315
            if (tags.contains(toElement(rendererNode)->tagQName()))
316
                return true;
317
        }
318
        renderer = nextInPreOrderSkippingDescendantsOfContainers(renderer, container);
319
    }
320
321
    return false;
322
}
323
284
void TextAutosizer::measureDescendantTextWidth(const RenderBlock* container, float minTextWidth, float& textWidth)
324
void TextAutosizer::measureDescendantTextWidth(const RenderBlock* container, float minTextWidth, float& textWidth)
285
{
325
{
286
    bool skipLocalText = !containerShouldbeAutosized(container);
326
    bool skipLocalText = !containerShouldBeAutosized(container);
287
327
288
    RenderObject* descendant = nextInPreOrderSkippingDescendantsOfContainers(container, container);
328
    RenderObject* descendant = nextInPreOrderSkippingDescendantsOfContainers(container, container);
289
    while (descendant) {
329
    while (descendant) {
- a/Source/WebCore/rendering/TextAutosizer.h -1 / +4 lines
Lines 28-33 a/Source/WebCore/rendering/TextAutosizer.h_sec1
28
28
29
#if ENABLE(TEXT_AUTOSIZING)
29
#if ENABLE(TEXT_AUTOSIZING)
30
30
31
#include "HTMLNames.h"
31
#include "IntSize.h"
32
#include "IntSize.h"
32
#include <wtf/Noncopyable.h>
33
#include <wtf/Noncopyable.h>
33
#include <wtf/PassOwnPtr.h>
34
#include <wtf/PassOwnPtr.h>
Lines 70-77 private: a/Source/WebCore/rendering/TextAutosizer.h_sec2
70
    static bool isAutosizingContainer(const RenderObject*);
71
    static bool isAutosizingContainer(const RenderObject*);
71
    static bool isAutosizingCluster(const RenderBlock*);
72
    static bool isAutosizingCluster(const RenderBlock*);
72
73
73
    static bool containerShouldbeAutosized(const RenderBlock* container);
74
    static bool clusterShouldBeAutosized(const RenderBlock* lowestCommonAncestor, float commonAncestorWidth);
74
    static bool clusterShouldBeAutosized(const RenderBlock* lowestCommonAncestor, float commonAncestorWidth);
75
    static bool containerShouldBeAutosized(const RenderBlock* container);
76
    static bool contentHeightIsConstrained(const RenderBlock* container);
77
    static bool containerContainsOneOfTags(const RenderBlock* cluster, const Vector<QualifiedName>& tags);
75
    static void measureDescendantTextWidth(const RenderBlock* container, float minTextWidth, float& textWidth);
78
    static void measureDescendantTextWidth(const RenderBlock* container, float minTextWidth, float& textWidth);
76
79
77
    // Use to traverse the tree of descendants, excluding descendants of containers (but returning the containers themselves).
80
    // Use to traverse the tree of descendants, excluding descendants of containers (but returning the containers themselves).
- a/LayoutTests/ChangeLog +21 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2012-12-14  Tim Volodine  <timvolodine@chromium.org>
2
3
        Text Autosizing: Work out what to do about form controls
4
        https://bugs.webkit.org/show_bug.cgi?id=102560
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Tests for form input elements autosizing. Added tests to check that various kinds of form elements
9
        don't get autosized, i.e. buttons, textareas, check boxes, radio button and selection menus.
10
11
        * fast/text-autosizing/form-controls-autosizing-button-input-elements-expected.html: Added.
12
        * fast/text-autosizing/form-controls-autosizing-button-input-elements.html: Added.
13
        * fast/text-autosizing/form-controls-autosizing-checkbox-input-element-expected.html: Added.
14
        * fast/text-autosizing/form-controls-autosizing-checkbox-input-element.html: Added.
15
        * fast/text-autosizing/form-controls-autosizing-radio-input-element-expected.html: Added.
16
        * fast/text-autosizing/form-controls-autosizing-radio-input-element.html: Added.
17
        * fast/text-autosizing/form-controls-autosizing-select-element-expected.html: Added.
18
        * fast/text-autosizing/form-controls-autosizing-select-element.html: Added.
19
        * fast/text-autosizing/form-controls-autosizing-textfield-input-elements-expected.html: Added.
20
        * fast/text-autosizing/form-controls-autosizing-textfield-input-elements.html: Added.
21
1
2012-12-14  John Mellor  <johnme@chromium.org>
22
2012-12-14  John Mellor  <johnme@chromium.org>
2
23
3
        Text Autosizing: Don't autosize unwrappable blocks
24
        Text Autosizing: Don't autosize unwrappable blocks
- a/LayoutTests/fast/text-autosizing/form-controls-autosizing-button-input-elements-expected.html +46 lines
Line 0 a/LayoutTests/fast/text-autosizing/form-controls-autosizing-button-input-elements-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
5
<meta name="viewport" content="width=800">
6
<style>
7
  body {
8
    font-size: 16px;
9
    width: 800px;
10
    margin: 0;
11
    overflow-y: hidden;
12
  }
13
</style>
14
15
</head>
16
<body>
17
18
<div style="font-size: 2.5rem">
19
    This paragraph should be autosized to 40px computed font-size (16 * 800/320),
20
    whereas the buttons and the corresponding text below should be rendered at
21
    their default font size.
22
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
23
    tempor incididunt ut labore et dolore magna aliqua.
24
</div>
25
26
<div>
27
    <div>
28
        Submit button
29
        <input type="submit" value="Find">
30
    </div>
31
    <div>
32
        Simple button
33
        <input type="button" value="Button">
34
    </div>
35
    <div>
36
        Reset button
37
        <input type="reset" value="Reset">
38
    </div>
39
    <div>
40
        Inline button
41
        <button>InlineButton</button>
42
    </div>
43
</div>
44
45
</body>
46
</html>
- a/LayoutTests/fast/text-autosizing/form-controls-autosizing-button-input-elements.html +55 lines
Line 0 a/LayoutTests/fast/text-autosizing/form-controls-autosizing-button-input-elements.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
5
<meta name="viewport" content="width=800">
6
<style>
7
  body {
8
    font-size: 16px;
9
    width: 800px;
10
    margin: 0;
11
    overflow-y: hidden;
12
  }
13
</style>
14
15
<script>
16
if (window.internals) {
17
    window.internals.settings.setTextAutosizingEnabled(true);
18
    window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
19
} else if (window.console && console.warn) {
20
    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.");
21
}
22
</script>
23
24
</head>
25
<body>
26
27
<div>
28
    This paragraph should be autosized to 40px computed font-size (16 * 800/320),
29
    whereas the buttons and the corresponding text below should be rendered at
30
    their default font size.
31
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
32
    tempor incididunt ut labore et dolore magna aliqua.
33
</div>
34
35
<div>
36
    <div>
37
        Submit button
38
        <input type="submit" value="Find">
39
    </div>
40
    <div>
41
        Simple button
42
        <input type="button" value="Button">
43
    </div>
44
    <div>
45
        Reset button
46
        <input type="reset" value="Reset">
47
    </div>
48
    <div>
49
        Inline button
50
        <button>InlineButton</button>
51
    </div>
52
</div>
53
54
</body>
55
</html>
- a/LayoutTests/fast/text-autosizing/form-controls-autosizing-checkbox-input-element-expected.html +32 lines
Line 0 a/LayoutTests/fast/text-autosizing/form-controls-autosizing-checkbox-input-element-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
5
<meta name="viewport" content="width=800">
6
<style>
7
  body {
8
    font-size: 16px;
9
    width: 800px;
10
    margin: 0;
11
    overflow-y: hidden;
12
  }
13
</style>
14
15
</head>
16
<body>
17
18
<div style="font-size: 2.5rem">
19
    This paragraph should be autosized to 40px computed font-size (16 * 800/320),
20
    whereas the check boxes below and the surrounding text should be
21
    rendered at their default font size.
22
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
23
    incididunt ut labore et dolore magna aliqua.
24
</div>
25
<div>
26
    Check one or more:
27
    <input type="checkbox" name="vehicle" value="Bike">I have a bike<br/>
28
    <input type="checkbox" name="vehicle" value="Car">I have a car <br/>
29
</div>
30
31
</body>
32
</html>
- a/LayoutTests/fast/text-autosizing/form-controls-autosizing-checkbox-input-element.html +41 lines
Line 0 a/LayoutTests/fast/text-autosizing/form-controls-autosizing-checkbox-input-element.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
5
<meta name="viewport" content="width=800">
6
<style>
7
  body {
8
    font-size: 16px;
9
    width: 800px;
10
    margin: 0;
11
    overflow-y: hidden;
12
  }
13
</style>
14
15
<script>
16
if (window.internals) {
17
    window.internals.settings.setTextAutosizingEnabled(true);
18
    window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
19
} else if (window.console && console.warn) {
20
    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.");
21
}
22
</script>
23
24
</head>
25
<body>
26
27
<div>
28
    This paragraph should be autosized to 40px computed font-size (16 * 800/320),
29
    whereas the check boxes below and the surrounding text should be
30
    rendered at their default font size.
31
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
32
    incididunt ut labore et dolore magna aliqua.
33
</div>
34
<div>
35
    Check one or more:
36
    <input type="checkbox" name="vehicle" value="Bike">I have a bike<br/>
37
    <input type="checkbox" name="vehicle" value="Car">I have a car <br/>
38
</div>
39
40
</body>
41
</html>
- a/LayoutTests/fast/text-autosizing/form-controls-autosizing-radio-input-element-expected.html +34 lines
Line 0 a/LayoutTests/fast/text-autosizing/form-controls-autosizing-radio-input-element-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
5
<meta name="viewport" content="width=800">
6
<style>
7
  body {
8
    font-size: 16px;
9
    width: 800px;
10
    margin: 0;
11
    overflow-y: hidden;
12
  }
13
</style>
14
15
</head>
16
<body>
17
18
<div style="font-size: 2.5rem">
19
    This paragraph should be autosized to 40px computed font-size (16 * 800/320),
20
    whereas the radio buttons below and the surrounding text should be
21
    rendered at their default font size.
22
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
23
    incididunt ut labore et dolore magna aliqua.
24
</div>
25
<div>
26
    Select one of:<br/>
27
    <input type="radio" id="radio1" checked="checked"/>
28
    <label for="radio1">Radio1</label><br/>
29
    <input type="radio" id="radio2"/>
30
    <label for="radio2">Radio2</label><br/>
31
</div>
32
33
</body>
34
</html>
- a/LayoutTests/fast/text-autosizing/form-controls-autosizing-radio-input-element.html +43 lines
Line 0 a/LayoutTests/fast/text-autosizing/form-controls-autosizing-radio-input-element.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
5
<meta name="viewport" content="width=800">
6
<style>
7
  body {
8
    font-size: 16px;
9
    width: 800px;
10
    margin: 0;
11
    overflow-y: hidden;
12
  }
13
</style>
14
15
<script>
16
if (window.internals) {
17
    window.internals.settings.setTextAutosizingEnabled(true);
18
    window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
19
} else if (window.console && console.warn) {
20
    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.");
21
}
22
</script>
23
24
</head>
25
<body>
26
27
<div>
28
    This paragraph should be autosized to 40px computed font-size (16 * 800/320),
29
    whereas the radio buttons below and the surrounding text should be
30
    rendered at their default font size.
31
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
32
    incididunt ut labore et dolore magna aliqua.
33
</div>
34
<div>
35
    Select one of:<br/>
36
    <input type="radio" id="radio1" checked="checked"/>
37
    <label for="radio1">Radio1</label><br/>
38
    <input type="radio" id="radio2"/>
39
    <label for="radio2">Radio2</label><br/>
40
</div>
41
42
</body>
43
</html>
- a/LayoutTests/fast/text-autosizing/form-controls-autosizing-select-element-expected.html +35 lines
Line 0 a/LayoutTests/fast/text-autosizing/form-controls-autosizing-select-element-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
5
<meta name="viewport" content="width=800">
6
<style>
7
  body {
8
    font-size: 16px;
9
    width: 800px;
10
    margin: 0;
11
    overflow-y: hidden;
12
  }
13
</style>
14
15
</head>
16
<body>
17
18
<div style="font-size: 2.5rem">
19
    This paragraph should be autosized to 40px computed font-size (16 * 800/320),
20
    whereas the selection box and its corresponding text below should be
21
    rendered at their default font size.
22
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
23
    incididunt ut labore et dolore magna aliqua.
24
</div>
25
<div>
26
    Selection:
27
    <select>
28
        <option selected value=default>Default</option>
29
        <option>Option 1</option>
30
        <option>Option 2</option>
31
    </select>
32
</div>
33
34
</body>
35
</html>
- a/LayoutTests/fast/text-autosizing/form-controls-autosizing-select-element.html +44 lines
Line 0 a/LayoutTests/fast/text-autosizing/form-controls-autosizing-select-element.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
5
<meta name="viewport" content="width=800">
6
<style>
7
  body {
8
    font-size: 16px;
9
    width: 800px;
10
    margin: 0;
11
    overflow-y: hidden;
12
  }
13
</style>
14
15
<script>
16
if (window.internals) {
17
    window.internals.settings.setTextAutosizingEnabled(true);
18
    window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
19
} else if (window.console && console.warn) {
20
    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.");
21
}
22
</script>
23
24
</head>
25
<body>
26
27
<div>
28
    This paragraph should be autosized to 40px computed font-size (16 * 800/320),
29
    whereas the selection box and its corresponding text below should be
30
    rendered at their default font size.
31
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
32
    incididunt ut labore et dolore magna aliqua.
33
</div>
34
<div>
35
    Selection:
36
    <select>
37
        <option selected value=default>Default</option>
38
        <option>Option 1</option>
39
        <option>Option 2</option>
40
    </select>
41
</div>
42
43
</body>
44
</html>
- a/LayoutTests/fast/text-autosizing/form-controls-autosizing-textfield-input-elements-expected.html +50 lines
Line 0 a/LayoutTests/fast/text-autosizing/form-controls-autosizing-textfield-input-elements-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
5
<meta name="viewport" content="width=800">
6
<style>
7
  body {
8
    font-size: 16px;
9
    width: 800px;
10
    margin: 0;
11
    overflow-y: hidden;
12
  }
13
</style>
14
15
</head>
16
<body>
17
18
<div style="font-size: 2.5rem">
19
    This paragraph should be autosized to 40px computed font-size (16 * 800/320),
20
    whereas the input text fields and their corresponding text below should be
21
    rendered at their default font size.
22
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
23
    incididunt ut labore et dolore magna aliqua.
24
</div>
25
26
<div>
27
    <div>
28
        Text
29
        <input type="text">
30
    </div>
31
    <div>
32
        Email
33
        <input type="email">
34
    </div>
35
    <div>
36
        Number
37
        <input type="number">
38
    </div>
39
    <div>
40
        Password
41
        <input type="password">
42
    </div>
43
    <div>
44
        URL
45
        <input type="url">
46
    </div>
47
</div>
48
49
</body>
50
</html>
- a/LayoutTests/fast/text-autosizing/form-controls-autosizing-textfield-input-elements.html +59 lines
Line 0 a/LayoutTests/fast/text-autosizing/form-controls-autosizing-textfield-input-elements.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
5
<meta name="viewport" content="width=800">
6
<style>
7
  body {
8
    font-size: 16px;
9
    width: 800px;
10
    margin: 0;
11
    overflow-y: hidden;
12
  }
13
</style>
14
15
<script>
16
if (window.internals) {
17
    window.internals.settings.setTextAutosizingEnabled(true);
18
    window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
19
} else if (window.console && console.warn) {
20
    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.");
21
}
22
</script>
23
24
</head>
25
<body>
26
27
<div>
28
    This paragraph should be autosized to 40px computed font-size (16 * 800/320),
29
    whereas the input text fields and their corresponding text below should be
30
    rendered at their default font size.
31
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
32
    incididunt ut labore et dolore magna aliqua.
33
</div>
34
35
<div>
36
    <div>
37
        Text
38
        <input type="text">
39
    </div>
40
    <div>
41
        Email
42
        <input type="email">
43
    </div>
44
    <div>
45
        Number
46
        <input type="number">
47
    </div>
48
    <div>
49
        Password
50
        <input type="password">
51
    </div>
52
    <div>
53
        URL
54
        <input type="url">
55
    </div>
56
</div>
57
58
</body>
59
</html>

Return to Bug 102560