Changeset 201397 in webkit
- Timestamp:
- May 25, 2016, 12:41:34 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 11 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/forms/resources/common.js (modified) (1 diff)
-
LayoutTests/fast/forms/search-input-rtl.html (added)
-
LayoutTests/fast/forms/search-rtl.html (modified) (1 diff)
-
LayoutTests/platform/ios-simulator-wk2/fast/forms/search-rtl-expected.txt (modified) (3 diffs)
-
LayoutTests/platform/ios-simulator/fast/css/text-overflow-input-expected.txt (modified) (4 diffs)
-
LayoutTests/platform/ios-simulator/fast/forms/search-input-rtl-expected.txt (added)
-
LayoutTests/platform/mac/fast/css/text-overflow-input-expected.txt (modified) (8 diffs)
-
LayoutTests/platform/mac/fast/forms/placeholder-position-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/mac/fast/forms/search-input-rtl-expected.txt (added)
-
LayoutTests/platform/mac/fast/forms/search-rtl-expected.txt (modified) (5 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/html.css (modified) (1 diff)
-
Source/WebCore/rendering/RenderThemeMac.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r201394 r201397 1 2016-05-25 Zalan Bujtas <zalan@apple.com> 2 3 Swap search field's cancel and result button for RTL content. 4 https://bugs.webkit.org/show_bug.cgi?id=158007 5 6 Reviewed by Dean Jackson. 7 8 * fast/forms/resources/common.js: 9 (searchCancelButtonPositionRTL): 10 (searchCancelButtonPosition): 11 * fast/forms/search-input-rtl.html: Added. 12 * fast/forms/search-rtl.html: 13 * platform/ios-simulator-wk2/fast/forms/search-rtl-expected.txt: 14 * platform/ios-simulator/fast/css/text-overflow-input-expected.txt: 15 * platform/ios-simulator/fast/forms/search-input-rtl-expected.txt: Added. 16 * platform/mac/fast/css/text-overflow-input-expected.txt: 17 * platform/mac/fast/forms/placeholder-position-expected.txt: 18 * platform/mac/fast/forms/search-input-rtl-expected.png: Added. 19 * platform/mac/fast/forms/search-input-rtl-expected.txt: Added. 20 * platform/mac/fast/forms/search-rtl-expected.txt: 21 1 22 2016-05-25 Myles C. Maxfield <mmaxfield@apple.com> 2 23 -
trunk/LayoutTests/fast/forms/resources/common.js
r130293 r201397 101 101 } 102 102 103 function searchCancelButtonPosition(element) { 103 function searchCancelButtonPositionRTL(element) { 104 return searchCancelButtonPosition(element, true); 105 } 106 107 function searchCancelButtonPosition(element, isRTL = false) { 104 108 var pos = {}; 105 pos.x = element.offsetLeft + element.offsetWidth - 9;109 pos.x = element.offsetLeft + (isRTL ? 9 : (element.offsetWidth - 9)); 106 110 pos.y = element.offsetTop + element.offsetHeight / 2; 107 111 return pos; -
trunk/LayoutTests/fast/forms/search-rtl.html
r90306 r201397 23 23 if (window.eventSender) { 24 24 var target = $("target"); 25 var pos = searchCancelButtonPosition (target);25 var pos = searchCancelButtonPositionRTL(target); 26 26 eventSender.mouseMoveTo(pos.x, pos.y); 27 27 eventSender.mouseDown(); -
trunk/LayoutTests/platform/ios-simulator-wk2/fast/forms/search-rtl-expected.txt
r177430 r201397 19 19 RenderTextControl {INPUT} at (2,2) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)] 20 20 RenderFlexibleBox {DIV} at (6,2) size 123x16 21 RenderBlock {DIV} at (122,7) size 0x0 22 RenderBlock {DIV} at (0,0) size 123x15 21 23 RenderBlock {DIV} at (0,7) size 0x0 22 RenderBlock {DIV} at (0,0) size 123x1523 RenderBlock {DIV} at (122,7) size 0x024 24 RenderText {#text} at (139,0) size 5x19 25 25 text run at (139,0) width 5: " " … … 27 27 RenderTextControl {INPUT} at (2,27) size 197x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)] 28 28 RenderFlexibleBox {DIV} at (6,2) size 185x16 29 RenderBlock {DIV} at (183,7) size 0x0 30 RenderBlock {DIV} at (0,0) size 184x15 29 31 RenderBlock {DIV} at (0,7) size 0x0 30 RenderBlock {DIV} at (0,0) size 184x1531 RenderBlock {DIV} at (183,7) size 0x032 32 RenderText {#text} at (200,25) size 5x19 33 33 text run at (200,25) width 5: " " … … 35 35 RenderTextControl {INPUT} at (2,52) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)] 36 36 RenderFlexibleBox {DIV} at (6,3) size 123x15 37 RenderBlock {DIV} at (122,7) size 0x0 38 RenderBlock {DIV} at (0,0) size 123x14 37 39 RenderBlock {DIV} at (0,7) size 0x0 38 RenderBlock {DIV} at (0,0) size 123x1439 RenderBlock {DIV} at (122,7) size 0x040 40 RenderText {#text} at (0,0) size 0x0 41 41 RenderBlock {P} at (0,127) size 784x20 -
trunk/LayoutTests/platform/ios-simulator/fast/css/text-overflow-input-expected.txt
r181242 r201397 38 38 RenderTextControl {INPUT} at (145,47) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)] 39 39 RenderFlexibleBox {DIV} at (6,3) size 123x15 40 RenderBlock {DIV} at ( 0,7) size 0x041 RenderBlock {DIV} at (0,0) size 123x14 42 RenderBlock {DIV} at ( 122,7) size 0x040 RenderBlock {DIV} at (122,7) size 0x0 41 RenderBlock {DIV} at (0,0) size 123x14 42 RenderBlock {DIV} at (0,7) size 0x0 43 43 RenderText {#text} at (282,46) size 5x19 44 44 text run at (282,46) width 5: " " … … 48 48 RenderTextControl {INPUT} at (432,47) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)] 49 49 RenderFlexibleBox {DIV} at (6,3) size 123x15 50 RenderBlock {DIV} at ( 0,7) size 0x051 RenderBlock {DIV} at (0,0) size 123x14 52 RenderBlock {DIV} at ( 122,7) size 0x050 RenderBlock {DIV} at (122,7) size 0x0 51 RenderBlock {DIV} at (0,0) size 123x14 52 RenderBlock {DIV} at (0,7) size 0x0 53 53 RenderText {#text} at (569,46) size 5x19 54 54 text run at (569,46) width 5: " " … … 86 86 RenderTextControl {INPUT} at (145,47) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)] 87 87 RenderFlexibleBox {DIV} at (6,3) size 123x15 88 RenderBlock {DIV} at ( 0,7) size 0x089 RenderBlock {DIV} at (0,0) size 123x14 90 RenderBlock {DIV} at ( 122,7) size 0x088 RenderBlock {DIV} at (122,7) size 0x0 89 RenderBlock {DIV} at (0,0) size 123x14 90 RenderBlock {DIV} at (0,7) size 0x0 91 91 RenderText {#text} at (282,46) size 5x19 92 92 text run at (282,46) width 5: " " … … 96 96 RenderTextControl {INPUT} at (432,47) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)] 97 97 RenderFlexibleBox {DIV} at (6,3) size 123x15 98 RenderBlock {DIV} at ( 0,7) size 0x099 RenderBlock {DIV} at (0,0) size 123x14 100 RenderBlock {DIV} at ( 122,7) size 0x098 RenderBlock {DIV} at (122,7) size 0x0 99 RenderBlock {DIV} at (0,0) size 123x14 100 RenderBlock {DIV} at (0,7) size 0x0 101 101 RenderText {#text} at (569,46) size 5x19 102 102 text run at (569,46) width 5: " " -
trunk/LayoutTests/platform/mac/fast/css/text-overflow-input-expected.txt
r200915 r201397 40 40 RenderTextControl {INPUT} at (146,43) size 164x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 41 41 RenderFlexibleBox {DIV} at (3,0) size 158x19 42 RenderBlock {DIV} at ( 0,0) size 8x1943 RenderBlock {DIV} at ( 8,3) size 131x1344 RenderBlock {DIV} at ( 138,0) size 20x1942 RenderBlock {DIV} at (149,0) size 9x19 43 RenderBlock {DIV} at (19,3) size 131x13 44 RenderBlock {DIV} at (0,0) size 19x19 45 45 RenderText {#text} at (311,43) size 5x18 46 46 text run at (311,43) width 5: " " … … 50 50 RenderTextControl {INPUT} at (462,43) size 164x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 51 51 RenderFlexibleBox {DIV} at (3,0) size 158x19 52 RenderBlock {DIV} at ( 0,0) size 8x1953 RenderBlock {DIV} at ( 8,3) size 131x1354 RenderBlock {DIV} at ( 138,0) size 20x1952 RenderBlock {DIV} at (149,0) size 9x19 53 RenderBlock {DIV} at (19,3) size 131x13 54 RenderBlock {DIV} at (0,0) size 19x19 55 55 RenderText {#text} at (627,43) size 5x18 56 56 text run at (627,43) width 5: " " … … 92 92 RenderTextControl {INPUT} at (146,43) size 164x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 93 93 RenderFlexibleBox {DIV} at (3,0) size 158x19 94 RenderBlock {DIV} at ( 0,0) size 8x1995 RenderBlock {DIV} at ( 8,3) size 131x1396 RenderBlock {DIV} at ( 138,0) size 20x1994 RenderBlock {DIV} at (149,0) size 9x19 95 RenderBlock {DIV} at (19,3) size 131x13 96 RenderBlock {DIV} at (0,0) size 19x19 97 97 RenderText {#text} at (311,43) size 5x18 98 98 text run at (311,43) width 5: " " … … 102 102 RenderTextControl {INPUT} at (462,43) size 164x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 103 103 RenderFlexibleBox {DIV} at (3,0) size 158x19 104 RenderBlock {DIV} at ( 0,0) size 8x19105 RenderBlock {DIV} at ( 8,3) size 131x13106 RenderBlock {DIV} at ( 138,0) size 20x19104 RenderBlock {DIV} at (149,0) size 9x19 105 RenderBlock {DIV} at (19,3) size 131x13 106 RenderBlock {DIV} at (0,0) size 19x19 107 107 RenderText {#text} at (627,43) size 5x18 108 108 text run at (627,43) width 5: " " … … 163 163 layer at (13,96) size 130x13 164 164 RenderBlock {DIV} at (3,3) size 131x13 165 layer at (1 65,96) size 130x13 scrollX 160 scrollWidth 291166 RenderBlock {DIV} at ( 11,3) size 131x13 [color=#A9A9A9]167 RenderText {#text} at (-160,0) size 292x13 168 text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit" 169 layer at (1 65,96) size 130x13165 layer at (176,96) size 130x13 scrollX 160 scrollWidth 291 166 RenderBlock {DIV} at (22,3) size 131x13 [color=#A9A9A9] 167 RenderText {#text} at (-160,0) size 292x13 168 text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit" 169 layer at (176,96) size 130x13 170 170 RenderBlock {DIV} at (0,0) size 131x13 171 171 layer at (329,96) size 130x13 scrollX 160 scrollWidth 291 … … 173 173 RenderText {#text} at (-160,0) size 292x13 174 174 text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit" 175 layer at (4 81,96) size 130x13 scrollX 160 scrollWidth 291175 layer at (492,96) size 130x13 scrollX 160 scrollWidth 291 176 176 RenderBlock {DIV} at (0,0) size 131x13 177 177 RenderText {#text} at (-160,0) size 292x13 … … 211 211 layer at (13,176) size 130x13 212 212 RenderBlock {DIV} at (3,3) size 131x13 213 layer at (1 65,176) size 130x13 scrollX 160 scrollWidth 291214 RenderBlock {DIV} at ( 11,3) size 131x13 [color=#A9A9A9]215 RenderText {#text} at (-160,0) size 292x13 216 text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit" 217 layer at (1 65,176) size 130x13213 layer at (176,176) size 130x13 scrollX 160 scrollWidth 291 214 RenderBlock {DIV} at (22,3) size 131x13 [color=#A9A9A9] 215 RenderText {#text} at (-160,0) size 292x13 216 text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit" 217 layer at (176,176) size 130x13 218 218 RenderBlock {DIV} at (0,0) size 131x13 219 219 layer at (329,176) size 130x13 scrollX 160 scrollWidth 291 … … 221 221 RenderText {#text} at (-160,0) size 292x13 222 222 text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit" 223 layer at (4 81,176) size 130x13 scrollX 160 scrollWidth 291223 layer at (492,176) size 130x13 scrollX 160 scrollWidth 291 224 224 RenderBlock {DIV} at (0,0) size 131x13 225 225 RenderText {#text} at (-160,0) size 292x13 -
trunk/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.txt
r198497 r201397 14 14 RenderTextControl {INPUT} at (2,48) size 164x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 15 15 RenderFlexibleBox {DIV} at (3,0) size 158x19 16 RenderBlock {DIV} at ( 0,0) size 8x1917 RenderBlock {DIV} at ( 8,3) size 131x1318 RenderBlock {DIV} at ( 138,0) size 20x1916 RenderBlock {DIV} at (149,0) size 9x19 17 RenderBlock {DIV} at (19,3) size 131x13 18 RenderBlock {DIV} at (0,0) size 19x19 19 19 RenderBR {BR} at (167,62) size 1x0 20 20 RenderTextControl {INPUT} at (2,71) size 178x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] … … 60 60 layer at (13,36) size 130x13 61 61 RenderBlock {DIV} at (3,3) size 131x13 62 layer at ( 21,59) size 130x1363 RenderBlock {DIV} at ( 11,3) size 131x13 [color=#A9A9A9]62 layer at (32,59) size 130x13 63 RenderBlock {DIV} at (22,3) size 131x13 [color=#A9A9A9] 64 64 RenderText {#text} at (68,0) size 63x13 65 65 text run at (68,0) width 63: "placeholder" 66 layer at ( 21,59) size 130x1366 layer at (32,59) size 130x13 67 67 RenderBlock {DIV} at (0,0) size 131x13 68 68 layer at (35,82) size 130x13 -
trunk/LayoutTests/platform/mac/fast/forms/search-rtl-expected.txt
r198497 r201397 19 19 RenderTextControl {INPUT} at (2,2) size 178x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 20 20 RenderFlexibleBox {DIV} at (3,0) size 172x19 21 RenderBlock {DIV} at ( 0,0) size 22x1922 RenderBlock {DIV} at ( 22,3) size 131x1323 RenderBlock {DIV} at ( 152,0) size 20x1921 RenderBlock {DIV} at (149,0) size 23x19 22 RenderBlock {DIV} at (19,3) size 131x13 23 RenderBlock {DIV} at (0,0) size 19x19 24 24 RenderText {#text} at (181,2) size 5x18 25 25 text run at (181,2) width 5: " " … … 27 27 RenderTextControl {INPUT} at (2,25) size 243x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 28 28 RenderFlexibleBox {DIV} at (3,0) size 237x19 29 RenderBlock {DIV} at ( 0,0) size 22x1930 RenderBlock {DIV} at ( 22,3) size 196x1331 RenderBlock {DIV} at ( 217,0) size 20x1929 RenderBlock {DIV} at (214,0) size 23x19 30 RenderBlock {DIV} at (19,3) size 196x13 31 RenderBlock {DIV} at (0,0) size 19x19 32 32 RenderText {#text} at (246,25) size 5x18 33 33 text run at (246,25) width 5: " " … … 35 35 RenderTextControl {INPUT} at (2,48) size 178x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 36 36 RenderFlexibleBox {DIV} at (3,0) size 172x19 37 RenderBlock {DIV} at ( 0,0) size 22x1938 RenderBlock {DIV} at ( 22,3) size 131x1339 RenderBlock {DIV} at ( 152,0) size 20x1937 RenderBlock {DIV} at (149,0) size 23x19 38 RenderBlock {DIV} at (19,3) size 131x13 39 RenderBlock {DIV} at (0,0) size 19x19 40 40 RenderText {#text} at (0,0) size 0x0 41 41 RenderBlock {P} at (0,119) size 784x18 42 42 RenderText {#text} at (0,0) size 37x18 43 43 text run at (0,0) width 37: "PASS" 44 layer at (3 5,47) size 130x13 scrollX 3 scrollWidth 13444 layer at (32,47) size 130x13 scrollX 3 scrollWidth 134 45 45 RenderBlock {DIV} at (0,0) size 131x13 46 46 RenderText {#text} at (-3,0) size 135x13 … … 50 50 text run at (80,0) width 14: "he" 51 51 text run at (93,0) width 38 RTL: "\x{5D4}\x{5D5}\x{5D0} \x{5D6}\x{5D4} " 52 layer at (3 5,70) size 196x1352 layer at (32,70) size 196x13 53 53 RenderBlock {DIV} at (0,0) size 196x13 54 54 RenderText {#text} at (61,0) size 135x13 … … 58 58 text run at (145,0) width 14: "he" 59 59 text run at (158,0) width 38 RTL: "\x{5D4}\x{5D5}\x{5D0} \x{5D6}\x{5D4} " 60 layer at (3 5,93) size 130x1360 layer at (32,93) size 130x13 61 61 RenderBlock {DIV} at (0,0) size 131x13 62 62 caret: position 0 of child 0 {DIV} of child 1 {DIV} of child 0 {DIV} of {#document-fragment} of child 9 {INPUT} of child 3 {P} of body -
trunk/Source/WebCore/ChangeLog
r201394 r201397 1 2016-05-25 Zalan Bujtas <zalan@apple.com> 2 3 Swap search field's cancel and result button for RTL content. 4 https://bugs.webkit.org/show_bug.cgi?id=158007 5 6 Reviewed by Dean Jackson. 7 8 Test: fast/forms/search-input-rtl.html 9 10 * css/html.css: 11 (input[type="search"]::-webkit-textfield-decoration-container): Deleted. 12 * rendering/RenderThemeMac.mm: 13 (WebCore::RenderThemeMac::paintSearchFieldCancelButton): 14 (WebCore::RenderThemeMac::paintSearchFieldResultsButton): 15 1 16 2016-05-25 Myles C. Maxfield <mmaxfield@apple.com> 2 17 -
trunk/Source/WebCore/css/html.css
r200075 r201397 412 412 } 413 413 414 input[type="search"]::-webkit-textfield-decoration-container {415 direction: ltr;416 }417 418 414 input::-webkit-clear-button { 419 415 -webkit-appearance: searchfield-cancel-button; -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r200596 r201397 1740 1740 1741 1741 FloatRect localBounds = adjustedCancelButtonRect([search cancelButtonRectForBounds:NSRect(snappedIntRect(inputBox.contentBoxRect()))]); 1742 // Adjust position based on the content direction. 1743 float adjustedXPosition; 1744 if (box.style().direction() == RTL) 1745 adjustedXPosition = inputBox.contentBoxRect().x(); 1746 else 1747 adjustedXPosition = inputBox.contentBoxRect().maxX() - localBounds.size().width(); 1748 1749 localBounds.setX(adjustedXPosition); 1742 1750 FloatPoint paintingPos = convertToPaintingPosition(inputBox, box, localBounds.location(), r.location()); 1743 1751 … … 1869 1877 1870 1878 FloatRect localBounds = adjustedResultButtonRect([search searchButtonRectForBounds:NSRect(snappedIntRect(inputBox.contentBoxRect()))]); 1879 // Adjust position based on the content direction. 1880 float adjustedXPosition; 1881 if (box.style().direction() == RTL) 1882 adjustedXPosition = inputBox.contentBoxRect().maxX() - localBounds.size().width(); 1883 else 1884 adjustedXPosition = inputBox.contentBoxRect().x(); 1885 localBounds.setX(adjustedXPosition); 1871 1886 FloatPoint paintingPos = convertToPaintingPosition(inputBox, box, localBounds.location(), r.location()); 1872 1887
Note:
See TracChangeset
for help on using the changeset viewer.