Changeset 90971 in webkit
- Timestamp:
- Jul 13, 2011 7:16:54 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r90966 r90971 1 2011-07-13 Kent Tamura <tkent@chromium.org> 2 3 Implement text field placeholders using shadow DOM 4 https://bugs.webkit.org/show_bug.cgi?id=64253 5 6 Reviewed by Dimitri Glazkov. 7 8 Add some test cases, and update expectations because placeholders 9 have their renderers. 10 11 * fast/forms/input-placeholder-text-indent.html: 12 Remove an obsolete comment. A placeholder respects a percentage indent. 13 * fast/forms/placeholder-position.html: 14 Add tests for line-height and text-align. 15 * fast/forms/textarea-placeholder-wrapping.html: Added. 16 * platform/chromium/test_expectations.txt: 17 * platform/gtk/test_expectations.txt: 18 * platform/mac/fast/css/pseudo-cache-stale-expected.txt: 19 * platform/mac/fast/forms/input-placeholder-text-indent-expected.png: 20 * platform/mac/fast/forms/input-placeholder-text-indent-expected.txt: 21 * platform/mac/fast/forms/isindex-placeholder-expected.png: 22 * platform/mac/fast/forms/isindex-placeholder-expected.txt: 23 * platform/mac/fast/forms/password-placeholder-expected.txt: 24 * platform/mac/fast/forms/password-placeholder-text-security-expected.png: 25 * platform/mac/fast/forms/password-placeholder-text-security-expected.txt: 26 * platform/mac/fast/forms/placeholder-position-expected.png: 27 * platform/mac/fast/forms/placeholder-position-expected.txt: 28 * platform/mac/fast/forms/placeholder-pseudo-style-expected.png: 29 * platform/mac/fast/forms/placeholder-pseudo-style-expected.txt: 30 * platform/mac/fast/forms/placeholder-set-attribute-expected.txt: 31 * platform/mac/fast/forms/placeholder-stripped-expected.txt: 32 * platform/mac/fast/forms/search-placeholder-value-changed-expected.txt: 33 * platform/mac/fast/forms/search-styled-expected.png: 34 * platform/mac/fast/forms/search-styled-expected.txt: 35 * platform/mac/fast/forms/textarea-placeholder-pseudo-style-expected.txt: 36 * platform/mac/fast/forms/textarea-placeholder-set-attribute-expected.txt: 37 * platform/mac/fast/forms/textarea-placeholder-wrapping-expected.png: Added. 38 * platform/mac/fast/forms/textarea-placeholder-wrapping-expected.txt: Added. 39 * platform/qt/test_expectations.txt: 40 1 41 2011-07-13 Mihnea Ovidenie <mihnea@adobe.com> 2 42 -
trunk/LayoutTests/fast/forms/input-placeholder-text-indent.html
r85560 r90971 5 5 input.c::-webkit-input-placeholder { text-indent: 200px; } 6 6 input.d::-webkit-input-placeholder { text-indent: -10px; } 7 input.e::-webkit-input-placeholder { text-indent: 50%; } /* Ignored. */7 input.e::-webkit-input-placeholder { text-indent: 50%; } 8 8 </style> 9 9 -
trunk/LayoutTests/fast/forms/placeholder-position.html
r79284 r90971 1 <style> 2 .center::-webkit-input-placeholder { 3 text-align: center; 4 } 5 </style> 1 6 <!-- This tests that the placeholder is positioned correctly in different kinds of elements --> 2 7 <input type="search" placeholder="placeholder"><br> … … 8 13 <textarea placeholder="placeholder" style="padding-top: 15px;"></textarea><br> 9 14 <input type="text" placeholder="placeholder" style="font-size: 15px; border: solid 5px black; margin: 5px;"><br> 15 16 <input value="Value" style="line-height: 25px;"> 17 <input placeholder="placeholder" style="line-height: 25px;"> <br> 18 19 <input value="Value" style="text-align: center;"> 20 <input placeholder="placeholder" style="text-align: center;"> 21 <input placeholder="placeholder" class="center"> <br> 22 10 23 <input type="text" placeholder="placeholder" style="padding-top: 15px; -webkit-transform: translateY(30px) rotateZ(30deg)"><br> -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r90960 r90971 3707 3707 BUGWK59921 WIN LINUX : inspector/debugger/debugger-scripts.html = TEXT PASS 3708 3708 3709 // Needs new baseline. 3710 BUGWK64253 : fast/css/pseudo-cache-stale.html = FAIL 3711 BUGWK64253 : fast/forms/input-placeholder-text-indent.html = FAIL 3712 BUGWK64253 : fast/forms/isindex-placeholder.html = FAIL 3713 BUGWK64253 : fast/forms/password-placeholder-text-security.html = FAIL 3714 BUGWK64253 : fast/forms/password-placeholder.html = FAIL 3715 BUGWK64253 : fast/forms/placeholder-position.html = FAIL 3716 BUGWK64253 : fast/forms/placeholder-pseudo-style.html = FAIL 3717 BUGWK64253 : fast/forms/placeholder-set-attribute.html = FAIL 3718 BUGWK64253 : fast/forms/placeholder-stripped.html = FAIL 3719 BUGWK64253 : fast/forms/search-placeholder-value-changed.html = FAIL 3720 BUGWK64253 : fast/forms/search-styled.html = FAIL 3721 BUGWK64253 : fast/forms/textarea-placeholder-pseudo-style.html = FAIL 3722 BUGWK64253 : fast/forms/textarea-placeholder-set-attribute.html = FAIL 3723 BUGWK64253 : fast/forms/textarea-placeholder-wrapping.html = FAIL 3724 3709 3725 // Has been flaky/crashy for a while 3710 3726 BUGCR86359 WIN : fast/dom/DeviceOrientation/add-listener-from-callback.html = CRASH PASS -
trunk/LayoutTests/platform/gtk/test_expectations.txt
r90792 r90971 3 3 // See http://trac.webkit.org/wiki/TestExpectations for more information on this file. 4 4 5 // Needs new baseline. 6 BUGWK64253 : fast/css/pseudo-cache-stale.html = FAIL 7 BUGWK64253 : fast/forms/input-placeholder-text-indent.html = FAIL 8 BUGWK64253 : fast/forms/isindex-placeholder.html = FAIL 9 BUGWK64253 : fast/forms/password-placeholder-text-security.html = FAIL 10 BUGWK64253 : fast/forms/password-placeholder.html = FAIL 11 BUGWK64253 : fast/forms/placeholder-position.html = FAIL 12 BUGWK64253 : fast/forms/placeholder-pseudo-style.html = FAIL 13 BUGWK64253 : fast/forms/placeholder-set-attribute.html = FAIL 14 BUGWK64253 : fast/forms/placeholder-stripped.html = FAIL 15 BUGWK64253 : fast/forms/search-placeholder-value-changed.html = FAIL 16 BUGWK64253 : fast/forms/search-styled.html = FAIL 17 BUGWK64253 : fast/forms/textarea-placeholder-pseudo-style.html = FAIL 18 BUGWK64253 : fast/forms/textarea-placeholder-set-attribute.html = FAIL 19 BUGWK64253 : fast/forms/textarea-placeholder-wrapping.html = FAIL -
trunk/LayoutTests/platform/mac/fast/css/pseudo-cache-stale-expected.txt
r90089 r90971 23 23 layer at (21,87) size 98x13 24 24 RenderBlock {DIV} at (0,0) size 98x13 25 layer at (21,87) size 98x13 scrollWidth 115 26 RenderBlock (relative positioned) {DIV} at (11,3) size 98x13 [color=#008000] 27 RenderText {#text} at (1,0) size 113x13 28 text run at (1,0) width 113: "This should be green" -
trunk/LayoutTests/platform/mac/fast/forms/input-placeholder-text-indent-expected.txt
r85560 r90971 54 54 layer at (295,508) size 494x35 55 55 RenderBlock {DIV} at (3,3) size 494x35 56 layer at (11,13) size 494x35 57 RenderBlock (relative positioned) {DIV} at (3,3) size 494x35 [color=#A9A9A9] 58 RenderText {#text} at (1,0) size 170x35 59 text run at (1,0) width 170: "placeholder" 60 layer at (11,58) size 494x35 61 RenderBlock (relative positioned) {DIV} at (3,3) size 494x35 [color=#A9A9A9] 62 RenderText {#text} at (1,0) size 170x35 63 text run at (1,0) width 170: "placeholder" 64 layer at (11,103) size 494x35 65 RenderBlock (relative positioned) {DIV} at (3,3) size 494x35 [color=#A9A9A9] 66 RenderText {#text} at (11,0) size 170x35 67 text run at (11,0) width 170: "placeholder" 68 layer at (11,148) size 494x35 69 RenderBlock (relative positioned) {DIV} at (3,3) size 494x35 [color=#A9A9A9] 70 RenderText {#text} at (201,0) size 170x35 71 text run at (201,0) width 170: "placeholder" 72 layer at (11,193) size 494x35 73 RenderBlock (relative positioned) {DIV} at (3,3) size 494x35 [color=#A9A9A9] 74 RenderText {#text} at (-9,0) size 170x35 75 text run at (-9,0) width 170: "placeholder" 76 layer at (11,238) size 494x35 77 RenderBlock (relative positioned) {DIV} at (3,3) size 494x35 [color=#A9A9A9] 78 RenderText {#text} at (248,0) size 170x35 79 text run at (248,0) width 170: "placeholder" 80 layer at (295,283) size 494x35 81 RenderBlock (relative positioned) {DIV} at (3,3) size 494x35 [color=#A9A9A9] 82 RenderText {#text} at (323,0) size 170x35 83 text run at (323,0) width 170: "placeholder" 84 layer at (295,328) size 494x35 85 RenderBlock (relative positioned) {DIV} at (3,3) size 494x35 [color=#A9A9A9] 86 RenderText {#text} at (323,0) size 170x35 87 text run at (323,0) width 170: "placeholder" 88 layer at (295,373) size 494x35 89 RenderBlock (relative positioned) {DIV} at (3,3) size 494x35 [color=#A9A9A9] 90 RenderText {#text} at (313,0) size 170x35 91 text run at (313,0) width 170: "placeholder" 92 layer at (295,418) size 494x35 93 RenderBlock (relative positioned) {DIV} at (3,3) size 494x35 [color=#A9A9A9] 94 RenderText {#text} at (123,0) size 170x35 95 text run at (123,0) width 170: "placeholder" 96 layer at (295,463) size 494x35 97 RenderBlock (relative positioned) {DIV} at (3,3) size 494x35 [color=#A9A9A9] 98 RenderText {#text} at (333,0) size 170x35 99 text run at (333,0) width 170: "placeholder" 100 layer at (295,508) size 494x35 101 RenderBlock (relative positioned) {DIV} at (3,3) size 494x35 [color=#A9A9A9] 102 RenderText {#text} at (76,0) size 170x35 103 text run at (76,0) width 170: "placeholder" -
trunk/LayoutTests/platform/mac/fast/forms/isindex-placeholder-expected.txt
r72052 r90971 38 38 layer at (335,168) size 119x13 39 39 RenderBlock {DIV} at (3,3) size 119x13 40 layer at (335,83) size 119x13 41 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#A9A9A9] 42 RenderText {#text} at (1,0) size 63x13 43 text run at (1,0) width 63: "placeholder" 44 layer at (335,168) size 119x13 45 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#008000] 46 RenderText {#text} at (1,0) size 63x13 47 text run at (1,0) width 63: "placeholder" -
trunk/LayoutTests/platform/mac/fast/forms/password-placeholder-expected.txt
r72052 r90971 8 8 layer at (13,13) size 119x13 9 9 RenderBlock {DIV} at (3,3) size 119x13 10 layer at (13,13) size 119x13 11 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#A9A9A9] 12 RenderText {#text} at (1,0) size 36x13 13 text run at (1,0) width 36: "foobar" -
trunk/LayoutTests/platform/mac/fast/forms/password-placeholder-text-security-expected.txt
r72052 r90971 30 30 layer at (603,77) size 119x13 31 31 RenderBlock {DIV} at (3,3) size 119x13 32 layer at (370,31) size 119x13 33 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#A9A9A9] 34 RenderText {#text} at (1,0) size 63x13 35 text run at (1,0) width 63: "placeholder" 36 layer at (603,77) size 119x13 37 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#A9A9A9] 38 RenderText {#text} at (1,0) size 63x13 39 text run at (1,0) width 63: "placeholder" -
trunk/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.txt
r90089 r90971 30 30 RenderTextControl {INPUT} at (5,219) size 176x30 [bgcolor=#FFFFFF] [border: (5px solid #000000)] 31 31 RenderBR {BR} at (186,240) size 0x0 32 RenderBR {BR} at (129,284) size 0x0 32 RenderTextControl {INPUT} at (2,256) size 125x31 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 33 RenderText {#text} at (129,262) size 4x18 34 text run at (129,262) width 4: " " 35 RenderTextControl {INPUT} at (135,256) size 125x31 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 36 RenderText {#text} at (262,262) size 4x18 37 text run at (262,262) width 4: " " 38 RenderBR {BR} at (266,276) size 0x0 39 RenderTextControl {INPUT} at (2,291) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 40 RenderText {#text} at (129,291) size 4x18 41 text run at (129,291) width 4: " " 42 RenderTextControl {INPUT} at (135,291) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 43 RenderText {#text} at (262,291) size 4x18 44 text run at (262,291) width 4: " " 45 RenderTextControl {INPUT} at (268,291) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 46 RenderText {#text} at (395,291) size 4x18 47 text run at (395,291) width 4: " " 48 RenderBR {BR} at (399,305) size 0x0 49 RenderBR {BR} at (129,342) size 0x0 33 50 layer at (21,13) size 98x13 34 51 RenderBlock {DIV} at (0,0) size 98x13 … … 49 66 layer at (19,233) size 164x18 50 67 RenderBlock {DIV} at (6,6) size 164x18 51 layer at (10,264) size 125x33 52 RenderTextControl {INPUT} at (2,256) size 125x33 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 53 layer at (13,281) size 119x13 68 layer at (13,267) size 119x25 69 RenderBlock {DIV} at (3,3) size 119x25 70 RenderText {#text} at (1,6) size 30x13 71 text run at (1,6) width 30: "Value" 72 layer at (146,267) size 119x25 73 RenderBlock {DIV} at (3,3) size 119x25 74 layer at (13,302) size 119x13 75 RenderBlock {DIV} at (3,3) size 119x13 76 RenderText {#text} at (44,0) size 31x13 77 text run at (44,0) width 31: "Value" 78 layer at (146,302) size 119x13 79 RenderBlock {DIV} at (3,3) size 119x13 80 layer at (279,302) size 119x13 81 RenderBlock {DIV} at (3,3) size 119x13 82 layer at (21,13) size 98x13 83 RenderBlock (relative positioned) {DIV} at (11,3) size 98x13 [color=#A9A9A9] 84 RenderText {#text} at (1,0) size 63x13 85 text run at (1,0) width 63: "placeholder" 86 layer at (13,36) size 119x13 87 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#A9A9A9] 88 RenderText {#text} at (1,0) size 63x13 89 text run at (1,0) width 63: "placeholder" 90 layer at (21,59) size 98x13 91 RenderBlock (relative positioned) {DIV} at (11,3) size 98x13 [color=#A9A9A9] 92 RenderText {#text} at (34,0) size 63x13 93 text run at (34,0) width 63: "placeholder" 94 layer at (35,82) size 84x13 95 RenderBlock (relative positioned) {DIV} at (25,3) size 84x13 [color=#A9A9A9] 96 RenderText {#text} at (1,0) size 63x13 97 text run at (1,0) width 63: "placeholder" 98 layer at (13,105) size 155x13 99 RenderBlock (relative positioned) {DIV} at (3,3) size 155x13 [color=#A9A9A9] 100 RenderText {#text} at (0,0) size 63x13 101 text run at (0,0) width 63: "placeholder" 102 layer at (13,141) size 119x13 103 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#A9A9A9] 104 RenderText {#text} at (1,0) size 63x13 105 text run at (1,0) width 63: "placeholder" 106 layer at (13,191) size 155x13 107 RenderBlock (relative positioned) {DIV} at (3,16) size 155x13 [color=#A9A9A9] 108 RenderText {#text} at (0,0) size 63x13 109 text run at (0,0) width 63: "placeholder" 110 layer at (19,233) size 164x18 111 RenderBlock (relative positioned) {DIV} at (6,6) size 164x18 [color=#A9A9A9] 112 RenderText {#text} at (1,0) size 85x18 113 text run at (1,0) width 85: "placeholder" 114 layer at (146,267) size 119x25 115 RenderBlock (relative positioned) {DIV} at (3,3) size 119x25 [color=#A9A9A9] 116 RenderText {#text} at (1,6) size 63x13 117 text run at (1,6) width 63: "placeholder" 118 layer at (146,302) size 119x13 119 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#A9A9A9] 120 RenderText {#text} at (28,0) size 63x13 121 text run at (28,0) width 63: "placeholder" 122 layer at (279,302) size 119x13 123 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#A9A9A9] 124 RenderText {#text} at (28,0) size 63x13 125 text run at (28,0) width 63: "placeholder" 126 layer at (10,322) size 125x33 127 RenderTextControl {INPUT} at (2,314) size 125x33 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 128 layer at (13,339) size 119x13 54 129 RenderBlock {DIV} at (3,17) size 119x13 130 layer at (13,339) size 119x13 131 RenderBlock (relative positioned) {DIV} at (3,17) size 119x13 [color=#A9A9A9] 132 RenderText {#text} at (1,0) size 63x13 133 text run at (1,0) width 63: "placeholder" -
trunk/LayoutTests/platform/mac/fast/forms/placeholder-pseudo-style-expected.txt
r90089 r90971 40 40 layer at (13,54) size 119x13 41 41 RenderBlock {DIV} at (3,3) size 119x13 42 layer at (13,31) size 119x13 43 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#640000] 44 RenderText {#text} at (1,0) size 22x13 45 text run at (1,0) width 22: "text" 46 layer at (154,31) size 98x13 47 RenderBlock (relative positioned) {DIV} at (11,3) size 98x13 [color=#640000] 48 RenderText {#text} at (1,0) size 35x13 49 text run at (1,0) width 35: "search" 50 layer at (279,31) size 119x13 51 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#640000] 52 RenderText {#text} at (1,0) size 51x13 53 text run at (1,0) width 51: "password" 54 layer at (412,31) size 119x13 55 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#640000] 56 RenderText {#text} at (1,0) size 70x13 57 text run at (1,0) width 70: "disabled text" 58 layer at (545,31) size 119x13 59 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#A9A9A9] 60 RenderText {#text} at (1,0) size 38x13 61 text run at (1,0) width 38: "default" 62 layer at (13,54) size 119x13 63 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#A9A9A9] 64 RenderText {#text} at (1,0) size 86x13 65 text run at (1,0) width 86: "default disabled" -
trunk/LayoutTests/platform/mac/fast/forms/placeholder-set-attribute-expected.txt
r72052 r90971 11 11 layer at (13,47) size 119x13 12 12 RenderBlock {DIV} at (3,3) size 119x13 13 layer at (13,47) size 119x13 14 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#A9A9A9] 15 RenderText {#text} at (1,0) size 62x13 16 text run at (1,0) width 62: "Placeholder" -
trunk/LayoutTests/platform/mac/fast/forms/placeholder-stripped-expected.txt
r72052 r90971 25 25 RenderTextControl {TEXTAREA} at (2,88) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 26 26 RenderBlock {DIV} at (3,3) size 155x13 27 layer at (13,73) size 119x13 28 RenderBlock (relative positioned) {DIV} at (3,3) size 119x13 [color=#A9A9A9] 29 RenderText {#text} at (1,0) size 109x13 30 text run at (1,0) width 109: "first line second line" 31 layer at (13,119) size 155x13 32 RenderBlock (relative positioned) {DIV} at (3,3) size 155x13 [color=#A9A9A9] 33 RenderText {#text} at (0,0) size 109x13 34 text run at (0,0) width 109: "first line second line" -
trunk/LayoutTests/platform/mac/fast/forms/search-placeholder-value-changed-expected.txt
r90089 r90971 13 13 layer at (21,13) size 98x13 14 14 RenderBlock {DIV} at (0,0) size 98x13 15 layer at (21,13) size 98x13 16 RenderBlock (relative positioned) {DIV} at (11,3) size 98x13 [color=#A9A9A9] 17 RenderText {#text} at (1,0) size 63x13 18 text run at (1,0) width 63: "Test Passed" -
trunk/LayoutTests/platform/mac/fast/forms/search-styled-expected.txt
r90089 r90971 12 12 layer at (35,13) size 84x13 13 13 RenderBlock {DIV} at (0,0) size 84x13 14 layer at (35,13) size 84x13 scrollWidth 94 15 RenderBlock (relative positioned) {DIV} at (25,3) size 84x13 [color=#A9A9A9] 16 RenderText {#text} at (1,0) size 92x13 17 text run at (1,0) width 92: "Search for Events" -
trunk/LayoutTests/platform/mac/fast/forms/textarea-placeholder-pseudo-style-expected.txt
r72052 r90971 26 26 RenderTextControl {TEXTAREA} at (509,20) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 27 27 RenderBlock {DIV} at (3,3) size 155x13 [color=#545454] 28 layer at (13,31) size 155x13 29 RenderBlock (relative positioned) {DIV} at (3,3) size 155x13 [color=#640000] 30 RenderText {#text} at (0,0) size 22x13 31 text run at (0,0) width 22: "text" 32 layer at (182,31) size 155x13 33 RenderBlock (relative positioned) {DIV} at (3,3) size 155x13 [color=#640000] 34 RenderText {#text} at (0,0) size 70x13 35 text run at (0,0) width 70: "disabled text" 36 layer at (351,31) size 155x13 37 RenderBlock (relative positioned) {DIV} at (3,3) size 155x13 [color=#A9A9A9] 38 RenderText {#text} at (0,0) size 38x13 39 text run at (0,0) width 38: "default" 40 layer at (520,31) size 155x13 41 RenderBlock (relative positioned) {DIV} at (3,3) size 155x13 [color=#A9A9A9] 42 RenderText {#text} at (0,0) size 86x13 43 text run at (0,0) width 86: "default disabled" -
trunk/LayoutTests/platform/mac/fast/forms/textarea-placeholder-set-attribute-expected.txt
r72052 r90971 11 11 RenderTextControl {TEXTAREA} at (2,2) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 12 12 RenderBlock {DIV} at (3,3) size 155x13 13 layer at (13,47) size 155x13 14 RenderBlock (relative positioned) {DIV} at (3,3) size 155x13 [color=#A9A9A9] 15 RenderText {#text} at (0,0) size 62x13 16 text run at (0,0) width 62: "Placeholder" -
trunk/LayoutTests/platform/qt/test_expectations.txt
r90891 r90971 2 2 // 3 3 // See http://trac.webkit.org/wiki/TestExpectations for more information on this file. 4 5 // Needs new baseline. 6 BUGWK64253 : fast/css/pseudo-cache-stale.html = FAIL 7 BUGWK64253 : fast/forms/input-placeholder-text-indent.html = FAIL 8 BUGWK64253 : fast/forms/isindex-placeholder.html = FAIL 9 BUGWK64253 : fast/forms/password-placeholder-text-security.html = FAIL 10 BUGWK64253 : fast/forms/password-placeholder.html = FAIL 11 BUGWK64253 : fast/forms/placeholder-position.html = FAIL 12 BUGWK64253 : fast/forms/placeholder-pseudo-style.html = FAIL 13 BUGWK64253 : fast/forms/placeholder-set-attribute.html = FAIL 14 BUGWK64253 : fast/forms/placeholder-stripped.html = FAIL 15 BUGWK64253 : fast/forms/search-placeholder-value-changed.html = FAIL 16 BUGWK64253 : fast/forms/search-styled.html = FAIL 17 BUGWK64253 : fast/forms/textarea-placeholder-pseudo-style.html = FAIL 18 BUGWK64253 : fast/forms/textarea-placeholder-set-attribute.html = FAIL 19 BUGWK64253 : fast/forms/textarea-placeholder-wrapping.html = FAIL 4 20 5 21 BUGWK64002 : http/tests/misc/object-embedding-svg-delayed-size-negotiation-2.htm = TEXT PASS -
trunk/Source/WebCore/ChangeLog
r90970 r90971 1 2011-07-13 Kent Tamura <tkent@chromium.org> 2 3 Implement text field placeholders using shadow DOM 4 https://bugs.webkit.org/show_bug.cgi?id=64253 5 6 Reviewed by Dimitri Glazkov. 7 8 Represents a placeholder text as a shadow element, and its 9 visibility is controlled by 'visibility' CSS property. 10 11 This patch removes all of existing code about placeholder from 12 RenderTextControl*. RenderTextControl* have only small code about 13 placeholder layout. 14 15 Also, this patch removes INPUT_PLACEHOLDER legacy pseudo ID, and 16 the placeholder style uses Element::shadowPseudoId(). 17 18 This fixes the following regressions: 19 - https://bugs.webkit.org/show_bug.cgi?id=51290 20 - https://bugs.webkit.org/show_bug.cgi?id=54797 21 - https://bugs.webkit.org/show_bug.cgi?id=54814 22 - https://bugs.webkit.org/show_bug.cgi?id=63367 23 24 Test: fast/forms/textarea-placeholder-wrapping.html 25 26 * css/CSSSelector.cpp: Remove INPUT_PLACEHOLDER legacy pseudo ID. 27 (WebCore::CSSSelector::pseudoId): 28 (WebCore::nameToPseudoTypeMap): 29 (WebCore::CSSSelector::extractPseudoType): 30 * css/CSSSelector.h: ditto. 31 * css/html.css: 32 (::-webkit-input-placeholder): Added. This contains properties 33 common in <input> and <textarea>. Some properties have !important 34 so that a stylesheet specified by a page author won't break 35 WebKit's assumption. 36 (input::-webkit-input-placeholder, isindex::-webkit-input-placeholder): 37 Added the default style for <input> placeholders. 38 * html/HTMLInputElement.cpp: 39 (WebCore::HTMLInputElement::placeholderElement): Delegate to an InputType. 40 (WebCore::HTMLInputElement::updatePlaceholderText): ditto. 41 * html/HTMLInputElement.h: Declare placeholderElement() and updatePlaceholderText(). 42 * html/HTMLTextAreaElement.cpp: 43 (WebCore::HTMLTextAreaElement::createRenderer): 44 Remove the 'placeholderVisible' argument. 45 (WebCore::HTMLTextAreaElement::placeholderElement): Added. 46 (WebCore::HTMLTextAreaElement::updatePlaceholderText): 47 Added. This creates, deletes, or updates the placeholder element. 48 * html/HTMLTextAreaElement.h: 49 - Declare placeholderElement() and updatePlaceholderText(). 50 - Add m_placeholder. 51 * html/HTMLTextFormControlElement.cpp: 52 (WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility): 53 Update the placeholder element and 'visibility' CSS property, 54 instead of delegating the job to a renderer. 55 * html/HTMLTextFormControlElement.h: 56 Declare two pure virtual functions: placeholderElement() and updatePlaceholderText(). 57 * html/InputType.cpp: 58 (WebCore::InputType::placeholderElement): Add an empty implementation. 59 (WebCore::InputType::updatePlaceholderText): Add an empty implementation. 60 * html/InputType.h: Declare placeholderElement() and updatePlaceholderText(). 61 * html/TextFieldInputType.cpp: 62 (WebCore::TextFieldInputType::createRenderer): 63 Remove the 'placeholderVisible' argument. 64 (WebCore::TextFieldInputType::placeholderElement): Added. 65 (WebCore::TextFieldInputType::destroyShadowSubtree): Deletes m_placeholder. 66 (WebCore::TextFieldInputType::updatePlaceholderText): 67 Added. This creates, deletes, or updates the placeholder element. 68 * html/TextFieldInputType.h: 69 - Declare placeholderElement() and updatePlaceholderText(). 70 - Add m_placeholder. 71 * rendering/RenderTextControl.cpp: 72 (WebCore::RenderTextControl::RenderTextControl): 73 Remove the 'placeholderVisible' argument. 74 (WebCore::RenderTextControl::layoutSpecialExcludedChild): 75 Excludes the placeholder renderer in order to avoid to secure a box for 76 the placeholder. 77 * rendering/RenderTextControl.h: 78 - Remove declarations of removed functions. 79 - Update the RenderTextControl signature. 80 - Add layoutSpecialExcludedChild(). 81 * rendering/RenderTextControlMultiLine.cpp: 82 (WebCore::RenderTextControlMultiLine::RenderTextControlMultiLine): 83 Remove the 'placeholderVisible' argument. 84 (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): 85 Laying out the placeholder box so that it has correct width and location. 86 * rendering/RenderTextControlMultiLine.h: 87 - Remove declarations of removed functions. 88 - Update the RenderTextControlMultiLine signature. 89 - Add layoutSpecialExcludedChild(). 90 * rendering/RenderTextControlSingleLine.cpp: 91 (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine): 92 Remove the 'placeholderVisible' argument. 93 (WebCore::RenderTextControlSingleLine::layout): 94 Laying out the placeholder box so that it has correct width and location. 95 * rendering/RenderTextControlSingleLine.h: 96 - Remove declarations of removed functions. 97 - Update the RenderTextControlSingleLine signature. 98 * rendering/style/RenderStyleConstants.h: Remove INPUT_PLACEHOLDER. 99 1 100 2011-07-13 James Simonsen <simonjam@chromium.org> 2 101 -
trunk/Source/WebCore/css/CSSSelector.cpp
r89989 r90971 127 127 case PseudoAfter: 128 128 return AFTER; 129 case PseudoInputPlaceholder:130 return INPUT_PLACEHOLDER;131 129 case PseudoScrollbar: 132 130 return SCROLLBAR; … … 257 255 DEFINE_STATIC_LOCAL(AtomicString, inputListButton, ("-webkit-input-list-button")); 258 256 #endif 259 DEFINE_STATIC_LOCAL(AtomicString, inputPlaceholder, ("-webkit-input-placeholder"));260 257 DEFINE_STATIC_LOCAL(AtomicString, lastChild, ("last-child")); 261 258 DEFINE_STATIC_LOCAL(AtomicString, lastOfType, ("last-of-type")); … … 327 324 nameToPseudoType->set(inputListButton.impl(), CSSSelector::PseudoInputListButton); 328 325 #endif 329 nameToPseudoType->set(inputPlaceholder.impl(), CSSSelector::PseudoInputPlaceholder);330 326 nameToPseudoType->set(lastChild.impl(), CSSSelector::PseudoLastChild); 331 327 nameToPseudoType->set(lastOfType.impl(), CSSSelector::PseudoLastOfType); … … 416 412 compat = true; 417 413 case PseudoInputListButton: 418 case PseudoInputPlaceholder:419 414 case PseudoResizer: 420 415 case PseudoScrollbar: -
trunk/Source/WebCore/css/CSSSelector.h
r89989 r90971 138 138 PseudoDefault, 139 139 PseudoDisabled, 140 PseudoInputPlaceholder,141 140 PseudoOptional, 142 141 PseudoRequired, -
trunk/Source/WebCore/css/html.css
r90089 r90971 498 498 } 499 499 500 input::-webkit-input-placeholder, isindex::-webkit-input-placeholder, textarea::-webkit-input-placeholder { 500 ::-webkit-input-placeholder { 501 -webkit-text-security: none; 501 502 color: darkGray; 503 display: block !important; 504 pointer-events: none !important; 505 position: relative !important; 506 } 507 508 input::-webkit-input-placeholder, isindex::-webkit-input-placeholder { 509 white-space: pre; 510 word-wrap: normal; 511 overflow: hidden; 512 padding-left: 1px; 513 padding-right: 1px; 502 514 } 503 515 -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r90849 r90971 164 164 } 165 165 #endif 166 167 HTMLElement* HTMLInputElement::placeholderElement() const 168 { 169 return m_inputType->placeholderElement(); 170 } 166 171 167 172 bool HTMLInputElement::shouldAutocomplete() const … … 1820 1825 } 1821 1826 1827 void HTMLInputElement::updatePlaceholderText() 1828 { 1829 return m_inputType->updatePlaceholderText(); 1830 } 1831 1822 1832 CheckedRadioButtons& HTMLInputElement::checkedRadioButtons() const 1823 1833 { -
trunk/Source/WebCore/html/HTMLInputElement.h
r90849 r90971 119 119 HTMLElement* speechButtonElement() const; 120 120 #endif 121 virtual HTMLElement* placeholderElement() const; 121 122 122 123 bool checked() const { return m_isChecked; } … … 303 304 304 305 virtual bool supportsPlaceholder() const; 306 virtual void updatePlaceholderText(); 305 307 virtual bool isEmptyValue() const { return value().isEmpty(); } 306 308 virtual bool isEmptySuggestedValue() const { return suggestedValue().isEmpty(); } -
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
r90849 r90971 175 175 RenderObject* HTMLTextAreaElement::createRenderer(RenderArena* arena, RenderStyle*) 176 176 { 177 return new (arena) RenderTextControlMultiLine(this , placeholderShouldBeVisible());177 return new (arena) RenderTextControlMultiLine(this); 178 178 } 179 179 … … 443 443 } 444 444 445 } 445 HTMLElement* HTMLTextAreaElement::placeholderElement() const 446 { 447 return m_placeholder.get(); 448 } 449 450 void HTMLTextAreaElement::updatePlaceholderText() 451 { 452 ExceptionCode ec = 0; 453 String placeholderText = strippedPlaceholder(); 454 if (placeholderText.isEmpty()) { 455 if (m_placeholder) { 456 shadowRoot()->removeChild(m_placeholder.get(), ec); 457 ASSERT(!ec); 458 m_placeholder.clear(); 459 } 460 return; 461 } 462 if (!m_placeholder) { 463 m_placeholder = HTMLDivElement::create(document()); 464 m_placeholder->setShadowPseudoId("-webkit-input-placeholder", ec); 465 ASSERT(!ec); 466 shadowRoot()->insertBefore(m_placeholder, shadowRoot()->firstChild()->nextSibling(), ec); 467 ASSERT(!ec); 468 } 469 m_placeholder->setInnerText(placeholderText, ec); 470 ASSERT(!ec); 471 } 472 473 } -
trunk/Source/WebCore/html/HTMLTextAreaElement.h
r90849 r90971 75 75 76 76 virtual bool supportsPlaceholder() const { return true; } 77 virtual HTMLElement* placeholderElement() const; 78 virtual void updatePlaceholderText(); 77 79 virtual bool isEmptyValue() const { return value().isEmpty(); } 78 80 … … 107 109 int m_cols; 108 110 WrapMethod m_wrap; 111 RefPtr<HTMLElement> m_placeholder; 109 112 mutable String m_value; 110 113 mutable bool m_isDirty; -
trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp
r90885 r90971 129 129 void HTMLTextFormControlElement::updatePlaceholderVisibility(bool placeholderValueChanged) 130 130 { 131 if (supportsPlaceholder() && renderer()) 132 toRenderTextControl(renderer())->updatePlaceholderVisibility(placeholderShouldBeVisible(), placeholderValueChanged); 131 if (!supportsPlaceholder()) 132 return; 133 if (!placeholderElement() || placeholderValueChanged) 134 updatePlaceholderText(); 135 HTMLElement* placeholder = placeholderElement(); 136 if (!placeholder) 137 return; 138 ExceptionCode ec = 0; 139 placeholder->getInlineStyleDecl()->setProperty(CSSPropertyVisibility, placeholderShouldBeVisible() ? "visible" : "hidden", ec); 140 ASSERT(!ec); 133 141 } 134 142 -
trunk/Source/WebCore/html/HTMLTextFormControlElement.h
r90885 r90971 46 46 String strippedPlaceholder() const; 47 47 bool placeholderShouldBeVisible() const; 48 virtual HTMLElement* placeholderElement() const = 0; 48 49 49 50 int indexForVisiblePosition(const VisiblePosition&) const; … … 76 77 77 78 void updatePlaceholderVisibility(bool); 79 virtual void updatePlaceholderText() = 0; 78 80 79 81 virtual void parseMappedAttribute(Attribute*); -
trunk/Source/WebCore/html/InputType.cpp
r90101 r90971 459 459 } 460 460 461 HTMLElement* InputType::placeholderElement() const 462 { 463 return 0; 464 } 465 461 466 bool InputType::rendererIsNeeded() 462 467 { … … 661 666 } 662 667 668 void InputType::updatePlaceholderText() 669 { 670 } 671 663 672 void InputType::multipleAttributeChanged() 664 673 { -
trunk/Source/WebCore/html/InputType.h
r90101 r90971 199 199 virtual HTMLElement* speechButtonElement() const { return 0; } 200 200 #endif 201 virtual HTMLElement* placeholderElement() const; 201 202 202 203 // Miscellaneous functions … … 227 228 virtual bool shouldRespectHeightAndWidthAttributes(); 228 229 virtual bool supportsPlaceholder() const; 230 virtual void updatePlaceholderText(); 229 231 virtual void multipleAttributeChanged(); 230 232 -
trunk/Source/WebCore/html/TextFieldInputType.cpp
r90089 r90971 127 127 RenderObject* TextFieldInputType::createRenderer(RenderArena* arena, RenderStyle*) const 128 128 { 129 return new (arena) RenderTextControlSingleLine(element() , element()->placeholderShouldBeVisible());129 return new (arena) RenderTextControlSingleLine(element()); 130 130 } 131 131 … … 208 208 #endif 209 209 210 HTMLElement* TextFieldInputType::placeholderElement() const 211 { 212 return m_placeholder.get(); 213 } 214 210 215 void TextFieldInputType::destroyShadowSubtree() 211 216 { 212 217 InputType::destroyShadowSubtree(); 213 218 m_innerText.clear(); 219 m_placeholder.clear(); 214 220 m_innerBlock.clear(); 215 221 #if ENABLE(INPUT_SPEECH) … … 304 310 } 305 311 312 void TextFieldInputType::updatePlaceholderText() 313 { 314 if (!supportsPlaceholder()) 315 return; 316 ExceptionCode ec = 0; 317 String placeholderText = element()->strippedPlaceholder(); 318 if (placeholderText.isEmpty()) { 319 if (m_placeholder) { 320 m_placeholder->parentNode()->removeChild(m_placeholder.get(), ec); 321 ASSERT(!ec); 322 m_placeholder.clear(); 323 } 324 return; 325 } 326 if (!m_placeholder) { 327 m_placeholder = HTMLDivElement::create(element()->document()); 328 m_placeholder->setShadowPseudoId("-webkit-input-placeholder", ec); 329 ASSERT(!ec); 330 element()->shadowRoot()->insertBefore(m_placeholder, m_container ? m_container->nextSibling() : innerTextElement()->nextSibling(), ec); 331 ASSERT(!ec); 332 } 333 m_placeholder->setInnerText(placeholderText, ec); 334 ASSERT(!ec); 335 } 336 306 337 } // namespace WebCore -
trunk/Source/WebCore/html/TextFieldInputType.h
r90089 r90971 70 70 virtual String sanitizeValue(const String&); 71 71 virtual bool shouldRespectListAttribute(); 72 virtual HTMLElement* placeholderElement() const; 73 virtual void updatePlaceholderText(); 72 74 73 75 RefPtr<HTMLElement> m_container; 74 76 RefPtr<HTMLElement> m_innerBlock; 75 77 RefPtr<HTMLElement> m_innerText; 78 RefPtr<HTMLElement> m_placeholder; 76 79 RefPtr<HTMLElement> m_innerSpinButton; 77 80 #if ENABLE(INPUT_SPEECH) -
trunk/Source/WebCore/rendering/RenderTextControl.cpp
r90885 r90971 70 70 } 71 71 72 RenderTextControl::RenderTextControl(Node* node , bool placeholderVisible)72 RenderTextControl::RenderTextControl(Node* node) 73 73 : RenderBlock(node) 74 , m_placeholderVisible(placeholderVisible)75 74 , m_lastChangeWasUserEdit(false) 76 75 { 76 ASSERT(toTextFormControl(node)); 77 77 } 78 78 … … 445 445 } 446 446 447 void RenderTextControl::updatePlaceholderVisibility(bool placeholderShouldBeVisible, bool placeholderValueChanged) 448 { 449 bool oldPlaceholderVisible = m_placeholderVisible; 450 m_placeholderVisible = placeholderShouldBeVisible; 451 if (oldPlaceholderVisible != m_placeholderVisible || placeholderValueChanged) 452 repaint(); 453 } 454 455 void RenderTextControl::paintPlaceholder(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 456 { 457 if (style()->visibility() != VISIBLE) 458 return; 459 460 LayoutRect clipRect(paintOffset.x() + borderLeft(), paintOffset.y() + borderTop(), width() - borderLeft() - borderRight(), height() - borderBottom() - borderTop()); 461 if (clipRect.isEmpty()) 462 return; 463 464 GraphicsContextStateSaver stateSaver(*paintInfo.context); 465 paintInfo.context->clip(clipRect); 466 467 RefPtr<RenderStyle> placeholderStyle = getCachedPseudoStyle(INPUT_PLACEHOLDER); 468 if (!placeholderStyle) 469 placeholderStyle = style(); 470 471 paintInfo.context->setFillColor(placeholderStyle->visitedDependentColor(CSSPropertyColor), placeholderStyle->colorSpace()); 472 473 String placeholderText = static_cast<HTMLTextFormControlElement*>(node())->strippedPlaceholder(); 474 TextRun textRun(placeholderText.characters(), placeholderText.length(), false, 0, 0, TextRun::AllowTrailingExpansion, placeholderStyle->direction(), placeholderStyle->unicodeBidi() == Override); 475 476 RenderBox* textRenderer = innerTextElement() ? innerTextElement()->renderBox() : 0; 477 if (textRenderer) { 478 LayoutPoint textPoint; 479 textPoint.setY(paintOffset.y() + textBlockInsetTop() + placeholderStyle->fontMetrics().ascent()); 480 LayoutUnit styleTextIndent = placeholderStyle->textIndent().isFixed() ? placeholderStyle->textIndent().calcMinValue(0) : 0; 481 if (placeholderStyle->isLeftToRightDirection()) 482 textPoint.setX(paintOffset.x() + styleTextIndent + textBlockInsetLeft()); 483 else 484 textPoint.setX(paintOffset.x() + width() - textBlockInsetRight() - styleTextIndent - style()->font().width(textRun)); 485 486 paintInfo.context->drawBidiText(placeholderStyle->font(), textRun, textPoint); 487 } 488 } 489 490 void RenderTextControl::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 491 { 492 if (m_placeholderVisible && paintInfo.phase == PaintPhaseForeground) 493 paintPlaceholder(paintInfo, paintOffset); 494 495 RenderBlock::paintObject(paintInfo, paintOffset); 447 RenderObject* RenderTextControl::layoutSpecialExcludedChild(bool relayoutChildren) 448 { 449 HTMLElement* placeholder = toTextFormControl(node())->placeholderElement(); 450 RenderObject* placeholderRenderer = placeholder ? placeholder->renderer() : 0; 451 if (!placeholderRenderer) 452 return 0; 453 if (relayoutChildren) 454 placeholderRenderer->setNeedsLayout(true); 455 return placeholderRenderer; 496 456 } 497 457 -
trunk/Source/WebCore/rendering/RenderTextControl.h
r90885 r90971 45 45 VisiblePosition visiblePositionForIndex(int index) const; 46 46 47 void updatePlaceholderVisibility(bool, bool);48 49 47 protected: 50 RenderTextControl(Node* , bool);48 RenderTextControl(Node*); 51 49 52 50 // This convenience function should not be made public because innerTextElement may outlive the render tree. … … 75 73 virtual void updateFromElement(); 76 74 virtual void computeLogicalHeight(); 75 virtual RenderObject* layoutSpecialExcludedChild(bool relayoutChildren); 77 76 78 77 bool m_placeholderVisible; … … 85 84 virtual bool canHaveChildren() const { return false; } 86 85 virtual bool avoidsFloats() const { return true; } 87 virtual void paintObject(PaintInfo&, const LayoutPoint&);88 86 89 87 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&); … … 95 93 static bool isSelectableElement(HTMLElement*, Node*); 96 94 97 virtual int textBlockInsetLeft() const = 0;98 virtual int textBlockInsetRight() const = 0;99 virtual int textBlockInsetTop() const = 0;100 101 void paintPlaceholder(PaintInfo&, const IntPoint&);102 103 95 bool m_lastChangeWasUserEdit; 104 96 }; -
trunk/Source/WebCore/rendering/RenderTextControlMultiLine.cpp
r90791 r90971 34 34 namespace WebCore { 35 35 36 RenderTextControlMultiLine::RenderTextControlMultiLine(Node* node , bool placeholderVisible)37 : RenderTextControl(node , placeholderVisible)36 RenderTextControlMultiLine::RenderTextControlMultiLine(Node* node) 37 : RenderTextControl(node) 38 38 { 39 39 } … … 124 124 return style(); 125 125 } 126 127 int RenderTextControlMultiLine::textBlockInsetLeft() const 126 127 RenderObject* RenderTextControlMultiLine::layoutSpecialExcludedChild(bool relayoutChildren) 128 128 { 129 int inset = borderLeft() + paddingLeft(); 130 if (HTMLElement* innerText = innerTextElement()) { 131 if (RenderBox* innerTextRenderer = innerText->renderBox()) 132 inset += innerTextRenderer->paddingLeft(); 133 } 134 return inset; 135 } 136 137 int RenderTextControlMultiLine::textBlockInsetRight() const 138 { 139 int inset = borderRight() + paddingRight(); 140 if (HTMLElement* innerText = innerTextElement()) { 141 if (RenderBox* innerTextRenderer = innerText->renderBox()) 142 inset += innerTextRenderer->paddingRight(); 143 } 144 return inset; 145 } 146 147 int RenderTextControlMultiLine::textBlockInsetTop() const 148 { 149 int inset = borderTop() + paddingTop(); 150 if (HTMLElement* innerText = innerTextElement()) { 151 if (RenderBox* innerTextRenderer = innerText->renderBox()) 152 inset += innerTextRenderer->paddingTop(); 153 } 154 return inset; 129 RenderObject* placeholderRenderer = RenderTextControl::layoutSpecialExcludedChild(relayoutChildren); 130 if (!placeholderRenderer) 131 return 0; 132 if (!placeholderRenderer->isBox()) 133 return placeholderRenderer; 134 RenderBox* placeholderBox = toRenderBox(placeholderRenderer); 135 placeholderBox->style()->setWidth(Length(contentWidth() - placeholderBox->borderAndPaddingWidth(), Fixed)); 136 placeholderBox->layoutIfNeeded(); 137 placeholderBox->setX(borderLeft() + paddingLeft()); 138 placeholderBox->setY(borderTop() + paddingTop()); 139 return placeholderRenderer; 155 140 } 156 141 -
trunk/Source/WebCore/rendering/RenderTextControlMultiLine.h
r90775 r90971 29 29 class RenderTextControlMultiLine : public RenderTextControl { 30 30 public: 31 RenderTextControlMultiLine(Node* , bool);31 RenderTextControlMultiLine(Node*); 32 32 virtual ~RenderTextControlMultiLine(); 33 33 … … 50 50 virtual RenderStyle* textBaseStyle() const; 51 51 virtual PassRefPtr<RenderStyle> createInnerTextStyle(const RenderStyle* startStyle) const; 52 virtual int textBlockInsetLeft() const; 53 virtual int textBlockInsetRight() const; 54 virtual int textBlockInsetTop() const; 52 virtual RenderObject* layoutSpecialExcludedChild(bool relayoutChildren); 55 53 }; 56 54 -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r90791 r90971 70 70 // ---------------------------- 71 71 72 RenderTextControlSingleLine::RenderTextControlSingleLine(Node* node , bool placeholderVisible)73 : RenderTextControl(node , placeholderVisible)72 RenderTextControlSingleLine::RenderTextControlSingleLine(Node* node) 73 : RenderTextControl(node) 74 74 , m_searchPopupIsVisible(false) 75 75 , m_shouldDrawCapsLockIndicator(false) … … 325 325 innerSpinBox->setLocation(LayoutPoint(parentBox->width() - innerSpinBox->width() + paddingRight(), -paddingTop())); 326 326 innerSpinBox->setHeight(height() - borderTop() - borderBottom()); 327 } 328 329 HTMLElement* placeholderElement = inputElement()->placeholderElement(); 330 if (RenderBox* placeholderBox = placeholderElement ? placeholderElement->renderBox() : 0) { 331 placeholderBox->style()->setWidth(Length(innerTextRenderer->width() - placeholderBox->borderAndPaddingWidth(), Fixed)); 332 placeholderBox->style()->setHeight(Length(innerTextRenderer->height() - placeholderBox->borderAndPaddingHeight(), Fixed)); 333 placeholderBox->layoutIfNeeded(); 334 LayoutPoint textOffset = innerTextRenderer->location(); 335 if (innerBlockElement() && innerBlockElement()->renderBox()) 336 textOffset += toLayoutSize(innerBlockElement()->renderBox()->location()); 337 if (containerRenderer) 338 textOffset += toLayoutSize(containerRenderer->location()); 339 placeholderBox->setLocation(textOffset); 327 340 } 328 341 } … … 848 861 } 849 862 850 int RenderTextControlSingleLine::textBlockInsetLeft() const 851 { 852 int inset = borderLeft() + clientPaddingLeft(); 853 if (HTMLElement* innerText = innerTextElement()) { 854 if (RenderBox* innerTextRenderer = innerText->renderBox()) 855 inset += innerTextRenderer->paddingLeft(); 856 } 857 return inset; 858 } 859 860 int RenderTextControlSingleLine::textBlockInsetRight() const 861 { 862 int inset = borderRight() + clientPaddingRight(); 863 if (HTMLElement* innerText = innerTextElement()) { 864 if (RenderBox* innerTextRenderer = innerText->renderBox()) 865 inset += innerTextRenderer->paddingRight(); 866 } 867 return inset; 868 } 869 870 int RenderTextControlSingleLine::textBlockInsetTop() const 871 { 872 HTMLElement* innerText = innerTextElement(); 873 if (!innerText || !innerText->renderBox()) 874 return borderTop() + paddingTop(); 875 HTMLElement* container = containerElement(); 876 if (!container) 877 return innerText->renderBox()->y(); 878 ASSERT(innerBlockElement()); 879 if (!container->renderBox() || !innerBlockElement()->renderBox()) 880 return innerText->renderBox()->y(); 881 return container->renderBox()->y() + innerBlockElement()->renderBox()->y(); 882 } 883 884 } 863 } -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h
r90791 r90971 36 36 class RenderTextControlSingleLine : public RenderTextControl, private PopupMenuClient { 37 37 public: 38 RenderTextControlSingleLine(Node* , bool);38 RenderTextControlSingleLine(Node*); 39 39 virtual ~RenderTextControlSingleLine(); 40 40 // FIXME: Move create*Style() to their classes. 41 41 virtual PassRefPtr<RenderStyle> createInnerTextStyle(const RenderStyle* startStyle) const; 42 42 PassRefPtr<RenderStyle> createInnerBlockStyle(const RenderStyle* startStyle) const; 43 44 bool placeholderIsVisible() const { return m_placeholderVisible; }45 bool placeholderShouldBeVisible() const;46 43 47 44 void addSearchResult(); … … 127 124 HTMLInputElement* inputElement() const; 128 125 129 virtual int textBlockInsetLeft() const;130 virtual int textBlockInsetRight() const;131 virtual int textBlockInsetTop() const;132 133 126 HTMLElement* containerElement() const; 134 127 HTMLElement* innerBlockElement() const; -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r88526 r90971 75 75 NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR, 76 76 // Internal IDs follow: 77 INPUT_PLACEHOLDER,78 77 SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER, 79 78 INPUT_LIST_BUTTON, VISITED_LINK, … … 81 80 FULL_SCREEN, FULL_SCREEN_DOCUMENT, FULL_SCREEN_ANCESTOR, ANIMATING_FULL_SCREEN_TRANSITION, 82 81 FIRST_PUBLIC_PSEUDOID = FIRST_LINE, 83 FIRST_INTERNAL_PSEUDOID = INPUT_PLACEHOLDER,82 FIRST_INTERNAL_PSEUDOID = SCROLLBAR_THUMB, 84 83 PUBLIC_PSEUDOID_MASK = ((1 << FIRST_INTERNAL_PSEUDOID) - 1) & ~((1 << FIRST_PUBLIC_PSEUDOID) - 1) 85 84 };
Note: See TracChangeset
for help on using the changeset viewer.