Changeset 88757 in webkit
- Timestamp:
- Jun 13, 2011 8:46:30 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 46 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r88752 r88757 1 2011-06-10 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 Use CSS machinery to position slider thumb. 6 https://bugs.webkit.org/show_bug.cgi?id=52920 7 8 Add two new tests, and update tests with sliders. 9 10 * fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt: 11 * fast/forms/input-appearance-range.html: Added. 12 * fast/forms/slider-thumb-stylability.html: Remove text. 13 * fast/forms/validation-message-on-range-expected.txt: Added. 14 * fast/forms/validation-message-on-range.html: Added. 15 * fast/multicol/client-rects-expected.txt: 16 * fast/repaint/slider-thumb-float-expected.txt: 17 * media/audio-repaint-expected.txt: 18 * media/controls-without-preload-expected.txt: 19 * media/media-document-audio-repaint-expected.txt: 20 * platform/chromium/test_expectations.txt: 21 * platform/gtk/Skipped: Skip validaiton-message-on-range.html because 22 this platform doesn't support the interactive validation. 23 * platform/mac-wk2/Skipped: Skip validaiton-message-on-range.html. 24 * platform/mac/fast/dom/HTMLInputElement/input-slider-update-expected.png: 25 * platform/mac/fast/dom/HTMLInputElement/input-slider-update-expected.txt: 26 * platform/mac/fast/forms/box-shadow-override-expected.png: 27 * platform/mac/fast/forms/box-shadow-override-expected.txt: 28 * platform/mac/fast/forms/input-appearance-height-expected.png: 29 * platform/mac/fast/forms/input-appearance-height-expected.txt: 30 * platform/mac/fast/forms/input-appearance-range-expected.png: Added. 31 * platform/mac/fast/forms/input-appearance-range-expected.txt: Added. 32 * platform/mac/fast/forms/range-thumb-height-percentage-expected.txt: 33 * platform/mac/fast/forms/slider-padding-expected.png: 34 * platform/mac/fast/forms/slider-padding-expected.txt: 35 * platform/mac/fast/forms/slider-thumb-shared-style-expected.png: 36 * platform/mac/fast/forms/slider-thumb-shared-style-expected.txt: 37 * platform/mac/fast/forms/slider-thumb-stylability-expected.png: 38 * platform/mac/fast/forms/slider-thumb-stylability-expected.txt: 39 * platform/mac/fast/forms/thumbslider-no-parent-slider-expected.png: 40 * platform/mac/fast/forms/thumbslider-no-parent-slider-expected.txt: 41 * platform/mac/fast/repaint/slider-thumb-drag-release-expected.png: 42 * platform/mac/fast/repaint/slider-thumb-drag-release-expected.txt: 43 * platform/mac/media/audio-controls-rendering-expected.png: 44 * platform/mac/media/audio-controls-rendering-expected.txt: 45 * platform/mac/media/controls-after-reload-expected.png: 46 * platform/mac/media/controls-after-reload-expected.txt: 47 * platform/mac/media/controls-styling-expected.png: 48 * platform/mac/media/controls-styling-expected.txt: 49 * platform/qt/Skipped: Skip validaiton-message-on-range.html. 50 * platform/win/Skipped: Skip validaiton-message-on-range.html. 51 1 52 2011-06-13 Ryosuke Niwa <rniwa@webkit.org> 2 53 -
trunk/LayoutTests/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt
r81216 r88757 5 5 RenderBody {BODY} at (8,8) size 784x584 6 6 RenderSlider {INPUT} at (2,2) size 100x10 [bgcolor=#FF0000] 7 RenderBlock {DIV} at (90,0) size 10x10 [bgcolor=#008000] 7 RenderFlexibleBox {DIV} at (0,0) size 100x10 8 RenderBlock {DIV} at (0,0) size 90x10 9 RenderBlock {DIV} at (90,0) size 10x10 [bgcolor=#008000] 8 10 RenderText {#text} at (0,0) size 0x0 11 layer at (100,10) size 10x10 12 RenderBlock (relative positioned) {DIV} at (0,0) size 10x10 [bgcolor=#008000] -
trunk/LayoutTests/fast/forms/slider-thumb-stylability.html
r21789 r88757 11 11 </head> 12 12 <body> 13 <p> 14 This tests styling of the slider thumb. 15 </p> 16 <p> 17 You should see a green 20×20px square. 18 </p> 19 <input type="range" value="0" style="-webkit-appearance: none;"> 13 <!-- 14 This tests styling of the slider thumb. 15 You should see a green 20x20px square. 16 --> 17 <input type="range" value="0" style="-webkit-appearance: none;"> 20 18 </body> 21 19 </html> -
trunk/LayoutTests/fast/multicol/client-rects-expected.txt
r67660 r88757 62 62 RenderBR {BR} at (0,0) size 0x25 63 63 RenderSlider {INPUT} at (2,27) size 25x25 [color=#000000] [bgcolor=#ADD8E6] 64 RenderBlock {DIV} at (12,12) size 0x0 64 RenderFlexibleBox {DIV} at (0,0) size 25x25 65 RenderBlock {DIV} at (0,12) size 25x0 66 RenderBlock {DIV} at (25,12) size 0x0 65 67 layer at (8,483) size 136x76 66 68 RenderBlock {DIV} at (0,475) size 136x76 [color=#ADD8E6] [border: (3px solid #000000)] -
trunk/LayoutTests/fast/repaint/slider-thumb-float-expected.txt
r81285 r88757 5 5 RenderBody {BODY} at (8,8) size 784x584 6 6 RenderSlider {INPUT} at (2,2) size 100x10 [bgcolor=#FF0000] 7 RenderBlock {DIV} at (90,0) size 10x10 [bgcolor=#008000] 7 RenderFlexibleBox {DIV} at (0,0) size 100x10 8 RenderBlock {DIV} at (0,0) size 90x10 9 RenderBlock {DIV} at (90,0) size 10x10 [bgcolor=#008000] 10 layer at (100,10) size 10x10 11 RenderBlock (relative positioned) {DIV} at (0,0) size 10x10 [bgcolor=#008000] -
trunk/LayoutTests/media/audio-repaint-expected.txt
r80857 r88757 23 23 RenderFlexibleBox {DIV} at (49,5) size 126x15 24 24 RenderSlider {INPUT} at (0,2) size 126x13 25 RenderBlock {DIV} at (58,2) size 10x8 25 RenderFlexibleBox {DIV} at (0,0) size 126x13 26 RenderBlock {DIV} at (0,2) size 116x8 27 RenderBlock {DIV} at (116,2) size 10x8 26 28 RenderButton {INPUT} at (177,6) size 14x12 29 layer at (115,76) size 10x8 30 RenderBlock (relative positioned) {DIV} at (0,0) size 10x8 27 31 layer at (8,42) size 200x25 28 32 RenderBlock (relative positioned) {DIV} at (0,0) size 200x25 … … 33 37 RenderFlexibleBox {DIV} at (49,5) size 126x15 34 38 RenderSlider {INPUT} at (0,2) size 126x13 35 RenderBlock {DIV} at (58,2) size 10x8 39 RenderFlexibleBox {DIV} at (0,0) size 126x13 40 RenderBlock {DIV} at (0,2) size 116x8 41 RenderBlock {DIV} at (116,2) size 10x8 36 42 RenderButton {INPUT} at (177,6) size 14x12 43 layer at (115,51) size 10x8 44 RenderBlock (relative positioned) {DIV} at (0,0) size 10x8 37 45 layer at (8,144) size 200x25 38 46 RenderMedia {AUDIO} at (0,102) size 200x25 … … 45 53 RenderFlexibleBox {DIV} at (49,5) size 126x15 46 54 RenderSlider {INPUT} at (0,2) size 126x13 47 RenderBlock {DIV} at (58,2) size 10x8 55 RenderFlexibleBox {DIV} at (0,0) size 126x13 56 RenderBlock {DIV} at (0,2) size 116x8 57 RenderBlock {DIV} at (116,2) size 10x8 48 58 RenderButton {INPUT} at (177,6) size 14x12 59 layer at (115,153) size 10x8 60 RenderBlock (relative positioned) {DIV} at (0,0) size 10x8 -
trunk/LayoutTests/media/controls-without-preload-expected.txt
r79027 r88757 19 19 RenderFlexibleBox {DIV} at (49,5) size 216x15 20 20 RenderSlider {INPUT} at (45,2) size 126x13 21 RenderBlock {DIV} at (0,2) size 10x8 21 RenderFlexibleBox {DIV} at (0,0) size 126x13 22 RenderBlock {DIV} at (0,2) size 116x8 23 RenderBlock {DIV} at (116,2) size 10x8 22 24 RenderButton {INPUT} at (297,4) size 16x16 23 25 RenderButton {INPUT} at (267,6) size 14x12 … … 32 34 RenderText {#text} at (0,0) size 31x11 33 35 text run at (0,0) width 31: "-00:06" 36 layer at (102,266) size 10x8 37 RenderBlock (relative positioned) {DIV} at (0,0) size 10x8 -
trunk/LayoutTests/media/media-document-audio-repaint-expected.txt
r83939 r88757 28 28 RenderFlexibleBox {DIV} at (49,5) size 226x15 29 29 RenderSlider {INPUT} at (45,2) size 136x13 30 RenderBlock {DIV} at (63,2) size 10x8 30 RenderFlexibleBox {DIV} at (0,0) size 136x13 31 RenderBlock {DIV} at (0,2) size 126x8 32 RenderBlock {DIV} at (126,2) size 10x8 31 33 RenderButton {INPUT} at (277,6) size 14x12 32 34 layer at (89,147) size 45x11 … … 40 42 RenderText {#text} at (0,0) size 31x11 41 43 text run at (0,0) width 31: "-00:00" 44 layer at (197,149) size 10x8 45 RenderBlock (relative positioned) {DIV} at (0,0) size 10x8 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r88748 r88757 3950 3950 BUGABARTH LINUX : svg/text/scaling-font-with-geometric-precision.html = IMAGE PASS 3951 3951 3952 // Need rebaseline for all of rendering tests with <input type=range> including media controls. 3953 BUGWK52920 : fast/dom/HTMLInputElement/input-slider-update.html = FAIL 3954 BUGWK52920 LINUX WIN : fast/forms/box-shadow-override.html = FAIL 3955 BUGWK52920 LINUX WIN : fast/forms/input-appearance-height.html = FAIL 3956 BUGWK52920 : fast/forms/input-appearance-range.html = FAIL 3957 BUGWK52920 : fast/forms/range-thumb-height-percentage.html = FAIL 3958 BUGWK52920 : fast/forms/slider-delete-while-dragging-thumb.html = FAIL 3959 BUGWK52920 : fast/forms/slider-mouse-events.html = FAIL 3960 BUGWK52920 : fast/forms/slider-onchange-event.html = FAIL 3961 BUGWK52920 : fast/forms/slider-padding.html = FAIL 3962 BUGWK52920 : fast/forms/slider-thumb-shared-style.html = FAIL 3963 BUGWK52920 : fast/forms/slider-thumb-stylability.html = FAIL 3964 BUGWK52920 : fast/forms/thumbslider-no-parent-slider.html = FAIL 3965 BUGWK52920 : fast/layers/video-layer.html = FAIL 3966 BUGWK52920 : fast/multicol/client-rects.html = FAIL 3967 BUGWK52920 : fast/repaint/slider-thumb-drag-release.html = FAIL 3968 BUGWK52920 : media/audio-controls-rendering.html = FAIL 3969 BUGWK52920 : media/audio-repaint.html = FAIL 3970 BUGWK52920 : media/controls-after-reload.html = FAIL 3971 BUGWK52920 : media/controls-strict.html = FAIL 3972 BUGWK52920 : media/controls-styling.html = FAIL 3973 BUGWK52920 : media/controls-without-preload.html = FAIL 3974 BUGWK52920 : media/video-controls-rendering.html = FAIL 3975 BUGWK52920 : media/video-display-toggle.html = FAIL 3976 BUGWK52920 : media/video-empty-source.html = FAIL 3977 BUGWK52920 : media/video-no-audio.html = FAIL 3978 BUGWK52920 : media/video-volume-slider.html = FAIL 3979 BUGWK52920 : media/video-zoom-controls.html = FAIL 3952 3980 3953 3981 BUGCR84157 GPU : plugins/embed-attributes-style.html = IMAGE+TEXT -
trunk/LayoutTests/platform/gtk/Skipped
r88742 r88757 1241 1241 fast/forms/validation-message-on-menulist.html 1242 1242 fast/forms/validation-message-on-radio.html 1243 fast/forms/validation-message-on-range.html 1243 1244 fast/forms/validation-message-on-textarea.html 1244 1245 -
trunk/LayoutTests/platform/mac-wk2/Skipped
r88663 r88757 1519 1519 fast/forms/validation-message-on-menulist.html 1520 1520 fast/forms/validation-message-on-radio.html 1521 fast/forms/validation-message-on-range.html 1521 1522 fast/forms/validation-message-on-textarea.html 1522 1523 -
trunk/LayoutTests/platform/mac/fast/dom/HTMLInputElement/input-slider-update-expected.txt
r77500 r88757 5 5 RenderBody {BODY} at (8,8) size 784x584 6 6 RenderSlider {INPUT} at (2,2) size 129x15 [bgcolor=#FFFFFF] 7 RenderBlock {DIV} at (114,0) size 15x15 7 RenderFlexibleBox {DIV} at (0,0) size 129x15 8 RenderBlock {DIV} at (0,0) size 114x15 9 RenderBlock {DIV} at (114,0) size 15x15 8 10 RenderText {#text} at (0,0) size 0x0 11 layer at (124,10) size 15x15 12 RenderBlock (relative positioned) {DIV} at (0,0) size 15x15 -
trunk/LayoutTests/platform/mac/fast/forms/box-shadow-override-expected.txt
r80755 r88757 36 36 text run at (36,9) width 4: " " 37 37 RenderSlider {INPUT} at (42,8) size 129x15 [bgcolor=#FFFFFF] 38 RenderBlock {DIV} at (57,0) size 15x15 38 RenderFlexibleBox {DIV} at (0,0) size 129x15 39 RenderBlock {DIV} at (0,0) size 114x15 40 RenderBlock {DIV} at (114,0) size 15x15 39 41 RenderText {#text} at (173,9) size 4x18 40 42 text run at (173,9) width 4: " " … … 77 79 layer at (35,127) size 84x13 78 80 RenderBlock {DIV} at (22,0) size 84x13 81 layer at (107,153) size 15x15 82 RenderBlock (relative positioned) {DIV} at (0,0) size 15x15 -
trunk/LayoutTests/platform/mac/fast/forms/input-appearance-height-expected.txt
r80755 r88757 51 51 text run at (0,127) width 39: "range " 52 52 RenderSlider {INPUT} at (41,126) size 129x15 [bgcolor=#FFFFFF] 53 RenderBlock {DIV} at (57,0) size 15x15 53 RenderFlexibleBox {DIV} at (0,0) size 129x15 54 RenderBlock {DIV} at (0,0) size 114x15 55 RenderBlock {DIV} at (114,0) size 15x15 54 56 RenderText {#text} at (172,127) size 4x18 55 57 text run at (172,127) width 4: " " … … 102 104 layer at (65,266) size 98x13 103 105 RenderBlock {DIV} at (8,0) size 98x13 106 layer at (106,152) size 15x15 107 RenderBlock (relative positioned) {DIV} at (0,0) size 15x15 -
trunk/LayoutTests/platform/mac/fast/forms/range-thumb-height-percentage-expected.txt
r42080 r88757 9 9 RenderBlock (anonymous) at (0,34) size 784x24 10 10 RenderSlider {INPUT} at (2,2) size 200x20 [bgcolor=#C0C0C0] 11 RenderBlock {DIV} at (95,5) size 10x10 [bgcolor=#008000] 11 RenderFlexibleBox {DIV} at (0,0) size 200x20 12 RenderBlock {DIV} at (0,5) size 190x10 13 RenderBlock {DIV} at (190,5) size 10x10 [bgcolor=#008000] 12 14 RenderText {#text} at (0,0) size 0x0 15 layer at (105,49) size 10x10 16 RenderBlock (relative positioned) {DIV} at (0,0) size 10x10 [bgcolor=#008000] -
trunk/LayoutTests/platform/mac/fast/forms/slider-padding-expected.txt
r41972 r88757 10 10 RenderBlock {DIV} at (0,18) size 784x39 [bgcolor=#ADD8E6] 11 11 RenderSlider {INPUT} at (2,2) size 100x35 [bgcolor=#FFFFFF] 12 RenderBlock {DIV} at (10,10) size 15x15 12 RenderFlexibleBox {DIV} at (10,10) size 80x15 13 RenderBlock {DIV} at (0,0) size 65x15 14 RenderBlock {DIV} at (65,0) size 15x15 13 15 RenderText {#text} at (0,0) size 0x0 14 16 RenderBlock {PRE} at (0,70) size 784x0 17 layer at (20,38) size 15x15 18 RenderBlock (relative positioned) {DIV} at (0,0) size 15x15 -
trunk/LayoutTests/platform/mac/fast/forms/slider-thumb-shared-style-expected.txt
r41972 r88757 21 21 RenderBlock {DIV} at (0,68) size 784x38 22 22 RenderSlider {INPUT} at (2,2) size 129x15 [bgcolor=#FFFFFF] 23 RenderBlock {DIV} at (0,0) size 15x15 23 RenderFlexibleBox {DIV} at (0,0) size 129x15 24 RenderBlock {DIV} at (0,0) size 114x15 25 RenderBlock {DIV} at (114,0) size 15x15 24 26 RenderBR {BR} at (133,17) size 0x0 25 27 RenderSlider {INPUT} at (2,21) size 129x15 [bgcolor=#FFFFFF] 26 RenderBlock {DIV} at (114,0) size 15x15 28 RenderFlexibleBox {DIV} at (0,0) size 129x15 29 RenderBlock {DIV} at (0,0) size 114x15 30 RenderBlock {DIV} at (114,0) size 15x15 27 31 RenderText {#text} at (0,0) size 0x0 32 layer at (10,78) size 15x15 33 RenderBlock (relative positioned) {DIV} at (0,0) size 15x15 34 layer at (124,97) size 15x15 35 RenderBlock (relative positioned) {DIV} at (0,0) size 15x15 -
trunk/LayoutTests/platform/mac/fast/forms/slider-thumb-stylability-expected.txt
r63403 r88757 4 4 RenderBlock {HTML} at (0,0) size 800x600 5 5 RenderBody {BODY} at (8,8) size 784x584 6 RenderBlock {P} at (0,0) size 784x18 7 RenderText {#text} at (0,0) size 231x18 8 text run at (0,0) width 231: "This tests styling of the slider thumb." 9 RenderBlock {P} at (0,34) size 784x18 10 RenderText {#text} at (0,0) size 258x18 11 text run at (0,0) width 258: "You should see a green 20\x{D7}20px square." 12 RenderBlock (anonymous) at (0,68) size 784x24 13 RenderSlider {INPUT} at (2,2) size 129x20 [bgcolor=#FFFFFF] 14 RenderBlock {DIV} at (0,0) size 20x20 [bgcolor=#008000] 15 RenderText {#text} at (0,0) size 0x0 6 RenderSlider {INPUT} at (2,2) size 129x20 [bgcolor=#FFFFFF] 7 RenderFlexibleBox {DIV} at (0,0) size 129x20 8 RenderBlock {DIV} at (0,0) size 109x20 9 RenderBlock {DIV} at (109,0) size 20x20 [bgcolor=#008000] 10 RenderText {#text} at (0,0) size 0x0 11 layer at (10,10) size 20x20 12 RenderBlock (relative positioned) {DIV} at (0,0) size 20x20 [bgcolor=#008000] -
trunk/LayoutTests/platform/mac/fast/forms/thumbslider-no-parent-slider-expected.txt
r88415 r88757 4 4 RenderBlock {HTML} at (0,0) size 800x600 5 5 RenderBody {BODY} at (8,8) size 784x584 6 RenderBlock {SPAN} at (0,0) size 20x207 RenderBR {BR} at ( 20,20) size 0x08 RenderBlock {SPAN} at (0, 20) size 20x206 RenderBlock {SPAN} at (0,0) size 15x15 7 RenderBR {BR} at (15,15) size 0x0 8 RenderBlock {SPAN} at (0,15) size 15x15 9 9 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.txt
r77644 r88757 5 5 RenderBody {BODY} at (8,8) size 784x584 6 6 RenderSlider {INPUT} at (2,2) size 129x15 [bgcolor=#FFFFFF] 7 RenderBlock {DIV} at (114,0) size 15x15 7 RenderFlexibleBox {DIV} at (0,0) size 129x15 8 RenderBlock {DIV} at (0,0) size 114x15 9 RenderBlock {DIV} at (114,0) size 15x15 8 10 RenderText {#text} at (0,0) size 0x0 11 layer at (124,10) size 15x15 12 RenderBlock (relative positioned) {DIV} at (0,0) size 15x15 -
trunk/LayoutTests/platform/mac/media/audio-controls-rendering-expected.txt
r80857 r88757 23 23 RenderFlexibleBox {DIV} at (49,5) size 126x15 24 24 RenderSlider {INPUT} at (0,2) size 126x13 25 RenderBlock {DIV} at (0,2) size 10x8 25 RenderFlexibleBox {DIV} at (0,0) size 126x13 26 RenderBlock {DIV} at (0,2) size 116x8 27 RenderBlock {DIV} at (116,2) size 10x8 26 28 RenderButton {INPUT} at (177,6) size 14x12 29 layer at (57,51) size 10x8 30 RenderBlock (relative positioned) {DIV} at (0,0) size 10x8 27 31 layer at (8,85) size 320x25 28 32 RenderBlock (relative positioned) {DIV} at (0,0) size 320x25 … … 33 37 RenderFlexibleBox {DIV} at (49,5) size 246x15 34 38 RenderSlider {INPUT} at (45,2) size 156x13 35 RenderBlock {DIV} at (0,2) size 10x8 39 RenderFlexibleBox {DIV} at (0,0) size 156x13 40 RenderBlock {DIV} at (0,2) size 146x8 41 RenderBlock {DIV} at (146,2) size 10x8 36 42 RenderButton {INPUT} at (297,6) size 14x12 37 43 layer at (57,92) size 45x11 … … 45 51 RenderText {#text} at (0,0) size 31x11 46 52 text run at (0,0) width 31: "-00:07" 53 layer at (102,94) size 10x8 54 RenderBlock (relative positioned) {DIV} at (0,0) size 10x8 47 55 layer at (8,128) size 320x100 48 56 RenderMedia {AUDIO} at (8,128) size 320x100 [bgcolor=#0000FF] … … 55 63 RenderFlexibleBox {DIV} at (49,5) size 246x15 56 64 RenderSlider {INPUT} at (45,2) size 156x13 57 RenderBlock {DIV} at (0,2) size 10x8 65 RenderFlexibleBox {DIV} at (0,0) size 156x13 66 RenderBlock {DIV} at (0,2) size 146x8 67 RenderBlock {DIV} at (146,2) size 10x8 58 68 RenderButton {INPUT} at (297,6) size 14x12 59 69 layer at (57,210) size 45x11 … … 67 77 RenderText {#text} at (0,0) size 31x11 68 78 text run at (0,0) width 31: "-00:07" 79 layer at (102,212) size 10x8 80 RenderBlock (relative positioned) {DIV} at (0,0) size 10x8 -
trunk/LayoutTests/platform/mac/media/controls-after-reload-expected.txt
r78910 r88757 19 19 RenderFlexibleBox {DIV} at (49,5) size 216x15 20 20 RenderSlider {INPUT} at (45,2) size 126x13 21 RenderBlock {DIV} at (0,2) size 10x8 21 RenderFlexibleBox {DIV} at (0,0) size 126x13 22 RenderBlock {DIV} at (0,2) size 116x8 23 RenderBlock {DIV} at (116,2) size 10x8 22 24 RenderButton {INPUT} at (297,4) size 16x16 23 25 RenderButton {INPUT} at (267,6) size 14x12 … … 32 34 RenderText {#text} at (0,0) size 31x11 33 35 text run at (0,0) width 31: "-00:06" 36 layer at (102,266) size 10x8 37 RenderBlock (relative positioned) {DIV} at (0,0) size 10x8 -
trunk/LayoutTests/platform/mac/media/controls-styling-expected.txt
r78910 r88757 23 23 RenderFlexibleBox {DIV} at (49,5) size 216x15 24 24 RenderSlider {INPUT} at (45,2) size 126x13 25 RenderBlock {DIV} at (0,2) size 10x8 25 RenderFlexibleBox {DIV} at (0,0) size 126x13 26 RenderBlock {DIV} at (0,2) size 116x8 27 RenderBlock {DIV} at (116,2) size 10x8 26 28 RenderButton {INPUT} at (297,4) size 16x16 27 29 RenderButton {INPUT} at (267,6) size 14x12 … … 36 38 RenderText {#text} at (0,0) size 31x11 37 39 text run at (0,0) width 31: "-00:06" 40 layer at (112,266) size 10x8 41 RenderBlock (relative positioned) {DIV} at (0,0) size 10x8 38 42 layer at (8,282) size 320x240 39 43 RenderBlock (relative positioned) {DIV} at (0,0) size 320x240 … … 44 48 RenderFlexibleBox {DIV} at (49,5) size 216x15 45 49 RenderSlider {INPUT} at (45,2) size 126x13 46 RenderBlock {DIV} at (0,2) size 10x8 50 RenderFlexibleBox {DIV} at (0,0) size 126x13 51 RenderBlock {DIV} at (0,2) size 116x8 52 RenderBlock {DIV} at (116,2) size 10x8 47 53 RenderButton {INPUT} at (297,4) size 16x16 48 54 RenderButton {INPUT} at (267,6) size 14x12 … … 57 63 RenderText {#text} at (0,0) size 31x11 58 64 text run at (0,0) width 31: "-00:06" 65 layer at (102,506) size 10x8 66 RenderBlock (relative positioned) {DIV} at (0,0) size 10x8 -
trunk/LayoutTests/platform/qt/Skipped
r88673 r88757 2011 2011 fast/forms/validation-message-on-menulist.html 2012 2012 fast/forms/validation-message-on-radio.html 2013 fast/forms/validation-message-on-range.html 2013 2014 fast/forms/validation-message-on-textarea.html 2014 2015 -
trunk/LayoutTests/platform/win/Skipped
r88694 r88757 1109 1109 fast/forms/validation-message-on-menulist.html 1110 1110 fast/forms/validation-message-on-radio.html 1111 fast/forms/validation-message-on-range.html 1111 1112 fast/forms/validation-message-on-textarea.html 1112 1113 -
trunk/Source/WebCore/ChangeLog
r88754 r88757 1 2011-06-10 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 Use CSS machinery to position slider thumb. 6 https://bugs.webkit.org/show_bug.cgi?id=52920 7 8 Remove RenderSlider::layout(). 9 In order to remove it, we introduce new three shadow nodes: 10 - A flex box container occupying the whole box 11 - A flex box item representing a movable area of the thumb 12 - A flex box item limiting the movable area of the thumb 13 The thumb position is specified by percentage position in the second element. 14 15 This change also fixes Bug 60353. 16 17 Tests: fast/forms/input-appearance-range.html 18 fast/forms/validation-message-on-range.html 19 20 * accessibility/AccessibilitySlider.cpp: 21 (WebCore::AccessibilitySliderThumb::elementRect): 22 Use Node::getRect() for the thumb element. 23 * css/html.css: Add new style definitions for the new node layout. 24 (input[type="range"]::-webkit-slider-container): 25 (input[type="range"]::-webkit-slider-runnable-track): 26 (input[type="range"]::-webkit-slider-thumb): 27 * html/RangeInputType.cpp: 28 (WebCore::RangeInputType::handleMouseDownEvent): 29 Accepts events on shadow nodes, use sliderThumbElementOf(). 30 (WebCore::RangeInputType::createShadowSubtree): 31 Creates new nodes layout. 32 (WebCore::RangeInputType::valueChanged): Use sliderThumbElementOf(). 33 * html/RangeInputType.h: Remove shadowSliderThumb(). 34 * html/shadow/SliderThumbElement.cpp: 35 (WebCore::sliderPosition): Moved from RenderSlider.cpp. 36 (WebCore::hasVerticalAppearance): New utility function. 37 (WebCore::sliderThumbElementOf): New utility function. 38 (WebCore::RenderSliderThumb::layout): 39 Sets CSS top/left values. 40 (WebCore::RenderSliderContainer::RenderSliderContainer): 41 (WebCore::RenderSliderContainer::layout): 42 Add some adjustment code. 43 - Setting box-orient 44 - Adjust heights of some nodes. It is required to pass existing tests. 45 (WebCore::SliderThumbElement::setPositionFromValue): 46 Update comments. 47 (WebCore::SliderThumbElement::setPositionFromPoint): 48 Calculate the current position from absolute positions. 49 (WebCore::SliderThumbElement::hostInput): 50 Removed unnecessary variable. 51 (WebCore::TrackLimiterElement::TrackLimiterElement): 52 (WebCore::TrackLimiterElement::create): Adjust style. 53 (WebCore::TrackLimiterElement::createRenderer): 54 This node uses RenderSliderThumb. 55 (WebCore::TrackLimiterElement::shadowPseudoId): 56 This node also uses -webkit-slider-thumb. 57 (WebCore::SliderContainerElement::SliderContainerElement): 58 (WebCore::SliderContainerElement::create): 59 (WebCore::SliderContainerElement::createRenderer): 60 Uses RenderSliderContainer. 61 (WebCore::SliderContainerElement::shadowPseudoId): 62 * html/shadow/SliderThumbElement.h: 63 Make hostInput() public, add declarations of TrackLimiterElement 64 and SliderContainerElement. 65 * rendering/RenderSlider.cpp: 66 (WebCore::RenderSlider::RenderSlider): Added an assertion. 67 (WebCore::RenderSlider::inDragMode): Uses sliderThumbElementOf(). 68 * rendering/RenderSlider.h: Remove declarations of removed functions. 69 * rendering/RenderTheme.cpp: 70 (WebCore::RenderTheme::adjustSliderThumbStyle): 71 Calls adjustSliderThumbSize(). 72 1 73 2011-06-13 Joone Hur <joone.hur@collabora.co.uk> 2 74 -
trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp
r83479 r88757 35 35 #include "RenderObject.h" 36 36 #include "RenderSlider.h" 37 #include "SliderThumbElement.h" 37 38 38 39 namespace WebCore { … … 176 177 IntRect AccessibilitySliderThumb::elementRect() const 177 178 { 178 if (!m_parentSlider->renderer()) 179 RenderObject* sliderRenderer = m_parentSlider->renderer(); 180 if (!sliderRenderer || !sliderRenderer->isSlider()) 179 181 return IntRect(); 180 181 IntRect intRect = toRenderSlider(m_parentSlider->renderer())->thumbRect(); 182 FloatQuad floatQuad = m_parentSlider->renderer()->localToAbsoluteQuad(FloatRect(intRect)); 183 184 return floatQuad.enclosingBoundingBox(); 182 return sliderThumbElementOf(sliderRenderer->node())->getRect(); 185 183 } 186 184 -
trunk/Source/WebCore/css/html.css
r88228 r88757 547 547 } 548 548 549 input[type="range"]::-webkit-slider-container { 550 -webkit-box-align: center; 551 -webkit-box-orient: horizontal; /* This property is updated by C++ code. */ 552 -webkit-box-sizing: border-box; 553 display: -webkit-box; 554 height: 100%; 555 width: 100%; 556 } 557 558 input[type="range"]::-webkit-slider-runnable-track { 559 -webkit-box-flex: 1; 560 -webkit-box-sizing: border-box; 561 display: block; 562 } 563 549 564 input[type="range"]::-webkit-slider-thumb { 550 565 -webkit-appearance: sliderthumb-horizontal; 551 display: block; 566 -webkit-box-sizing: border-box; 567 display: block; 568 position: relative; 552 569 } 553 570 -
trunk/Source/WebCore/html/RangeInputType.cpp
r84683 r88757 33 33 #include "RangeInputType.h" 34 34 35 #include "ElementWithPseudoId.h" 35 36 #include "HTMLInputElement.h" 36 37 #include "HTMLNames.h" … … 152 153 void RangeInputType::handleMouseDownEvent(MouseEvent* event) 153 154 { 154 if (event->button() != LeftButton || event->target() != element()) 155 Node* targetNode = event->target()->toNode(); 156 if (event->button() != LeftButton || !targetNode || (targetNode != element() && !targetNode->isDescendantOf(element()->shadowRoot()))) 155 157 return; 156 158 157 if (SliderThumbElement* thumb = shadowSliderThumb())158 159 SliderThumbElement* thumb = sliderThumbElementOf(element()); 160 thumb->dragFrom(event->absoluteLocation()); 159 161 } 160 162 … … 204 206 { 205 207 ExceptionCode ec = 0; 206 element()->ensureShadowRoot()->appendChild(SliderThumbElement::create(element()->document()), ec); 208 Document* document = element()->document(); 209 RefPtr<HTMLElement> track = ElementWithPseudoId::create(document, "-webkit-slider-runnable-track"); 210 track->appendChild(SliderThumbElement::create(document), ec); 211 RefPtr<HTMLElement> container = SliderContainerElement::create(document); 212 container->appendChild(track.release(), ec); 213 container->appendChild(TrackLimiterElement::create(document), ec); 214 element()->ensureShadowRoot()->appendChild(container.release(), ec); 207 215 } 208 216 … … 249 257 void RangeInputType::valueChanged() 250 258 { 251 s hadowSliderThumb()->setPositionFromValue();259 sliderThumbElementOf(element())->setPositionFromValue(); 252 260 } 253 261 … … 273 281 } 274 282 275 SliderThumbElement* RangeInputType::shadowSliderThumb() const276 {277 Node* shadow = element()->shadowRoot();278 return shadow ? toSliderThumbElement(shadow->firstChild()) : 0;279 }280 281 283 } // namespace WebCore -
trunk/Source/WebCore/html/RangeInputType.h
r84683 r88757 71 71 virtual String sanitizeValue(const String& proposedValue); 72 72 virtual bool shouldRespectListAttribute(); 73 74 SliderThumbElement* shadowSliderThumb() const;75 73 }; 76 74 -
trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp
r88415 r88757 34 34 #include "SliderThumbElement.h" 35 35 36 #include "CSSValueKeywords.h" 36 37 #include "Event.h" 37 38 #include "Frame.h" … … 39 40 #include "HTMLParserIdioms.h" 40 41 #include "MouseEvent.h" 42 #include "RenderFlexibleBox.h" 41 43 #include "RenderSlider.h" 42 44 #include "RenderTheme.h" 45 #include "ShadowRoot.h" 43 46 #include "StepRange.h" 44 47 #include <wtf/MathExtras.h> … … 48 51 namespace WebCore { 49 52 53 inline static double sliderPosition(HTMLInputElement* element) 54 { 55 StepRange range(element); 56 return range.proportionFromValue(range.valueFromElement(element)); 57 } 58 59 inline static bool hasVerticalAppearance(HTMLInputElement* input) 60 { 61 ASSERT(input->renderer()); 62 RenderStyle* sliderStyle = input->renderer()->style(); 63 return sliderStyle->appearance() == SliderVerticalPart || sliderStyle->appearance() == MediaVolumeSliderPart; 64 } 65 66 SliderThumbElement* sliderThumbElementOf(Node* node) 67 { 68 ASSERT(node); 69 Node* shadow = node->toInputElement()->shadowRoot(); 70 ASSERT(shadow); 71 Node* thumb = shadow->firstChild()->firstChild()->firstChild(); 72 ASSERT(thumb); 73 return toSliderThumbElement(thumb); 74 } 75 76 // -------------------------------- 77 50 78 // FIXME: Find a way to cascade appearance (see the layout method) and get rid of this class. 79 // http://webkit.org/b/62535 51 80 class RenderSliderThumb : public RenderBlock { 52 81 public: … … 64 93 void RenderSliderThumb::layout() 65 94 { 95 // Do not cast node() to SliderThumbElement. This renderer is used for 96 // TrackLimitElement too. 97 HTMLInputElement* input = node()->shadowAncestorNode()->toInputElement(); 66 98 // FIXME: Hard-coding this cascade of appearance is bad, because it's something 67 99 // that CSS usually does. We need to find a way to express this in CSS. 68 RenderStyle* parentStyle = parent()->style(); 69 if (parentStyle->appearance() == SliderVerticalPart) 100 RenderStyle* parentStyle = input->renderer()->style(); 101 bool isVertical = false; 102 if (parentStyle->appearance() == SliderVerticalPart) { 70 103 style()->setAppearance(SliderThumbVerticalPart); 71 else if (parentStyle->appearance() == SliderHorizontalPart) 104 isVertical = true; 105 } else if (parentStyle->appearance() == SliderHorizontalPart) 72 106 style()->setAppearance(SliderThumbHorizontalPart); 73 107 else if (parentStyle->appearance() == MediaSliderPart) 74 108 style()->setAppearance(MediaSliderThumbPart); 75 else if (parentStyle->appearance() == MediaVolumeSliderPart) 109 else if (parentStyle->appearance() == MediaVolumeSliderPart) { 76 110 style()->setAppearance(MediaVolumeSliderThumbPart); 77 111 isVertical = true; 112 } 78 113 if (style()->hasAppearance()) 79 114 theme()->adjustSliderThumbSize(style()); 115 116 double fraction = sliderPosition(input) * 100; 117 if (isVertical) 118 style()->setTop(Length(100 - fraction, Percent)); 119 else 120 style()->setLeft(Length(fraction, Percent)); 121 80 122 RenderBlock::layout(); 81 123 } 82 124 125 // -------------------------------- 126 127 // FIXME: Find a way to cascade appearance and adjust heights, and get rid of this class. 128 // http://webkit.org/b/62535 129 class RenderSliderContainer : public RenderFlexibleBox { 130 public: 131 RenderSliderContainer(Node* node) 132 : RenderFlexibleBox(node) { } 133 134 private: 135 virtual void layout(); 136 }; 137 138 void RenderSliderContainer::layout() 139 { 140 HTMLInputElement* input = node()->shadowAncestorNode()->toInputElement(); 141 bool isVertical = hasVerticalAppearance(input); 142 style()->setBoxOrient(isVertical ? VERTICAL : HORIZONTAL); 143 // Sets the concrete height if the height of the <input> is not fixed or a 144 // percentage value because a percentage height value of this box won't be 145 // based on the <input> height in such case. 146 Length inputHeight = input->renderer()->style()->height(); 147 RenderObject* trackRenderer = node()->firstChild()->renderer(); 148 if (!isVertical && input->renderer()->isSlider() && !inputHeight.isFixed() && !inputHeight.isPercent()) { 149 RenderObject* thumbRenderer = input->shadowRoot()->firstChild()->firstChild()->firstChild()->renderer(); 150 if (thumbRenderer) { 151 style()->setHeight(thumbRenderer->style()->height()); 152 if (trackRenderer) 153 trackRenderer->style()->setHeight(thumbRenderer->style()->height()); 154 } 155 } else { 156 style()->setHeight(Length(100, Percent)); 157 if (trackRenderer) 158 trackRenderer->style()->setHeight(Length()); 159 } 160 161 RenderFlexibleBox::layout(); 162 163 // Percentage 'top' for the thumb doesn't work if the parent style has no 164 // concrete height. 165 Node* track = node()->firstChild(); 166 if (track && track->renderer()->isBox()) { 167 RenderBox* trackBox = track->renderBox(); 168 trackBox->style()->setHeight(Length(trackBox->height() - trackBox->borderAndPaddingHeight(), Fixed)); 169 } 170 } 171 172 // -------------------------------- 173 83 174 void SliderThumbElement::setPositionFromValue() 84 175 { 85 // Since t oday the code to calculate position is in the RenderSliderlayout176 // Since the code to calculate position is in the RenderSliderThumb layout 86 177 // path, we don't actually update the value here. Instead, we poke at the 87 178 // renderer directly to trigger layout. 88 // FIXME: Move the logic of positioning the thumb here.89 179 if (renderer()) 90 180 renderer()->setNeedsLayout(true); … … 120 210 { 121 211 HTMLInputElement* input = hostInput(); 122 ASSERT(input);123 212 124 213 if (!input->renderer() || !renderer()) … … 126 215 127 216 IntPoint offset = roundedIntPoint(input->renderer()->absoluteToLocal(point, false, true)); 128 RenderStyle* sliderStyle = input->renderer()->style(); 129 bool isVertical = sliderStyle->appearance() == SliderVerticalPart || sliderStyle->appearance() == MediaVolumeSliderPart; 130 217 bool isVertical = hasVerticalAppearance(input); 131 218 int trackSize; 132 219 int position; 133 220 int currentPosition; 221 // We need to calculate currentPosition from absolute points becaue the 222 // renderer for this node is usually on a layer and renderBox()->x() and 223 // y() are unusable. 224 IntPoint absoluteThumbOrigin = renderBox()->absoluteBoundingBoxRect().location(); 225 IntPoint absoluteSliderContentOrigin = roundedIntPoint(input->renderer()->localToAbsolute()); 134 226 if (isVertical) { 135 227 trackSize = input->renderBox()->contentHeight() - renderBox()->height(); 228 // FIXME: The following expression assumes the pointer position is 229 // always the center of the thumb. If a user presses the mouse button at 230 // non-center of the thumb and start moving the pointer, the thumb is 231 // forcely adjusted so that the pointer is at the center of the thumb. 136 232 position = offset.y() - renderBox()->height() / 2; 137 currentPosition = renderBox()->y() - input->renderBox()->contentBoxRect().y();233 currentPosition = absoluteThumbOrigin.y() - absoluteSliderContentOrigin.y(); 138 234 } else { 139 235 trackSize = input->renderBox()->contentWidth() - renderBox()->width(); 236 // FIXME: The following expression assumes the pointer position is 237 // always the center of the thumb. If a user presses the mouse button at 238 // non-center of the thumb and start moving the pointer, the thumb is 239 // forcely adjusted so that the pointer is at the center of the thumb. 140 240 position = offset.x() - renderBox()->width() / 2; 141 currentPosition = renderBox()->x() - input->renderBox()->contentBoxRect().x();241 currentPosition = absoluteThumbOrigin.x() - absoluteSliderContentOrigin.x(); 142 242 } 143 243 position = max(0, min(position, trackSize)); … … 216 316 // Only HTMLInputElement creates SliderThumbElement instances as its shadow nodes. 217 317 // So, shadowAncestorNode() must be an HTMLInputElement. 218 HTMLInputElement* input = shadowAncestorNode()->toInputElement(); 219 return input; 318 return shadowAncestorNode()->toInputElement(); 220 319 } 221 320 … … 226 325 } 227 326 228 } 229 327 // -------------------------------- 328 329 inline TrackLimiterElement::TrackLimiterElement(Document* document) 330 : HTMLDivElement(HTMLNames::divTag, document) 331 { 332 } 333 334 PassRefPtr<TrackLimiterElement> TrackLimiterElement::create(Document* document) 335 { 336 RefPtr<TrackLimiterElement> element = adoptRef(new TrackLimiterElement(document)); 337 element->getInlineStyleDecl()->setProperty(CSSPropertyVisibility, CSSValueHidden); 338 element->getInlineStyleDecl()->setProperty(CSSPropertyPosition, CSSValueStatic); 339 return element.release(); 340 } 341 342 RenderObject* TrackLimiterElement::createRenderer(RenderArena* arena, RenderStyle*) 343 { 344 return new (arena) RenderSliderThumb(this); 345 } 346 347 const AtomicString& TrackLimiterElement::shadowPseudoId() const 348 { 349 DEFINE_STATIC_LOCAL(AtomicString, sliderThumb, ("-webkit-slider-thumb")); 350 return sliderThumb; 351 } 352 353 // -------------------------------- 354 355 inline SliderContainerElement::SliderContainerElement(Document* document) 356 : HTMLDivElement(HTMLNames::divTag, document) 357 { 358 } 359 360 PassRefPtr<SliderContainerElement> SliderContainerElement::create(Document* document) 361 { 362 return adoptRef(new SliderContainerElement(document)); 363 } 364 365 RenderObject* SliderContainerElement::createRenderer(RenderArena* arena, RenderStyle*) 366 { 367 return new (arena) RenderSliderContainer(this); 368 } 369 370 const AtomicString& SliderContainerElement::shadowPseudoId() const 371 { 372 DEFINE_STATIC_LOCAL(AtomicString, sliderThumb, ("-webkit-slider-container")); 373 return sliderThumb; 374 } 375 376 } 377 -
trunk/Source/WebCore/html/shadow/SliderThumbElement.h
r88415 r88757 56 56 virtual void detach(); 57 57 virtual const AtomicString& shadowPseudoId() const; 58 HTMLInputElement* hostInput() const; 58 59 59 60 private: … … 67 68 void stopDragging(); 68 69 void setPositionFromPoint(const IntPoint&); 69 HTMLInputElement* hostInput() const;70 70 71 71 bool m_inDragMode; … … 94 94 } 95 95 96 // This always return a valid pointer. 97 // An assertion fails if the specified node is not a range input. 98 SliderThumbElement* sliderThumbElementOf(Node*); 99 100 // -------------------------------- 101 102 class TrackLimiterElement : public HTMLDivElement { 103 public: 104 static PassRefPtr<TrackLimiterElement> create(Document*); 105 106 private: 107 TrackLimiterElement(Document*); 108 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 109 virtual const AtomicString& shadowPseudoId() const; 110 }; 111 112 // -------------------------------- 113 114 class SliderContainerElement : public HTMLDivElement { 115 public: 116 static PassRefPtr<SliderContainerElement> create(Document*); 117 118 private: 119 SliderContainerElement(Document*); 120 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 121 virtual const AtomicString& shadowPseudoId() const; 122 }; 123 96 124 } 97 125 -
trunk/Source/WebCore/rendering/RenderSlider.cpp
r88415 r88757 49 49 static const int defaultTrackLength = 129; 50 50 51 // Returns a value between 0 and 1.52 static double sliderPosition(HTMLInputElement* element)53 {54 StepRange range(element);55 return range.proportionFromValue(range.valueFromElement(element));56 }57 58 51 RenderSlider::RenderSlider(HTMLInputElement* element) 59 52 : RenderBlock(element) 60 53 { 54 // We assume RenderSlider works only with <input type=range>. 55 ASSERT(element->isRangeControl()); 61 56 } 62 57 … … 101 96 } 102 97 103 IntRect RenderSlider::thumbRect()104 {105 SliderThumbElement* thumbElement = shadowSliderThumb();106 if (!thumbElement)107 return IntRect();108 109 IntRect thumbRect;110 RenderBox* thumb = toRenderBox(thumbElement->renderer());111 112 thumbRect.setWidth(thumb->style()->width().calcMinValue(contentWidth()));113 thumbRect.setHeight(thumb->style()->height().calcMinValue(contentHeight()));114 115 double fraction = sliderPosition(static_cast<HTMLInputElement*>(node()));116 IntRect contentRect = contentBoxRect();117 if (style()->appearance() == SliderVerticalPart || style()->appearance() == MediaVolumeSliderPart) {118 thumbRect.setX(contentRect.x() + (contentRect.width() - thumbRect.width()) / 2);119 thumbRect.setY(contentRect.y() + static_cast<int>(nextafter((contentRect.height() - thumbRect.height()) + 1, 0) * (1 - fraction)));120 } else {121 thumbRect.setX(contentRect.x() + static_cast<int>(nextafter((contentRect.width() - thumbRect.width()) + 1, 0) * fraction));122 thumbRect.setY(contentRect.y() + (contentRect.height() - thumbRect.height()) / 2);123 }124 125 return thumbRect;126 }127 128 void RenderSlider::layout()129 {130 ASSERT(needsLayout());131 132 SliderThumbElement* thumbElement = shadowSliderThumb();133 RenderBox* thumb = thumbElement ? toRenderBox(thumbElement->renderer()) : 0;134 135 IntSize baseSize(borderAndPaddingWidth(), borderAndPaddingHeight());136 137 if (thumb) {138 // Allow the theme to set the size of the thumb.139 if (thumb->style()->hasAppearance())140 theme()->adjustSliderThumbSize(thumb->style());141 142 baseSize.expand(thumb->style()->width().calcMinValue(0), thumb->style()->height().calcMinValue(0));143 }144 145 LayoutRepainter repainter(*this, checkForRepaintDuringLayout());146 147 IntSize oldSize = size();148 149 setSize(baseSize);150 computeLogicalWidth();151 computeLogicalHeight();152 updateLayerTransform();153 154 m_overflow.clear();155 156 if (thumb) {157 if (oldSize != size())158 thumb->setChildNeedsLayout(true, false);159 160 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), style()->isFlippedBlocksWritingMode());161 162 IntRect oldThumbRect = thumb->frameRect();163 164 thumb->layoutIfNeeded();165 166 IntRect rect = thumbRect();167 thumb->setFrameRect(rect);168 if (thumb->checkForRepaintDuringLayout())169 thumb->repaintDuringLayoutIfMoved(oldThumbRect);170 171 statePusher.pop();172 addOverflowFromChild(thumb);173 }174 175 repainter.repaintAfterLayout();176 177 setNeedsLayout(false);178 }179 180 SliderThumbElement* RenderSlider::shadowSliderThumb() const181 {182 Node* shadow = static_cast<Element*>(node())->shadowRoot();183 return shadow ? toSliderThumbElement(shadow->firstChild()) : 0;184 }185 186 98 bool RenderSlider::inDragMode() const 187 99 { 188 SliderThumbElement* thumbElement = shadowSliderThumb(); 189 return thumbElement && thumbElement->active(); 100 return sliderThumbElementOf(node())->active(); 190 101 } 191 102 -
trunk/Source/WebCore/rendering/RenderSlider.h
r83256 r88757 36 36 37 37 bool inDragMode() const; 38 IntRect thumbRect();39 38 40 39 private: … … 44 43 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; 45 44 virtual void computePreferredLogicalWidths(); 46 virtual void layout();47 48 // FIXME: Eventually, the logic of manipulating slider thumb should move to49 // SliderThumbElement and accessing shadowSliderThumb should not be necessary in this class.50 SliderThumbElement* shadowSliderThumb() const;51 52 45 virtual bool requiresForcedStyleRecalcPropagation() const { return true; } 53 46 }; -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r88415 r88757 963 963 } 964 964 965 void RenderTheme::adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle* , Element*) const966 { 967 // FIXME: Should call adjustSliderThumbSize().965 void RenderTheme::adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle* style, Element*) const 966 { 967 adjustSliderThumbSize(style); 968 968 } 969 969
Note: See TracChangeset
for help on using the changeset viewer.