Changeset 83065 in webkit
- Timestamp:
- Apr 6, 2011 10:03:26 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r83057 r83065 1 2011-04-06 MORITA Hajime <morrita@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 [Refactoring] <progress> should not have manual layout code. 6 https://bugs.webkit.org/show_bug.cgi?id=57801 7 8 Updated progress-bar-value-pseudo-element.html to have wider coverage and 9 follow pseudo class change. 10 11 * fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element.html: 12 * platform/chromium/test_expectations.txt: 13 * platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.checksum: 14 * platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.png: 15 * platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.txt: 16 1 17 2011-04-06 Adrienne Walker <enne@google.com> 2 18 -
trunk/LayoutTests/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element.html
r77578 r83065 2 2 <head><script> 3 3 window.onload = function() { 4 document.getElementById(" toChangeStyle").setAttribute("style", "border:3px red dotted; background-color:cyan;");5 document.getElementById(" toAddStyle").setAttribute("style", "border:3px red dotted; background-color:cyan; -webkit-appearance: none;");4 document.getElementById("removingAppearanceDynamically").setAttribute("style", "-webkit-appearance: none;"); 5 document.getElementById("givingProgressStyleDynamically").setAttribute("style", "background-color: lightblue;"); 6 6 } 7 7 </script> 8 8 <style> 9 9 .styled { -webkit-appearance: none; } 10 .styled::-webkit-progress-bar-value { background-color: lightgray; } 11 #toAddStyle::-webkit-progress-bar-value {background-color:darkblue;} 10 .transparent-bar::-webkit-progress-bar { background-color: transparent; } 11 .transparent-value::-webkit-progress-value { background-color: transparent; } 12 .progress-style { border:3px solid #006; background-color: blue; } 13 .bar-style::-webkit-progress-bar { background-color: red; border:3px solid #900; } 14 .value-style::-webkit-progress-value { background-color: yellow; border:3px solid #990; } 12 15 </style> 13 16 </head> 14 17 <body> 15 18 <ul> 16 <li> 17 Giving style statically : background-color: 18 <progress class="styled" max=100 value=70 style="width:300px; height:50px; background-color:blue; " > 19 </li> 20 <li> 21 Giving style statically : border: 22 <progress class="styled" style="border:3px solid red;" value=0.5> 23 </li> 24 <li> 25 Giving style statically, only for -webkit-progress-bar-value: 26 <progress class="styled" value=0.5></progress> 27 </li> 28 <li> 29 Adding style dynamically: 30 <progress value=0.5 id="toAddStyle"></progress> 31 </li> 32 <li> 33 Changing style dynamically: 34 <progress class="styled" max=100 value=70 dir="rtl" id="toChangeStyle"></progress> 35 </li> 19 <li>Default style: <progress value=0.1 style="-webkit-appearance: none;" ></li> 20 <li>Progress style: <progress class="styled transparent-bar progress-style" value=0.2> 21 <li>Progress style (size): <progress class="styled" style="width: 300px; height: 30px;" value=0.3> 22 <li>Bar style: <progress class="styled bar-style" value=0.4> 23 <li>Value style: <progress class="styled value-style" value=0.5> 24 <li>Styling for all three elements: <progress class="styled progress-style bar-style value-style" style="height:30px" value=0.6> 25 <li>Removing appearance dynamically: <progress id="removingAppearanceDynamically" value=0.7> 26 <li>Giving progress style change dynamically: <progress id="givingProgressStyleDynamically" class="styled transparent-bar" value=0.8> 36 27 </ul> 37 28 </body> -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r83053 r83065 3285 3285 BUGWK50661 WIN LINUX : fast/dom/HTMLMeterElement/meter-styles.html = IMAGE+TEXT PASS 3286 3286 3287 // Need rebaselines 3288 BUGMORRITA WIN LINUX : fast/dom/HTMLProgressElement/progress-element.html = TEXT 3289 BUGMORRITA WIN LINUX MAC : fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element.html = IMAGE+TEXT 3290 3287 3291 // Need rebaselines on all platforms. 3288 3292 BUGENNE : svg/W3C-SVG-1.1-SE/text-tspan-02-b.svg = FAIL -
trunk/LayoutTests/platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.checksum
r71073 r83065 1 1dc2e8bf7b48667508223bdf9c64caa8 1 eb18dbe86f7657ce59c56df924422cac -
trunk/LayoutTests/platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.txt
r61993 r83065 4 4 RenderBlock {HTML} at (0,0) size 800x600 5 5 RenderBody {BODY} at (8,8) size 784x576 6 RenderBlock {UL} at (0,0) size 784x138 7 RenderListItem {LI} at (40,0) size 744x51 8 RenderListMarker at (-17,33) size 7x18: bullet 9 RenderText {#text} at (0,33) size 268x18 10 text run at (0,33) width 268: "Giving style statically : background-color: " 11 RenderProgress {PROGRESS} at (268,0) size 300x50 [bgcolor=#0000FF] 12 RenderBlock {DIV} at (0,0) size 210x50 [bgcolor=#D3D3D3] 13 RenderListItem {LI} at (40,51) size 744x23 14 RenderListMarker at (-17,5) size 7x18: bullet 15 RenderText {#text} at (0,5) size 197x18 16 text run at (0,5) width 197: "Giving style statically : border: " 17 RenderProgress {PROGRESS} at (197,0) size 166x22 [bgcolor=#808080] [border: (3px solid #FF0000)] 18 RenderBlock {DIV} at (3,3) size 80x16 [bgcolor=#D3D3D3] 19 RenderListItem {LI} at (40,74) size 744x18 6 RenderBlock {UL} at (0,0) size 784x170 7 RenderListItem {LI} at (40,0) size 744x18 20 8 RenderListMarker at (-17,0) size 7x18: bullet 21 RenderText {#text} at (0,0) size 376x18 22 text run at (0,0) width 376: "Giving style statically, only for -webkit-progress-bar-value: " 23 RenderProgress {PROGRESS} at (376,1) size 160x16 [bgcolor=#808080] 24 RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#D3D3D3] 25 RenderText {#text} at (0,0) size 0x0 26 RenderListItem {LI} at (40,92) size 744x23 27 RenderListMarker at (-17,5) size 7x18: bullet 28 RenderText {#text} at (0,5) size 170x18 29 text run at (0,5) width 170: "Adding style dynamically: " 30 RenderProgress {PROGRESS} at (170,0) size 166x22 [bgcolor=#00FFFF] [border: (3px dotted #FF0000)] 31 RenderBlock {DIV} at (3,3) size 80x16 [bgcolor=#00008B] 32 RenderText {#text} at (0,0) size 0x0 33 RenderListItem {LI} at (40,115) size 744x23 34 RenderListMarker at (-17,5) size 7x18: bullet 35 RenderText {#text} at (0,5) size 184x18 36 text run at (0,5) width 184: "Changing style dynamically: " 37 RenderProgress {PROGRESS} at (184,0) size 166x22 [bgcolor=#00FFFF] [border: (3px dotted #FF0000)] 38 RenderBlock {DIV} at (51,3) size 112x16 [bgcolor=#D3D3D3] 39 RenderText {#text} at (0,0) size 0x0 9 RenderText {#text} at (0,0) size 88x18 10 text run at (0,0) width 88: "Default style: " 11 RenderProgress {PROGRESS} at (88,1) size 160x16 12 RenderBlock {DIV} at (0,0) size 160x16 [bgcolor=#808080] 13 RenderBlock {DIV} at (0,0) size 16x16 [bgcolor=#008000] 14 RenderListItem {LI} at (40,18) size 744x18 15 RenderListMarker at (-17,0) size 7x18: bullet 16 RenderText {#text} at (0,0) size 95x18 17 text run at (0,0) width 95: "Progress style: " 18 RenderProgress {PROGRESS} at (95,1) size 160x16 [bgcolor=#0000FF] [border: (3px solid #000066)] 19 RenderBlock {DIV} at (3,3) size 154x10 20 RenderBlock {DIV} at (0,0) size 30x10 [bgcolor=#008000] 21 RenderListItem {LI} at (40,36) size 744x31 22 RenderListMarker at (-17,13) size 7x18: bullet 23 RenderText {#text} at (0,13) size 133x18 24 text run at (0,13) width 133: "Progress style (size): " 25 RenderProgress {PROGRESS} at (133,0) size 300x30 26 RenderBlock {DIV} at (0,0) size 300x30 [bgcolor=#808080] 27 RenderBlock {DIV} at (0,0) size 90x30 [bgcolor=#008000] 28 RenderListItem {LI} at (40,67) size 744x18 29 RenderListMarker at (-17,0) size 7x18: bullet 30 RenderText {#text} at (0,0) size 64x18 31 text run at (0,0) width 64: "Bar style: " 32 RenderProgress {PROGRESS} at (64,1) size 160x16 33 RenderBlock {DIV} at (0,0) size 160x16 [bgcolor=#FF0000] [border: (3px solid #990000)] 34 RenderBlock {DIV} at (3,3) size 61x10 [bgcolor=#008000] 35 RenderListItem {LI} at (40,85) size 744x18 36 RenderListMarker at (-17,0) size 7x18: bullet 37 RenderText {#text} at (0,0) size 79x18 38 text run at (0,0) width 79: "Value style: " 39 RenderProgress {PROGRESS} at (79,1) size 160x16 40 RenderBlock {DIV} at (0,0) size 160x16 [bgcolor=#808080] 41 RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#FFFF00] [border: (3px solid #999900)] 42 RenderListItem {LI} at (40,103) size 744x31 43 RenderListMarker at (-17,13) size 7x18: bullet 44 RenderText {#text} at (0,13) size 188x18 45 text run at (0,13) width 188: "Styling for all three elements: " 46 RenderProgress {PROGRESS} at (188,0) size 160x30 [bgcolor=#0000FF] [border: (3px solid #000066)] 47 RenderBlock {DIV} at (3,3) size 154x24 [bgcolor=#FF0000] [border: (3px solid #990000)] 48 RenderBlock {DIV} at (3,3) size 88x18 [bgcolor=#FFFF00] [border: (3px solid #999900)] 49 RenderListItem {LI} at (40,134) size 744x18 50 RenderListMarker at (-17,0) size 7x18: bullet 51 RenderText {#text} at (0,0) size 230x18 52 text run at (0,0) width 230: "Removing appearance dynamically: " 53 RenderProgress {PROGRESS} at (230,1) size 160x16 54 RenderBlock {DIV} at (0,0) size 160x16 [bgcolor=#808080] 55 RenderBlock {DIV} at (0,0) size 112x16 [bgcolor=#008000] 56 RenderListItem {LI} at (40,152) size 744x18 57 RenderListMarker at (-17,0) size 7x18: bullet 58 RenderText {#text} at (0,0) size 272x18 59 text run at (0,0) width 272: "Giving progress style change dynamically: " 60 RenderProgress {PROGRESS} at (272,1) size 160x16 [bgcolor=#ADD8E6] 61 RenderBlock {DIV} at (0,0) size 160x16 62 RenderBlock {DIV} at (0,0) size 128x16 [bgcolor=#008000] -
trunk/Source/WebCore/Android.mk
r82899 r83065 357 357 html/shadow/MediaControls.cpp \ 358 358 html/shadow/MeterShadowElement.cpp \ 359 html/shadow/ProgressShadowElement.cpp \ 359 360 html/shadow/SliderThumbElement.cpp \ 360 361 html/shadow/TextControlInnerElements.cpp \ -
trunk/Source/WebCore/CMakeLists.txt
r82899 r83065 876 876 html/shadow/MediaControls.cpp 877 877 html/shadow/MeterShadowElement.cpp 878 html/shadow/ProgressShadowElement.cpp 878 879 html/shadow/SliderThumbElement.cpp 879 880 html/shadow/TextControlInnerElements.cpp -
trunk/Source/WebCore/ChangeLog
r83064 r83065 1 2011-04-06 MORITA Hajime <morrita@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 [Refactoring] <progress> should not have manual layout code. 6 https://bugs.webkit.org/show_bug.cgi?id=57801 7 8 - Simplified RenderProgress, removing its custom layout code 9 - Introducing ProgressValueElement and ProgressBarElement, replacing 10 ProgressBarValueElement. 11 12 Now the structure is almost identical to <meter>, 13 other than: 14 - RenderProgress has animated painting, thus manages its own timer. 15 - Both ProgressValueElement and ProgressBarElement has pseudo classes 16 which don't changes during its lifetime. 17 18 * Android.mk: 19 * CMakeLists.txt: 20 * GNUmakefile.am: 21 * WebCore.gypi: 22 * WebCore.pro: 23 * WebCore.vcproj/WebCore.vcproj: 24 * WebCore.xcodeproj/project.pbxproj: 25 * css/html.css: 26 (progress): 27 (progress::-webkit-progress-bar): 28 (progress::-webkit-progress-value): 29 * html/HTMLProgressElement.cpp: 30 (WebCore::HTMLProgressElement::~HTMLProgressElement): 31 (WebCore::HTMLProgressElement::create): 32 (WebCore::HTMLProgressElement::attach): 33 (WebCore::HTMLProgressElement::didElementStateChange): 34 (WebCore::HTMLProgressElement::createShadowSubtree): 35 * html/HTMLProgressElement.h: 36 * html/shadow/ProgressShadowElement.cpp: Copied from Source/WebCore/html/shadow/ProgressBarValueElement.h. 37 (WebCore::ProgressShadowElement::ProgressShadowElement): 38 (WebCore::ProgressShadowElement::progressElement): 39 (WebCore::ProgressShadowElement::rendererIsNeeded): 40 (WebCore::ProgressBarElement::shadowPseudoId): 41 (WebCore::ProgressValueElement::shadowPseudoId): 42 (WebCore::ProgressValueElement::setWidthPercentage): 43 * html/shadow/ProgressShadowElement.h: Renamed from Source/WebCore/html/shadow/ProgressBarValueElement.h. 44 (WebCore::ProgressBarElement::ProgressBarElement): 45 (WebCore::ProgressBarElement::create): 46 (WebCore::ProgressValueElement::ProgressValueElement): 47 (WebCore::ProgressValueElement::create): 48 * rendering/RenderProgress.cpp: 49 (WebCore::RenderProgress::RenderProgress): 50 (WebCore::RenderProgress::updateFromElement): 51 (WebCore::RenderProgress::animationTimerFired): 52 * rendering/RenderProgress.h: 53 (WebCore::RenderProgress::requiresForcedStyleRecalcPropagation): 54 (WebCore::RenderProgress::canHaveChildren): 55 1 56 2011-04-06 Mario Sanchez Prada <msanchez@igalia.com> 2 57 -
trunk/Source/WebCore/GNUmakefile.am
r83053 r83065 1926 1926 Source/WebCore/html/shadow/MeterShadowElement.cpp \ 1927 1927 Source/WebCore/html/shadow/MeterShadowElement.h \ 1928 Source/WebCore/html/shadow/ProgressBarValueElement.h \ 1928 Source/WebCore/html/shadow/ProgressShadowElement.cpp \ 1929 Source/WebCore/html/shadow/ProgressShadowElement.h \ 1929 1930 Source/WebCore/html/shadow/SliderThumbElement.cpp \ 1930 1931 Source/WebCore/html/shadow/SliderThumbElement.h \ -
trunk/Source/WebCore/WebCore.gypi
r82963 r83065 3152 3152 'html/shadow/MeterShadowElement.cpp', 3153 3153 'html/shadow/MeterShadowElement.h', 3154 'html/shadow/ProgressBarValueElement.h', 3154 'html/shadow/ProgressShadowElement.cpp', 3155 'html/shadow/ProgressShadowElement.h', 3155 3156 'html/shadow/SliderThumbElement.cpp', 3156 3157 'html/shadow/SliderThumbElement.h', -
trunk/Source/WebCore/WebCore.pro
r82899 r83065 803 803 html/shadow/MediaControls.cpp \ 804 804 html/shadow/MeterShadowElement.cpp \ 805 html/shadow/ProgressShadowElement.cpp \ 805 806 html/shadow/SliderThumbElement.cpp \ 806 807 html/shadow/TextControlInnerElements.cpp \ -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r82962 r83065 56406 56406 </File> 56407 56407 <File 56408 RelativePath="..\html\shadow\ProgressShadowElement.cpp" 56409 > 56410 </File> 56411 <File 56412 RelativePath="..\html\shadow\ProgressShadowElement.h" 56413 > 56414 </File> 56415 <File 56408 56416 RelativePath="..\html\shadow\SliderThumbElement.cpp" 56409 56417 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r83040 r83065 3198 3198 A622A8FF122C44A600A785B3 /* GenericBinding.h in Headers */ = {isa = PBXBuildFile; fileRef = A622A8F9122C44A600A785B3 /* GenericBinding.h */; }; 3199 3199 A7151BD812F1558F005A0F64 /* TextCheckerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A7151BD712F1558F005A0F64 /* TextCheckerClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3200 A715E652134BBBEC00D8E713 /* ProgressShadowElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A715E650134BBBEC00D8E713 /* ProgressShadowElement.cpp */; }; 3201 A715E653134BBBEC00D8E713 /* ProgressShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */; }; 3200 3202 A718760E0B2A120100A16ECE /* DragActions.h in Headers */ = {isa = PBXBuildFile; fileRef = A718760D0B2A120100A16ECE /* DragActions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3201 3203 A71878900B2D04AC00A16ECE /* DragControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */; }; … … 3251 3253 A7F338A311C0EFCA00A320A7 /* ShadowElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7F338A111C0EFCA00A320A7 /* ShadowElement.cpp */; }; 3252 3254 A7F338A411C0EFCA00A320A7 /* ShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A7F338A211C0EFCA00A320A7 /* ShadowElement.h */; }; 3253 A7FE819C12FA677700850C1E /* ProgressBarValueElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FE819B12FA677700850C1E /* ProgressBarValueElement.h */; };3254 3255 A80A38FE0E50CC8200A25EBC /* PatternCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80A38FD0E50CC8200A25EBC /* PatternCG.cpp */; }; 3255 3256 A80D67080E9E9DEB00E420F0 /* GraphicsContextPlatformPrivateCG.h in Headers */ = {isa = PBXBuildFile; fileRef = A80D67070E9E9DEB00E420F0 /* GraphicsContextPlatformPrivateCG.h */; }; … … 9723 9724 A622A8F9122C44A600A785B3 /* GenericBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GenericBinding.h; path = generic/GenericBinding.h; sourceTree = "<group>"; }; 9724 9725 A7151BD712F1558F005A0F64 /* TextCheckerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCheckerClient.h; sourceTree = "<group>"; }; 9726 A715E650134BBBEC00D8E713 /* ProgressShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProgressShadowElement.cpp; sourceTree = "<group>"; }; 9727 A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProgressShadowElement.h; sourceTree = "<group>"; }; 9725 9728 A718760D0B2A120100A16ECE /* DragActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragActions.h; sourceTree = "<group>"; }; 9726 9729 A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragControllerMac.mm; sourceTree = "<group>"; }; … … 9779 9782 A7F338A111C0EFCA00A320A7 /* ShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowElement.cpp; sourceTree = "<group>"; }; 9780 9783 A7F338A211C0EFCA00A320A7 /* ShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowElement.h; sourceTree = "<group>"; }; 9781 A7FE819B12FA677700850C1E /* ProgressBarValueElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProgressBarValueElement.h; sourceTree = "<group>"; };9782 9784 A80A38FD0E50CC8200A25EBC /* PatternCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PatternCG.cpp; sourceTree = "<group>"; }; 9783 9785 A80D67070E9E9DEB00E420F0 /* GraphicsContextPlatformPrivateCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContextPlatformPrivateCG.h; sourceTree = "<group>"; }; … … 13442 13444 A78E526D1346BD1700AD9C31 /* MeterShadowElement.cpp */, 13443 13445 A78E526E1346BD1700AD9C31 /* MeterShadowElement.h */, 13444 A7FE819B12FA677700850C1E /* ProgressBarValueElement.h */, 13446 A715E650134BBBEC00D8E713 /* ProgressShadowElement.cpp */, 13447 A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */, 13445 13448 4150F9F012B6E0E70008C860 /* SliderThumbElement.cpp */, 13446 13449 4150F9EF12B6E0E70008C860 /* SliderThumbElement.h */, … … 22003 22006 B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */, 22004 22007 A8EA7EBC0A1945D000A8EF5F /* ProcessingInstruction.h in Headers */, 22005 A7FE819C12FA677700850C1E /* ProgressBarValueElement.h in Headers */,22006 22008 E44613EC0CD681B500FADA75 /* ProgressEvent.h in Headers */, 22009 A715E653134BBBEC00D8E713 /* ProgressShadowElement.h in Headers */, 22007 22010 1A2A68240B5BEDE70002A480 /* ProgressTracker.h in Headers */, 22008 22011 514C76750CE923A1007EF3CD /* ProtectionSpace.h in Headers */, … … 24860 24863 A8EA7EBD0A1945D000A8EF5F /* ProcessingInstruction.cpp in Sources */, 24861 24864 E44613EB0CD681B400FADA75 /* ProgressEvent.cpp in Sources */, 24865 A715E652134BBBEC00D8E713 /* ProgressShadowElement.cpp in Sources */, 24862 24866 1A2A68230B5BEDE70002A480 /* ProgressTracker.cpp in Sources */, 24863 24867 514C76740CE923A1007EF3CD /* ProtectionSpace.cpp in Sources */, -
trunk/Source/WebCore/css/html.css
r82899 r83065 709 709 progress { 710 710 -webkit-appearance: progress-bar; 711 -webkit-box-sizing: border-box; 711 712 display: inline-block; 712 713 height: 1em; 713 714 width: 10em; 714 715 vertical-align: -0.2em; 716 } 717 718 progress::-webkit-progress-bar { 715 719 background-color: gray; 716 } 717 718 progress::-webkit-progress-bar-value { 719 -webkit-appearance: progress-bar; 720 height: 100%; 721 -webkit-box-sizing: border-box; 722 } 723 724 progress::-webkit-progress-value { 720 725 background-color: green; 726 height: 100%; 727 width: 50%; /* should be removed later */ 728 -webkit-box-sizing: border-box; 721 729 } 722 730 -
trunk/Source/WebCore/html/HTMLProgressElement.cpp
r77578 r83065 31 31 #include "HTMLNames.h" 32 32 #include "HTMLParserIdioms.h" 33 #include "Progress BarValueElement.h"33 #include "ProgressShadowElement.h" 34 34 #include "RenderProgress.h" 35 35 #include <wtf/StdLibExtras.h> … … 45 45 } 46 46 47 HTMLProgressElement::~HTMLProgressElement() 48 { 49 } 50 47 51 PassRefPtr<HTMLProgressElement> HTMLProgressElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 48 52 { 49 return adoptRef(new HTMLProgressElement(tagName, document, form)); 53 RefPtr<HTMLProgressElement> progress = adoptRef(new HTMLProgressElement(tagName, document, form)); 54 progress->createShadowSubtree(); 55 return progress; 50 56 } 51 57 … … 73 79 void HTMLProgressElement::attach() 74 80 { 75 createShadowSubtreeIfNeeded();76 81 HTMLFormControlElement::attach(); 77 82 didElementStateChange(); … … 124 129 void HTMLProgressElement::didElementStateChange() 125 130 { 131 m_value->setWidthPercentage(position()*100); 126 132 if (renderer()) 127 133 renderer()->updateFromElement(); 128 134 } 129 135 130 void HTMLProgressElement::createShadowSubtree IfNeeded()136 void HTMLProgressElement::createShadowSubtree() 131 137 { 132 if (shadowRoot()) 133 return; 134 setShadowRoot(ProgressBarValueElement::create(document()).get()); 138 RefPtr<ProgressBarElement> bar = ProgressBarElement::create(document()); 139 m_value = ProgressValueElement::create(document()); 140 ExceptionCode e = 0; 141 bar->appendChild(m_value, e); 142 setShadowRoot(bar); 135 143 } 136 144 -
trunk/Source/WebCore/html/HTMLProgressElement.h
r78232 r83065 27 27 namespace WebCore { 28 28 29 class ProgressValueElement; 30 29 31 class HTMLProgressElement : public HTMLFormControlElement { 30 32 public: … … 41 43 private: 42 44 HTMLProgressElement(const QualifiedName&, Document*, HTMLFormElement*); 45 virtual ~HTMLProgressElement(); 43 46 44 47 virtual bool recalcWillValidate() const { return false; } … … 53 56 54 57 void didElementStateChange(); 55 void createShadowSubtreeIfNeeded(); 58 void createShadowSubtree(); 59 60 RefPtr<ProgressValueElement> m_value; 56 61 }; 57 62 -
trunk/Source/WebCore/html/shadow/ProgressShadowElement.cpp
r83064 r83065 1 1 /* 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved. 4 3 * 5 4 * Redistribution and use in source and binary forms, with or without … … 30 29 */ 31 30 32 #ifndef ProgressBarValueElement_h 33 #define ProgressBarValueElement_h 31 #include "config.h" 32 #if ENABLE(PROGRESS_TAG) 33 #include "ProgressShadowElement.h" 34 34 35 #include "HTMLDivElement.h"36 35 #include "HTMLNames.h" 37 #include " RenderProgress.h"38 #include <wtf/Forward.h>36 #include "HTMLProgressElement.h" 37 #include "RenderObject.h" 39 38 40 39 namespace WebCore { 41 40 42 class ProgressBarValueElement : public HTMLDivElement { 43 public: 44 ProgressBarValueElement(Document* document) 45 : HTMLDivElement(HTMLNames::divTag, document) 46 { 47 } 41 using namespace HTMLNames; 48 42 49 virtual const AtomicString& shadowPseudoId() const; 50 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 51 static PassRefPtr<ProgressBarValueElement> create(Document*); 43 ProgressShadowElement::ProgressShadowElement(Document* document) 44 : HTMLDivElement(HTMLNames::divTag, document) 45 { 46 } 52 47 53 }; 48 HTMLProgressElement* ProgressShadowElement::progressElement() const 49 { 50 Node* node = const_cast<ProgressShadowElement*>(this)->shadowAncestorNode(); 51 ASSERT(!node || progressTag == toElement(node)->tagQName()); 52 return static_cast<HTMLProgressElement*>(node); 53 } 54 54 55 inline const AtomicString& ProgressBarValueElement::shadowPseudoId() const 55 bool ProgressShadowElement::rendererIsNeeded(RenderStyle* style) 56 56 { 57 DEFINE_STATIC_LOCAL(AtomicString, pseudId, ("-webkit-progress-bar-value")); 57 RenderObject* progressRenderer = progressElement()->renderer(); 58 return progressRenderer && !progressRenderer->style()->hasAppearance() && HTMLDivElement::rendererIsNeeded(style); 59 } 60 61 const AtomicString& ProgressBarElement::shadowPseudoId() const 62 { 63 DEFINE_STATIC_LOCAL(AtomicString, pseudId, ("-webkit-progress-bar")); 58 64 return pseudId; 59 65 } 60 66 61 inline RenderObject* ProgressBarValueElement::createRenderer(RenderArena* arena, RenderStyle*) 67 68 const AtomicString& ProgressValueElement::shadowPseudoId() const 62 69 { 63 return new (arena) RenderProgressBarValuePart(this); 70 DEFINE_STATIC_LOCAL(AtomicString, pseudId, ("-webkit-progress-value")); 71 return pseudId; 64 72 } 65 73 66 inline PassRefPtr<ProgressBarValueElement> ProgressBarValueElement::create(Document* document)74 void ProgressValueElement::setWidthPercentage(double width) 67 75 { 68 return adoptRef(new ProgressBarValueElement(document));76 getInlineStyleDecl()->setProperty(CSSPropertyWidth, width, CSSPrimitiveValue::CSS_PERCENTAGE); 69 77 } 70 78 71 79 } 80 #endif 72 81 73 #endif -
trunk/Source/WebCore/html/shadow/ProgressShadowElement.h
r83064 r83065 30 30 */ 31 31 32 #ifndef Progress BarValueElement_h33 #define Progress BarValueElement_h32 #ifndef ProgressShadowElement_h 33 #define ProgressShadowElement_h 34 34 35 35 #include "HTMLDivElement.h" 36 #include "HTMLNames.h"37 #include "RenderProgress.h"38 36 #include <wtf/Forward.h> 39 37 40 38 namespace WebCore { 41 39 42 class ProgressBarValueElement : public HTMLDivElement { 40 class HTMLProgressElement; 41 42 class ProgressShadowElement : public HTMLDivElement { 43 43 public: 44 ProgressBarValueElement(Document* document) 45 : HTMLDivElement(HTMLNames::divTag, document) 44 ProgressShadowElement(Document*); 45 HTMLProgressElement* progressElement() const; 46 47 private: 48 virtual bool rendererIsNeeded(RenderStyle*); 49 }; 50 51 class ProgressBarElement : public ProgressShadowElement { 52 public: 53 ProgressBarElement(Document* document) 54 : ProgressShadowElement(document) 55 { 56 } 57 58 static PassRefPtr<ProgressBarElement> create(Document*); 59 virtual const AtomicString& shadowPseudoId() const; 60 }; 61 62 inline PassRefPtr<ProgressBarElement> ProgressBarElement::create(Document* document) 63 { 64 return adoptRef(new ProgressBarElement(document)); 65 } 66 67 68 class ProgressValueElement : public ProgressShadowElement { 69 public: 70 ProgressValueElement(Document* document) 71 : ProgressShadowElement(document) 46 72 { 47 73 } 48 74 49 75 virtual const AtomicString& shadowPseudoId() const; 50 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 51 static PassRefPtr<ProgressBarValueElement> create(Document*); 52 76 static PassRefPtr<ProgressValueElement> create(Document*); 77 void setWidthPercentage(double); 53 78 }; 54 79 55 inline const AtomicString& ProgressBarValueElement::shadowPseudoId() const80 inline PassRefPtr<ProgressValueElement> ProgressValueElement::create(Document* document) 56 81 { 57 DEFINE_STATIC_LOCAL(AtomicString, pseudId, ("-webkit-progress-bar-value")); 58 return pseudId; 59 } 60 61 inline RenderObject* ProgressBarValueElement::createRenderer(RenderArena* arena, RenderStyle*) 62 { 63 return new (arena) RenderProgressBarValuePart(this); 64 } 65 66 inline PassRefPtr<ProgressBarValueElement> ProgressBarValueElement::create(Document* document) 67 { 68 return adoptRef(new ProgressBarValueElement(document)); 82 return adoptRef(new ProgressValueElement(document)); 69 83 } 70 84 -
trunk/Source/WebCore/rendering/RenderProgress.cpp
r77578 r83065 37 37 namespace WebCore { 38 38 39 IntRect RenderProgressBarValuePart::preferredFrameRect()40 {41 return toRenderProgress(parent())->valuePartRect();42 }43 44 bool RenderProgressBarValuePart::shouldBeHidden()45 {46 return !toRenderProgress(parent())->shouldHaveParts();47 }48 49 39 RenderProgress::RenderProgress(HTMLProgressElement* element) 50 : Render Indicator(element)40 : RenderBlock(element) 51 41 , m_position(-1) 52 42 , m_animationStartTime(0) … … 70 60 71 61 updateAnimationState(); 72 Render Indicator::updateFromElement();62 RenderBlock::updateFromElement(); 73 63 } 74 64 … … 86 76 { 87 77 repaint(); 88 } 89 90 void RenderProgress::paint(PaintInfo& paintInfo, int tx, int ty) 91 { 92 if (paintInfo.phase == PaintPhaseBlockBackground) { 93 if (!m_animationTimer.isActive() && m_animating) 94 m_animationTimer.startOneShot(m_animationRepeatInterval); 95 } 96 97 RenderIndicator::paint(paintInfo, tx, ty); 98 } 99 100 void RenderProgress::layoutParts() 101 { 102 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) 103 child->layout(); 104 updateAnimationState(); 105 } 106 107 bool RenderProgress::shouldHaveParts() const 108 { 109 if (!style()->hasAppearance()) 110 return true; 111 return false; 78 if (!m_animationTimer.isActive() && m_animating) 79 m_animationTimer.startOneShot(m_animationRepeatInterval); 112 80 } 113 81 … … 129 97 } 130 98 131 IntRect RenderProgress::valuePartRect() const132 {133 IntRect rect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), lround((width() - borderLeft() - paddingLeft() - borderRight() - paddingRight()) * position()), height() - borderTop() - paddingTop() - borderBottom() - paddingBottom());134 if (!style()->isLeftToRightDirection())135 rect.setX(width() - borderRight() - paddingRight() - rect.width());136 return rect;137 }138 139 99 HTMLProgressElement* RenderProgress::progressElement() const 140 100 { -
trunk/Source/WebCore/rendering/RenderProgress.h
r77578 r83065 24 24 #if ENABLE(PROGRESS_TAG) 25 25 #include "RenderBlock.h" 26 #include "RenderIndicator.h"27 26 28 27 namespace WebCore { … … 30 29 class HTMLProgressElement; 31 30 32 class RenderProgressBarValuePart : public RenderIndicatorPart { 33 public: 34 RenderProgressBarValuePart(Node* node) : RenderIndicatorPart(node) {} 35 private: 36 virtual IntRect preferredFrameRect(); 37 virtual bool shouldBeHidden(); 38 }; 39 40 class RenderProgress : public RenderIndicator { 31 class RenderProgress : public RenderBlock { 41 32 public: 42 33 RenderProgress(HTMLProgressElement*); … … 48 39 49 40 bool isDeterminate() const; 50 IntRect valuePartRect() const;51 bool shouldHaveParts() const;52 41 53 42 HTMLProgressElement* progressElement() const; … … 56 45 virtual const char* renderName() const { return "RenderProgress"; } 57 46 virtual bool isProgress() const { return true; } 47 virtual bool requiresForcedStyleRecalcPropagation() const { return true; } 48 virtual bool canHaveChildren() const { return false; } 58 49 virtual void updateFromElement(); 59 virtual void paint(PaintInfo&, int tx, int ty);60 virtual void layoutParts();61 50 62 51 void animationTimerFired(Timer<RenderProgress>*);
Note: See TracChangeset
for help on using the changeset viewer.