[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

yael.aharon at nokia.com yael.aharon at nokia.com
Thu Apr 8 02:22:12 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 93e750a0d2e8c7b8bf9cd48bf324b5ebedf19c63
Author: yael.aharon at nokia.com <yael.aharon at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 15 01:00:36 2010 +0000

    Support for HTMLProgressElement
    https://bugs.webkit.org/show_bug.cgi?id=35937
    
    Reviewed by Darin Adler.
    
    WebCore:
    
    Added support for HTMLProgressElement.
    This implementation is enabled only for Qt, because only RenderThemeQt
    was modified to actually draw the progress element.
    The labels attribute of the progress element will be implemented in a
    separate patch.
    
    Tests: fast/dom/HTMLProgressElement/progress-element.html
           fast/dom/HTMLProgressElement/set-progress-properties.html
    
    * DerivedSources.cpp:
    * DerivedSources.make:
    * GNUmakefile.am:
    * WebCore.gypi:
    * WebCore.pri:
    * WebCore.pro:
    * WebCore.vcproj/WebCore.vcproj:
    * WebCore.xcodeproj/project.pbxproj:
    * css/CSSPrimitiveValueMappings.h:
    (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
    * css/CSSSelector.cpp:
    (WebCore::CSSSelector::extractPseudoType):
    * css/CSSValueKeywords.in:
    * css/html.css:
    * html/HTMLElement.cpp:
    (WebCore::inlineTagList):
    * html/HTMLElementsAllInOne.cpp:
    * html/HTMLFormControlElement.cpp:
    * html/HTMLFormControlElement.h:
    * html/HTMLProgressElement.cpp: Added.
    * html/HTMLProgressElement.h: Added.
    * html/HTMLProgressElement.idl: Added.
    * html/HTMLTagNames.in:
    * page/DOMWindow.idl:
    * platform/ThemeTypes.h:
    * platform/qt/RenderThemeQt.cpp:
    * platform/qt/RenderThemeQt.h:
    * rendering/RenderObject.h:
    * rendering/RenderProgress.cpp: Added.
    * rendering/RenderProgress.h: Added.
    * rendering/RenderTheme.cpp:
    * rendering/RenderTheme.h:
    
    LayoutTests:
    
    * fast/dom/HTMLProgressElement: Added.
    * fast/dom/HTMLProgressElement/progress-element.html: Added.
    * fast/dom/HTMLProgressElement/script-tests: Added.
    * fast/dom/HTMLProgressElement/script-tests/TEMPLATE.html: Added.
    * fast/dom/HTMLProgressElement/script-tests/set-progress-properties.js: Added.
    * fast/dom/HTMLProgressElement/set-progress-properties.html: Added.
    * platform/gtk/Skipped:
    * platform/mac/Skipped:
    * platform/qt/fast/dom/HTMLProgressElement: Added.
    * platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.checksum: Added.
    * platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.png: Added.
    * platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.txt: Added.
    * platform/qt/fast/dom/HTMLProgressElement/set-progress-properties-expected.txt: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55980 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ec10691..e0cf26b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,24 @@
+2010-03-14  Yael Aharon  <yael.aharon at nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Support for HTMLProgressElement
+        https://bugs.webkit.org/show_bug.cgi?id=35937
+
+        * fast/dom/HTMLProgressElement: Added.
+        * fast/dom/HTMLProgressElement/progress-element.html: Added.
+        * fast/dom/HTMLProgressElement/script-tests: Added.
+        * fast/dom/HTMLProgressElement/script-tests/TEMPLATE.html: Added.
+        * fast/dom/HTMLProgressElement/script-tests/set-progress-properties.js: Added.
+        * fast/dom/HTMLProgressElement/set-progress-properties.html: Added.
+        * platform/gtk/Skipped:
+        * platform/mac/Skipped:
+        * platform/qt/fast/dom/HTMLProgressElement: Added.
+        * platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.checksum: Added.
+        * platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.png: Added.
+        * platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.txt: Added.
+        * platform/qt/fast/dom/HTMLProgressElement/set-progress-properties-expected.txt: Added.
+
 2010-03-14  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/dom/HTMLProgressElement/progress-element.html b/LayoutTests/fast/dom/HTMLProgressElement/progress-element.html
new file mode 100644
index 0000000..fe1c579
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLProgressElement/progress-element.html
@@ -0,0 +1 @@
+<html><body><progress value=70 max=100></progress></body></html>
diff --git a/LayoutTests/fast/backgrounds/repeat/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/HTMLProgressElement/script-tests/TEMPLATE.html
similarity index 100%
copy from LayoutTests/fast/backgrounds/repeat/script-tests/TEMPLATE.html
copy to LayoutTests/fast/dom/HTMLProgressElement/script-tests/TEMPLATE.html
diff --git a/LayoutTests/fast/dom/HTMLProgressElement/script-tests/set-progress-properties.js b/LayoutTests/fast/dom/HTMLProgressElement/script-tests/set-progress-properties.js
new file mode 100644
index 0000000..8f34190
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLProgressElement/script-tests/set-progress-properties.js
@@ -0,0 +1,61 @@
+description('Test setting valid and invalid properties of HTMLProgressElement.');
+
+var p = document.createElement('progress');
+
+debug("Test values before properties were set");
+shouldBe("p.value", "1");
+shouldBe("p.max", "1");
+shouldBe("p.position", "-1");
+
+debug("Set valid values");
+p.value = 7e1;
+p.max = "1e2";
+shouldBe("p.value", "70");
+shouldBe("p.max", "100");
+shouldBe("p.position", "0.7");
+
+debug("Set value bigger than max");
+p.value = 200;
+p.max = 100.0;
+shouldBe("p.value", "100");
+shouldBe("p.max", "100");
+shouldBe("p.position", "1");
+
+debug("Set invalid value");
+p.value = "200A";
+p.max = 100;
+shouldBe("p.value", "0");
+shouldBe("p.max", "100");
+shouldBe("p.position", "0");
+
+debug("Set invalid max");
+p.value = "20";
+p.max = "max";
+shouldBe("p.value", "1");
+shouldBe("p.max", "1");
+shouldBe("p.position", "1");
+
+debug("Set value to null and max to 0");
+p.value = null;
+p.max = 0;
+shouldBe("p.value", "0");
+shouldBe("p.max", "1");
+shouldBe("p.position", "0");
+
+debug("Set attributes to valid numbers");
+p.setAttribute("value", 5);
+p.setAttribute("max", 10);
+shouldBe("p.value", "5");
+shouldBe("p.max", "10");
+shouldBe("parseInt(p.getAttribute('value'))", "5");
+shouldBe("parseInt(p.getAttribute('max'))", "10");
+
+debug("Set attributes to invalid values");
+p.setAttribute("value", "ABC");
+p.setAttribute("max", "#");
+shouldBe("p.value", "0");
+shouldBe("p.max", "1");
+shouldBe("p.getAttribute('value')", "'ABC'");
+shouldBe("p.getAttribute('max')", "'#'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties.html b/LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties.html
new file mode 100644
index 0000000..f0054f9
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/set-progress-properties.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index 16b90b1..ef21a2c 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -5823,6 +5823,10 @@ fast/forms/multiple-form-submission-protection-mouse.html
 # mouseScrollBy() is not yet implemented in the GTK EventSender API.
 fast/events/remove-child-onscroll.html
 
+# renderTheme is not ready to draw progress element
+fast/dom/HTMLProgressElement/progress-element.html
+fast/dom/HTMLProgressElement/set-progress-properties.html
+
 # For some reason it fails on DRT, although works on GtkLauncher and other ports' DRT.
 # https://bugs.webkit.org/show_bug.cgi?id=35984
 fast/events/spatial-navigation/snav-iframe-with-offscreen-focusable-element.html
diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped
index 9c4b36e..2cd63f6 100644
--- a/LayoutTests/platform/mac/Skipped
+++ b/LayoutTests/platform/mac/Skipped
@@ -129,5 +129,11 @@ fast/events/spatial-navigation
 # For some reason crashes when run with all tests. Passes individually.
 fast/forms/multiple-form-submission-protection-mouse.html
 
+
+# renderTheme is not ready to draw progress element
+fast/dom/HTMLProgressElement/progress-element.html
+fast/dom/HTMLProgressElement/set-progress-properties.html
+
 # event.dataTransfer.setData('text/uri-list') not correctly implemented on Mac
 editing/pasteboard/dataTransfer-setData-getData.html
+
diff --git a/LayoutTests/platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.checksum b/LayoutTests/platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.checksum
new file mode 100644
index 0000000..7315d91
--- /dev/null
+++ b/LayoutTests/platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.checksum
@@ -0,0 +1 @@
+01cffd99b50c78bcdf93d23f1c20cc02
\ No newline at end of file
diff --git a/LayoutTests/platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.png b/LayoutTests/platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.png
new file mode 100644
index 0000000..a83e57a
Binary files /dev/null and b/LayoutTests/platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.png differ
diff --git a/LayoutTests/platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.txt b/LayoutTests/platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.txt
new file mode 100644
index 0000000..960501e
--- /dev/null
+++ b/LayoutTests/platform/qt/fast/dom/HTMLProgressElement/progress-element-expected.txt
@@ -0,0 +1,7 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderProgress {PROGRESS} at (2,2) size 120x20
+      RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/qt/fast/dom/HTMLProgressElement/set-progress-properties-expected.txt b/LayoutTests/platform/qt/fast/dom/HTMLProgressElement/set-progress-properties-expected.txt
new file mode 100644
index 0000000..d58e9ae
--- /dev/null
+++ b/LayoutTests/platform/qt/fast/dom/HTMLProgressElement/set-progress-properties-expected.txt
@@ -0,0 +1,43 @@
+Test setting valid and invalid properties of HTMLProgressElement.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Test values before properties were set
+PASS p.value is 1
+PASS p.max is 1
+PASS p.position is -1
+Set valid values
+PASS p.value is 70
+PASS p.max is 100
+PASS p.position is 0.7
+Set value bigger than max
+PASS p.value is 100
+PASS p.max is 100
+PASS p.position is 1
+Set invalid value
+PASS p.value is 0
+PASS p.max is 100
+PASS p.position is 0
+Set invalid max
+PASS p.value is 1
+PASS p.max is 1
+PASS p.position is 1
+Set value to null and max to 0
+PASS p.value is 0
+PASS p.max is 1
+PASS p.position is 0
+Set attributes to valid numbers
+PASS p.value is 5
+PASS p.max is 10
+PASS parseInt(p.getAttribute('value')) is 5
+PASS parseInt(p.getAttribute('max')) is 10
+Set attributes to invalid values
+PASS p.value is 0
+PASS p.max is 1
+PASS p.getAttribute('value') is 'ABC'
+PASS p.getAttribute('max') is '#'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a98099e..d4ebacd 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,81 @@
+2010-03-14  Yael Aharon  <yael.aharon at nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Support for HTMLProgressElement
+        https://bugs.webkit.org/show_bug.cgi?id=35937
+
+        Added support for HTMLProgressElement.
+        This implementation is enabled only for Qt, because only RenderThemeQt
+        was modified to actually draw the progress element.
+        The labels attribute of the progress element will be implemented in a
+        separate patch.
+
+        Tests: fast/dom/HTMLProgressElement/progress-element.html
+               fast/dom/HTMLProgressElement/set-progress-properties.html
+
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pri:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::extractPseudoType):
+        * css/CSSValueKeywords.in:
+        * css/html.css:
+        * html/HTMLElement.cpp:
+        (WebCore::inlineTagList):
+        * html/HTMLElementsAllInOne.cpp:
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::HTMLFormControlElement):
+        * html/HTMLFormControlElement.h:
+        * html/HTMLProgressElement.cpp: Added.
+        (WebCore::HTMLProgressElement::HTMLProgressElement):
+        (WebCore::HTMLProgressElement::create):
+        (WebCore::HTMLProgressElement::createRenderer):
+        (WebCore::HTMLProgressElement::formControlType):
+        (WebCore::HTMLProgressElement::parseMappedAttribute):
+        (WebCore::HTMLProgressElement::value):
+        (WebCore::HTMLProgressElement::setValue):
+        (WebCore::HTMLProgressElement::max):
+        (WebCore::HTMLProgressElement::setMax):
+        (WebCore::HTMLProgressElement::position):
+        * html/HTMLProgressElement.h: Added.
+        (WebCore::HTMLProgressElement::isOptionalFormControl):
+        * html/HTMLProgressElement.idl: Added.
+        * html/HTMLTagNames.in:
+        * page/DOMWindow.idl:
+        * platform/ThemeTypes.h:
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::adjustProgressBarStyle):
+        (WebCore::RenderThemeQt::paintProgressBar):
+        * platform/qt/RenderThemeQt.h:
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isProgress):
+        * rendering/RenderProgress.cpp: Added.
+        (WebCore::RenderProgress::RenderProgress):
+        (WebCore::RenderProgress::baselinePosition):
+        (WebCore::RenderProgress::calcPrefWidths):
+        (WebCore::RenderProgress::layout):
+        (WebCore::RenderProgress::updateFromElement):
+        * rendering/RenderProgress.h: Added.
+        (WebCore::RenderProgress::renderName):
+        (WebCore::RenderProgress::isProgress):
+        (WebCore::toRenderProgress):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::adjustStyle):
+        (WebCore::RenderTheme::paint):
+        (WebCore::RenderTheme::paintBorderOnly):
+        (WebCore::RenderTheme::paintDecorations):
+        (WebCore::RenderTheme::adjustProgressBarStyle):
+        * rendering/RenderTheme.h:
+        (WebCore::RenderTheme::paintProgressBar):
+
 2010-03-14  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index 17d8ad9..0de0b9d 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -143,6 +143,7 @@
 #include "JSHTMLParagraphElement.cpp"
 #include "JSHTMLParamElement.cpp"
 #include "JSHTMLPreElement.cpp"
+#include "JSHTMLProgressElement.cpp"
 #include "JSHTMLQuoteElement.cpp"
 #include "JSHTMLScriptElement.cpp"
 #include "JSHTMLSelectElement.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index d5fd2c1..06eeb8c 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -185,6 +185,7 @@ DOM_CLASSES = \
     HTMLParagraphElement \
     HTMLParamElement \
     HTMLPreElement \
+    HTMLProgressElement \
     HTMLQuoteElement \
     HTMLScriptElement \
     HTMLSelectElement \
@@ -620,6 +621,10 @@ ifeq ($(findstring ENABLE_DATALIST,$(FEATURE_DEFINES)), ENABLE_DATALIST)
     HTML_FLAGS := $(HTML_FLAGS) ENABLE_DATALIST=1
 endif
 
+ifeq ($(findstring ENABLE_PROGRESS_TAG,$(FEATURE_DEFINES)), ENABLE_PROGRESS_TAG)
+    HTML_FLAGS := $(HTML_FLAGS) ENABLE_PROGRESS_TAG=1
+endif
+
 ifeq ($(findstring ENABLE_VIDEO,$(FEATURE_DEFINES)), ENABLE_VIDEO)
     HTML_FLAGS := $(HTML_FLAGS) ENABLE_VIDEO=1
 endif
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 13c1ec6..e563e41 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -240,6 +240,7 @@ IDL_BINDINGS += \
 	WebCore/html/HTMLParagraphElement.idl \
 	WebCore/html/HTMLParamElement.idl \
 	WebCore/html/HTMLPreElement.idl \
+	WebCore/html/HTMLProgressElement.idl \
 	WebCore/html/HTMLQuoteElement.idl \
 	WebCore/html/HTMLScriptElement.idl \
 	WebCore/html/HTMLSelectElement.idl \
@@ -1145,6 +1146,8 @@ webcore_sources += \
 	WebCore/html/HTMLPlugInImageElement.h \
 	WebCore/html/HTMLPreElement.cpp \
 	WebCore/html/HTMLPreElement.h \
+	WebCore/html/HTMLProgressElement.cpp \
+	WebCore/html/HTMLProgressElement.h \
 	WebCore/html/HTMLQuoteElement.cpp \
 	WebCore/html/HTMLQuoteElement.h \
 	WebCore/html/HTMLScriptElement.cpp \
@@ -1846,6 +1849,8 @@ webcore_sources += \
 	WebCore/rendering/RenderPart.h \
 	WebCore/rendering/RenderPartObject.cpp \
 	WebCore/rendering/RenderPartObject.h \
+	WebCore/rendering/RenderProgress.cpp \
+	WebCore/rendering/RenderProgress.h \
 	WebCore/rendering/RenderReplaced.cpp \
 	WebCore/rendering/RenderReplaced.h \
 	WebCore/rendering/RenderReplica.cpp \
@@ -2170,6 +2175,14 @@ webcore_cppflags += \
 	-DENABLE_DATAGRID=0
 
 # ----
+# HTML Progress Element - disable for now, since painting code is missing.
+# ----
+FEATURE_DEFINES += ENABLE_PROGRESS_TAG=0
+
+webcore_cppflags += \
+	-DENABLE_PROGRESS_TAG=0
+
+# ----
 # JavaScript Debugger/Profiler
 # ----
 if ENABLE_JAVASCRIPT_DEBUGGER
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 6bbdc04..8e59742 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -163,6 +163,7 @@
             'html/HTMLParagraphElement.idl',
             'html/HTMLParamElement.idl',
             'html/HTMLPreElement.idl',
+            'html/HTMLProgressElement.idl',
             'html/HTMLQuoteElement.idl',
             'html/HTMLScriptElement.idl',
             'html/HTMLSelectElement.idl',
@@ -1557,6 +1558,8 @@
             'html/HTMLPlugInImageElement.h',
             'html/HTMLPreElement.cpp',
             'html/HTMLPreElement.h',
+            'html/HTMLProgressElement.cpp',
+            'html/HTMLProgressElement.h',
             'html/HTMLQuoteElement.cpp',
             'html/HTMLQuoteElement.h',
             'html/HTMLScriptElement.cpp',
@@ -3099,6 +3102,8 @@
             'rendering/RenderPartObject.h',
             'rendering/RenderPath.cpp',
             'rendering/RenderPath.h',
+            'rendering/RenderProgress.cpp',
+            'rendering/RenderProgress.h',
             'rendering/RenderReplaced.cpp',
             'rendering/RenderReplaced.h',
             'rendering/RenderReplica.cpp',
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index b01e9b2..01a8174 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -54,6 +54,7 @@ contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
 !contains(DEFINES, ENABLE_VIDEO=.): DEFINES += ENABLE_VIDEO=1
 !contains(DEFINES, ENABLE_RUBY=.): DEFINES += ENABLE_RUBY=1
 !contains(DEFINES, ENABLE_SANDBOX=.): DEFINES += ENABLE_SANDBOX=1
+!contains(DEFINES, ENABLE_PROGRESS_TAG=.): DEFINES += ENABLE_PROGRESS_TAG=1
 !contains(DEFINES, ENABLE_BLOB_SLICE=.): DEFINES += ENABLE_BLOB_SLICE=0
 
 greaterThan(QT_MINOR_VERSION, 5) {
@@ -368,6 +369,7 @@ IDL_BINDINGS += \
     html/HTMLParagraphElement.idl \
     html/HTMLParamElement.idl \
     html/HTMLPreElement.idl \
+    html/HTMLProgressElement.idl \
     html/HTMLQuoteElement.idl \
     html/HTMLScriptElement.idl \
     html/HTMLSelectElement.idl \
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 1f89f56..9813c5c 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -666,6 +666,7 @@ SOURCES += \
     html/HTMLPlugInElement.cpp \
     html/HTMLPlugInImageElement.cpp \
     html/HTMLPreElement.cpp \
+    html/HTMLProgressElement.cpp \
     html/HTMLQuoteElement.cpp \
     html/HTMLScriptElement.cpp \
     html/HTMLSelectElement.cpp \
@@ -930,6 +931,7 @@ SOURCES += \
     rendering/RenderObjectChildList.cpp \
     rendering/RenderPart.cpp \
     rendering/RenderPartObject.cpp \
+    rendering/RenderProgress.cpp \
     rendering/RenderReplaced.cpp \
     rendering/RenderReplica.cpp \
     rendering/RenderRuby.cpp \
@@ -1368,6 +1370,7 @@ HEADERS += \
     html/HTMLPlugInElement.h \
     html/HTMLPlugInImageElement.h \
     html/HTMLPreElement.h \
+    html/HTMLProgressElement.h \
     html/HTMLQuoteElement.h \
     html/HTMLScriptElement.h \
     html/HTMLSelectElement.h \
@@ -1674,6 +1677,7 @@ HEADERS += \
     rendering/RenderPart.h \
     rendering/RenderPartObject.h \
     rendering/RenderPath.h \
+    rendering/RenderProgress.h \
     rendering/RenderReplaced.h \
     rendering/RenderReplica.h \
     rendering/RenderRuby.h \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 3b674c3..72b3d44 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -6885,6 +6885,62 @@
 				>
 			</File>
 			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHTMLProgressElement.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_Internal|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_Cairo|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release_Cairo|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_All|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHTMLProgressElement.h"
+				>
+			</File>
+			<File
 				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHTMLQuoteElement.cpp"
 				>
 				<FileConfiguration
@@ -27469,6 +27525,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\rendering\RenderProgress.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\rendering\RenderProgress.h"
+				>
+			</File>
+			<File
 				RelativePath="..\rendering\RenderReplaced.cpp"
 				>
 			</File>
@@ -33213,6 +33277,62 @@
 				>
 			</File>
 			<File
+				RelativePath="..\html\HTMLProgressElement.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_Internal|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_Cairo|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release_Cairo|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_All|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\html\HTMLProgressElement.h"
+				>
+			</File>
+			<File
 				RelativePath="..\html\HTMLQuoteElement.cpp"
 				>
 				<FileConfiguration
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index c829659..2821067 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -2485,6 +2485,10 @@
 		9F72305111184B4100AD0126 /* ScriptProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F72304E11184B4100AD0126 /* ScriptProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */; };
 		A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */; };
+		A43BF5981149290A00C643CA /* HTMLProgressElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A43BF5961149290A00C643CA /* HTMLProgressElement.cpp */; };
+		A43BF5991149290A00C643CA /* HTMLProgressElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A43BF5971149290A00C643CA /* HTMLProgressElement.h */; };
+		A43BF59C1149292800C643CA /* RenderProgress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A43BF59A1149292800C643CA /* RenderProgress.cpp */; };
+		A43BF59D1149292800C643CA /* RenderProgress.h in Headers */ = {isa = PBXBuildFile; fileRef = A43BF59B1149292800C643CA /* RenderProgress.h */; };
 		A718760E0B2A120100A16ECE /* DragActions.h in Headers */ = {isa = PBXBuildFile; fileRef = A718760D0B2A120100A16ECE /* DragActions.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A71878900B2D04AC00A16ECE /* DragControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */; };
 		A7352C190B1BB89D00A986D0 /* RenderSVGBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7352C170B1BB89D00A986D0 /* RenderSVGBlock.cpp */; };
@@ -7875,6 +7879,10 @@
 		9F72304E11184B4100AD0126 /* ScriptProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptProfiler.h; sourceTree = "<group>"; };
 		A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLElementFactory.cpp; sourceTree = "<group>"; };
 		A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLElementFactory.h; sourceTree = "<group>"; };
+		A43BF5961149290A00C643CA /* HTMLProgressElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLProgressElement.cpp; sourceTree = "<group>"; };
+		A43BF5971149290A00C643CA /* HTMLProgressElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLProgressElement.h; sourceTree = "<group>"; };
+		A43BF59A1149292800C643CA /* RenderProgress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderProgress.cpp; sourceTree = "<group>"; };
+		A43BF59B1149292800C643CA /* RenderProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderProgress.h; sourceTree = "<group>"; };
 		A718760D0B2A120100A16ECE /* DragActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragActions.h; sourceTree = "<group>"; };
 		A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragControllerMac.mm; sourceTree = "<group>"; };
 		A7352C170B1BB89D00A986D0 /* RenderSVGBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGBlock.cpp; sourceTree = "<group>"; };
@@ -12865,6 +12873,8 @@
 		93EEC1EC09C2877700C515D1 /* html */ = {
 			isa = PBXGroup;
 			children = (
+				A43BF5961149290A00C643CA /* HTMLProgressElement.cpp */,
+				A43BF5971149290A00C643CA /* HTMLProgressElement.h */,
 				49484FAE102CF01E00187DD3 /* canvas */,
 				2EAFAF0B10E2AF2D007ED3D6 /* Blob.cpp */,
 				2EAFAF0C10E2AF2D007ED3D6 /* Blob.h */,
@@ -15663,6 +15673,8 @@
 		F523D2F302DE443B018635CA /* rendering */ = {
 			isa = PBXGroup;
 			children = (
+				A43BF59A1149292800C643CA /* RenderProgress.cpp */,
+				A43BF59B1149292800C643CA /* RenderProgress.h */,
 				BC8C8FAA0DDCD2F200B592F4 /* style */,
 				A8CFF04B0A154F09000A4234 /* AutoTableLayout.cpp */,
 				A8CFF0490A154F09000A4234 /* AutoTableLayout.h */,
@@ -18655,6 +18667,8 @@
 				E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
 				97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
 				CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
+				A43BF5991149290A00C643CA /* HTMLProgressElement.h in Headers */,
+				A43BF59D1149292800C643CA /* RenderProgress.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -20856,6 +20870,8 @@
 				93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
 				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
 				97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
+				A43BF5981149290A00C643CA /* HTMLProgressElement.cpp in Sources */,
+				A43BF59C1149292800C643CA /* RenderProgress.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h
index c20448e..223b515 100644
--- a/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/WebCore/css/CSSPrimitiveValueMappings.h
@@ -275,6 +275,11 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e)
         case OuterSpinButtonPart:
             m_value.ident = CSSValueOuterSpinButton;
             break;
+        case ProgressBarPart:
+#if ENABLE(PROGRESS_BAR)
+            m_value.ident = CSSValueProgressBar;
+#endif
+            break;
         case SliderHorizontalPart:
             m_value.ident = CSSValueSliderHorizontal;
             break;
diff --git a/WebCore/css/CSSSelector.cpp b/WebCore/css/CSSSelector.cpp
index 9ae9b9f..6475832 100644
--- a/WebCore/css/CSSSelector.cpp
+++ b/WebCore/css/CSSSelector.cpp
@@ -129,6 +129,9 @@ void CSSSelector::extractPseudoType() const
     DEFINE_STATIC_LOCAL(AtomicString, onlyOfType, ("only-of-type"));
     DEFINE_STATIC_LOCAL(AtomicString, optional, ("optional"));
     DEFINE_STATIC_LOCAL(AtomicString, outerSpinButton, ("-webkit-outer-spin-button"));
+#if ENABLE(PROGRESS_BAR)
+    DEFINE_STATIC_LOCAL(AtomicString, progressBar, ("-webkit-progress-bar"));
+#endif
     DEFINE_STATIC_LOCAL(AtomicString, required, ("required"));
     DEFINE_STATIC_LOCAL(AtomicString, resizer, ("-webkit-resizer"));
     DEFINE_STATIC_LOCAL(AtomicString, root, ("root"));
diff --git a/WebCore/css/CSSValueKeywords.in b/WebCore/css/CSSValueKeywords.in
index 87e2569..e684daf 100644
--- a/WebCore/css/CSSValueKeywords.in
+++ b/WebCore/css/CSSValueKeywords.in
@@ -582,6 +582,7 @@ menulist-button
 menulist-text
 menulist-textfield
 outer-spin-button
+progress-bar
 slider-horizontal
 slider-vertical
 sliderthumb-horizontal
diff --git a/WebCore/css/html.css b/WebCore/css/html.css
index be10d61..d036be0 100644
--- a/WebCore/css/html.css
+++ b/WebCore/css/html.css
@@ -515,6 +515,19 @@ option {
     font-weight: normal;
 }
 
+/* progress */
+
+progress {
+    -webkit-appearance: progress-bar;
+    padding: initial;
+    border: initial;
+    margin: 2px;
+}
+
+progress::-webkit-progress-bar {
+    -webkit-appearance: progress-bar;
+}
+
 /* datagrid */
 
 datagrid {
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index 3dec712..c224913 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -854,6 +854,9 @@ static HashSet<AtomicStringImpl*>* inlineTagList()
         tagList.add(rpTag.localName().impl());
         tagList.add(rtTag.localName().impl());
         tagList.add(rubyTag.localName().impl());
+#if ENABLE(PROGRESS_TAG)
+        tagList.add(progressTag.localName().impl());
+#endif
     }
     return &tagList;
 }
diff --git a/WebCore/html/HTMLElementsAllInOne.cpp b/WebCore/html/HTMLElementsAllInOne.cpp
index f9c970a..4cee927 100644
--- a/WebCore/html/HTMLElementsAllInOne.cpp
+++ b/WebCore/html/HTMLElementsAllInOne.cpp
@@ -87,6 +87,7 @@
 #include "HTMLPlugInElement.cpp"
 #include "HTMLPlugInImageElement.cpp"
 #include "HTMLPreElement.cpp"
+#include "HTMLProgressElement.cpp"
 #include "HTMLQuoteElement.cpp"
 #include "HTMLScriptElement.cpp"
 #include "HTMLSelectElement.cpp"
diff --git a/WebCore/html/HTMLFormControlElement.cpp b/WebCore/html/HTMLFormControlElement.cpp
index 6f24e0c..b6a13ec 100644
--- a/WebCore/html/HTMLFormControlElement.cpp
+++ b/WebCore/html/HTMLFormControlElement.cpp
@@ -49,8 +49,8 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* f)
-    : HTMLElement(tagName, doc)
+HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* f, ConstructionType constructionType)
+    : HTMLElement(tagName, doc, constructionType)
     , m_form(f)
     , m_hasName(false)
     , m_disabled(false)
diff --git a/WebCore/html/HTMLFormControlElement.h b/WebCore/html/HTMLFormControlElement.h
index 117087b..224ecbd 100644
--- a/WebCore/html/HTMLFormControlElement.h
+++ b/WebCore/html/HTMLFormControlElement.h
@@ -36,7 +36,7 @@ class VisibleSelection;
 
 class HTMLFormControlElement : public HTMLElement {
 public:
-    HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*);
+    HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*, ConstructionType = CreateElementZeroRefCount);
     virtual ~HTMLFormControlElement();
 
     virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
diff --git a/WebCore/html/HTMLProgressElement.cpp b/WebCore/html/HTMLProgressElement.cpp
new file mode 100644
index 0000000..95b9391
--- /dev/null
+++ b/WebCore/html/HTMLProgressElement.cpp
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#if ENABLE(PROGRESS_TAG)
+#include "HTMLProgressElement.h"
+
+#include "EventNames.h"
+#include "FormDataList.h"
+#include "HTMLFormElement.h"
+#include "HTMLNames.h"
+#include "MappedAttribute.h"
+#include "RenderProgress.h"
+#include <wtf/StdLibExtras.h>
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
+    : HTMLFormControlElement(tagName, document, form, CreateElement)
+{
+    ASSERT(hasTagName(progressTag));
+}
+
+PassRefPtr<HTMLProgressElement> HTMLProgressElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
+{
+    return adoptRef(new HTMLProgressElement(tagName, document, form));
+}
+
+RenderObject* HTMLProgressElement::createRenderer(RenderArena* arena, RenderStyle* style)
+{
+    return new (arena) RenderProgress(this);
+}
+
+const AtomicString& HTMLProgressElement::formControlType() const
+{
+    DEFINE_STATIC_LOCAL(const AtomicString, progress, ("progress"));
+    return progress;
+}
+
+void HTMLProgressElement::parseMappedAttribute(MappedAttribute* attribute)
+{
+    if (attribute->name() == valueAttr)
+        setNeedsStyleRecalc();
+    else if (attribute->name() == maxAttr)
+        setNeedsStyleRecalc();
+    else
+        HTMLFormControlElement::parseMappedAttribute(attribute);
+}
+
+double HTMLProgressElement::value() const
+{
+    const AtomicString& valueString = getAttribute(valueAttr);
+    bool ok;
+    double value = valueString.toDouble(&ok);
+    if (!ok || value < 0)
+        return valueString.isNull() ? 1 : 0;
+    return (value > max()) ? max() : value;
+}
+
+void HTMLProgressElement::setValue(double value)
+{
+    setAttribute(valueAttr, String::number(value >= 0 ? value : 0));
+}
+
+double HTMLProgressElement::max() const
+{
+    bool ok;
+    double max = getAttribute(maxAttr).toDouble(&ok);
+    if (!ok || max <= 0)
+        return 1;
+    return max;
+}
+
+void HTMLProgressElement::setMax(double max)
+{
+    setAttribute(maxAttr, String::number(max > 0 ? max : 1));
+}
+
+double HTMLProgressElement::position() const
+{
+    if (!hasAttribute(valueAttr))
+        return -1;
+    return value() / max();
+}
+
+} // namespace
+#endif
diff --git a/WebCore/html/HTMLProgressElement.h b/WebCore/html/HTMLProgressElement.h
new file mode 100644
index 0000000..a925fc5
--- /dev/null
+++ b/WebCore/html/HTMLProgressElement.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef HTMLProgressElement_h
+#define HTMLProgressElement_h
+
+#if ENABLE(PROGRESS_TAG)
+#include "HTMLFormControlElement.h"
+
+namespace WebCore {
+
+class HTMLProgressElement : public HTMLFormControlElement {
+public:
+    static PassRefPtr<HTMLProgressElement> create(const QualifiedName&, Document*, HTMLFormElement* = 0);
+
+    double value() const;
+    void setValue(double);
+
+    double max() const;
+    void setMax(double);
+
+    double position() const;
+
+private:
+    HTMLProgressElement(const QualifiedName&, Document*, HTMLFormElement*);
+
+    virtual bool isOptionalFormControl() const { return true; }
+
+    virtual const AtomicString& formControlType() const;
+
+    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
+
+    virtual void parseMappedAttribute(MappedAttribute*);
+};
+
+} // namespace
+
+#endif
+#endif
diff --git a/WebCore/html/HTMLProgressElement.idl b/WebCore/html/HTMLProgressElement.idl
new file mode 100644
index 0000000..8da62aa
--- /dev/null
+++ b/WebCore/html/HTMLProgressElement.idl
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+module html {
+    interface [
+        Conditional=PROGRESS_TAG
+    ] HTMLProgressElement : HTMLElement {
+                 attribute  double                value;
+                 attribute  double                max;
+        readonly attribute  double                position;
+        readonly attribute  HTMLFormElement       form;
+    };
+
+}
diff --git a/WebCore/html/HTMLTagNames.in b/WebCore/html/HTMLTagNames.in
index 87c7288..9f4900c 100644
--- a/WebCore/html/HTMLTagNames.in
+++ b/WebCore/html/HTMLTagNames.in
@@ -90,6 +90,7 @@ p interfaceName=HTMLParagraphElement, createWithNew
 param createWithNew
 plaintext interfaceName=HTMLElement
 pre createWithNew
+progress interfaceName=HTMLProgressElement, conditional=PROGRESS_TAG
 q interfaceName=HTMLQuoteElement, createWithNew
 rp interfaceName=HTMLElement, conditional=RUBY
 rt interfaceName=HTMLElement, conditional=RUBY
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index 2231411..c1b6a06 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -420,6 +420,9 @@ module window {
         attribute HTMLParagraphElementConstructor HTMLParagraphElement;
         attribute HTMLParamElementConstructor HTMLParamElement;
         attribute HTMLPreElementConstructor HTMLPreElement;
+#if defined(ENABLE_PROGRESS_TAG) && ENABLE_PROGRESS_TAG
+        attribute HTMLProgressElementConstructor HTMLProgressElement;
+#endif
         attribute HTMLQuoteElementConstructor HTMLQuoteElement;
         attribute HTMLScriptElementConstructor HTMLScriptElement;
         attribute HTMLSelectElementConstructor HTMLSelectElement;
diff --git a/WebCore/platform/ThemeTypes.h b/WebCore/platform/ThemeTypes.h
index 9c2366e..07a11fb 100644
--- a/WebCore/platform/ThemeTypes.h
+++ b/WebCore/platform/ThemeTypes.h
@@ -52,7 +52,7 @@ enum ControlPart {
     MediaSeekForwardButtonPart, MediaRewindButtonPart, MediaReturnToRealtimeButtonPart, MediaToggleClosedCaptionsButtonPart,
     MediaSliderPart, MediaSliderThumbPart, MediaVolumeSliderContainerPart, MediaVolumeSliderPart, MediaVolumeSliderThumbPart,
     MediaControlsBackgroundPart, MediaCurrentTimePart, MediaTimeRemainingPart,
-    MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart, OuterSpinButtonPart,
+    MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart, OuterSpinButtonPart, ProgressBarPart,
     SliderHorizontalPart, SliderVerticalPart, SliderThumbHorizontalPart,
     SliderThumbVerticalPart, CaretPart, SearchFieldPart, SearchFieldDecorationPart,
     SearchFieldResultsDecorationPart, SearchFieldResultsButtonPart,
diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp
index af58356..8fe653a 100644
--- a/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/WebCore/platform/qt/RenderThemeQt.cpp
@@ -41,11 +41,17 @@
 #include "GraphicsContext.h"
 #include "HTMLInputElement.h"
 #include "HTMLMediaElement.h"
+#if ENABLE(PROGRESS_TAG)
+#include "HTMLProgressElement.h"
+#endif
 #include "HTMLNames.h"
 #include "NotImplemented.h"
 #include "Page.h"
 #include "QWebPageClient.h"
 #include "RenderBox.h"
+#if ENABLE(PROGRESS_TAG)
+#include "RenderProgress.h"
+#endif
 #include "RenderSlider.h"
 #include "RenderTheme.h"
 #include "TimeRanges.h"
@@ -63,6 +69,9 @@
 #include <QStyleFactory>
 #include <QStyleOptionButton>
 #include <QStyleOptionFrameV2>
+#if ENABLE(PROGRESS_TAG)
+#include <QStyleOptionProgressBarV2>
+#endif
 #include <QStyleOptionSlider>
 #include <QWidget>
 
@@ -632,6 +641,42 @@ bool RenderThemeQt::paintMenuListButton(RenderObject* o, const RenderObject::Pai
     return false;
 }
 
+#if ENABLE(PROGRESS_TAG)
+void RenderThemeQt::adjustProgressBarStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
+{
+    style->setBoxShadow(0);
+}
+
+bool RenderThemeQt::paintProgressBar(RenderObject* o, const RenderObject::PaintInfo& pi, const IntRect& r)
+{
+    StylePainter p(this, pi);
+    if (!p.isValid())
+       return true;
+
+    QStyleOptionProgressBarV2 option;
+    if (p.widget)
+       option.initFrom(p.widget);
+    initializeCommonQStyleOptions(option, o);
+
+    RenderProgress* renderProgress = toRenderProgress(o);
+    HTMLProgressElement* element = static_cast<HTMLProgressElement*>(renderProgress->node());
+    option.rect = r;
+    option.maximum = element->max();
+    option.minimum = 0;
+    option.progress = element->value();
+
+    const QPoint topLeft = r.topLeft();
+    p.painter->translate(topLeft);
+    option.rect.moveTo(QPoint(0, 0));
+    option.rect.setSize(r.size());
+
+    p.drawControl(QStyle::CE_ProgressBar, option);
+    p.painter->translate(-topLeft);
+
+    return false;
+}
+#endif
+
 bool RenderThemeQt::paintSliderTrack(RenderObject* o, const RenderObject::PaintInfo& pi,
                                      const IntRect& r)
 {
diff --git a/WebCore/platform/qt/RenderThemeQt.h b/WebCore/platform/qt/RenderThemeQt.h
index 8a22df1..5c0e53f 100644
--- a/WebCore/platform/qt/RenderThemeQt.h
+++ b/WebCore/platform/qt/RenderThemeQt.h
@@ -101,6 +101,11 @@ protected:
     virtual bool paintMenuListButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
     virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
+#if ENABLE(PROGRESS_TAG)
+    virtual void adjustProgressBarStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintProgressBar(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+#endif
+
     virtual bool paintSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
     virtual void adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h
index f7b460a..5e78bbd 100644
--- a/WebCore/rendering/RenderObject.h
+++ b/WebCore/rendering/RenderObject.h
@@ -277,6 +277,9 @@ public:
     virtual bool isListMarker() const { return false; }
     virtual bool isMedia() const { return false; }
     virtual bool isMenuList() const { return false; }
+#if ENABLE(PROGRESS_TAG)
+    virtual bool isProgress() const { return false; }
+#endif
     virtual bool isRenderBlock() const { return false; }
     virtual bool isRenderButton() const { return false; }
     virtual bool isRenderImage() const { return false; }
diff --git a/WebCore/rendering/RenderProgress.cpp b/WebCore/rendering/RenderProgress.cpp
new file mode 100644
index 0000000..985e97a
--- /dev/null
+++ b/WebCore/rendering/RenderProgress.cpp
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#if ENABLE(PROGRESS_TAG)
+
+#include "RenderProgress.h"
+
+#include "HTMLProgressElement.h"
+#include "RenderTheme.h"
+
+using namespace std;
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+static const int defaultProgressWidth = 120;
+static const int defaultProgressHeight = 20;
+
+RenderProgress::RenderProgress(HTMLProgressElement* element)
+    : RenderBlock(element)
+{
+    setSize(IntSize(defaultProgressWidth, defaultProgressHeight));
+    setReplaced(true);
+}
+
+int RenderProgress::baselinePosition(bool, bool) const
+{
+    return height() + marginTop();
+}
+
+void RenderProgress::calcPrefWidths()
+{
+    m_minPrefWidth = 0;
+    m_maxPrefWidth = 0;
+
+    if (style()->width().isFixed() && style()->width().value() > 0)
+        m_minPrefWidth = m_maxPrefWidth = calcContentBoxWidth(style()->width().value());
+    else
+        m_maxPrefWidth = defaultProgressWidth * style()->effectiveZoom();
+
+    if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
+        m_maxPrefWidth = max(m_maxPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
+        m_minPrefWidth = max(m_minPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
+    } else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent()))
+        m_minPrefWidth = 0;
+    else
+        m_minPrefWidth = m_maxPrefWidth;
+
+    if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
+        m_maxPrefWidth = min(m_maxPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
+        m_minPrefWidth = min(m_minPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
+    }
+
+    int toAdd = paddingLeft() + paddingRight() + borderLeft() + borderRight();
+    m_minPrefWidth += toAdd;
+    m_maxPrefWidth += toAdd;
+
+    setPrefWidthsDirty(false);
+}
+
+void RenderProgress::layout()
+{
+    ASSERT(needsLayout());
+
+    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
+
+    calcWidth();
+    calcHeight();
+
+    m_overflow.clear();
+
+    repainter.repaintAfterLayout();
+
+    setNeedsLayout(false);
+}
+
+void RenderProgress::updateFromElement()
+{
+    setNeedsLayoutAndPrefWidthsRecalc();
+}
+
+} // namespace WebCore
+#endif
diff --git a/WebCore/rendering/RenderProgress.h b/WebCore/rendering/RenderProgress.h
new file mode 100644
index 0000000..ee60d9d
--- /dev/null
+++ b/WebCore/rendering/RenderProgress.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef RenderProgress_h
+#define RenderProgress_h
+
+#if ENABLE(PROGRESS_TAG)
+#include "RenderBlock.h"
+
+namespace WebCore {
+
+class HTMLProgressElement;
+
+class RenderProgress : public RenderBlock {
+public:
+    RenderProgress(HTMLProgressElement*);
+
+private:
+    virtual const char* renderName() const { return "RenderProgress"; }
+    virtual bool isProgress() const { return true; }
+    virtual int baselinePosition(bool, bool) const;
+    virtual void calcPrefWidths();
+    virtual void layout();
+    virtual void updateFromElement();
+};
+
+inline RenderProgress* toRenderProgress(RenderObject* object)
+{
+    ASSERT(!object || object->isProgress());
+    return static_cast<RenderProgress*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toRenderProgress(const RenderProgress*);
+
+} // namespace WebCore
+
+#endif
+
+#endif // RenderProgress_h
+
diff --git a/WebCore/rendering/RenderTheme.cpp b/WebCore/rendering/RenderTheme.cpp
index 984a176..ffa3eb7 100644
--- a/WebCore/rendering/RenderTheme.cpp
+++ b/WebCore/rendering/RenderTheme.cpp
@@ -209,6 +209,10 @@ void RenderTheme::adjustStyle(CSSStyleSelector* selector, RenderStyle* style, El
             return adjustSearchFieldResultsDecorationStyle(selector, style, e);
         case SearchFieldResultsButtonPart:
             return adjustSearchFieldResultsButtonStyle(selector, style, e);
+#if ENABLE(PROGRESS_TAG)
+        case ProgressBarPart:
+            return adjustProgressBarStyle(selector, style, e);
+#endif
         default:
             break;
     }
@@ -267,6 +271,10 @@ bool RenderTheme::paint(RenderObject* o, const RenderObject::PaintInfo& paintInf
 #endif
         case MenulistPart:
             return paintMenuList(o, paintInfo, r);
+#if ENABLE(PROGRESS_TAG)
+        case ProgressBarPart:
+            return paintProgressBar(o, paintInfo, r);
+#endif
         case SliderHorizontalPart:
         case SliderVerticalPart:
             return paintSliderTrack(o, paintInfo, r);
@@ -357,6 +365,9 @@ bool RenderTheme::paintBorderOnly(RenderObject* o, const RenderObject::PaintInfo
         case DefaultButtonPart:
         case ButtonPart:
         case MenulistPart:
+#if ENABLE(PROGRESS_TAG)
+        case ProgressBarPart:
+#endif
         case SliderHorizontalPart:
         case SliderVerticalPart:
         case SliderThumbHorizontalPart:
@@ -392,6 +403,9 @@ bool RenderTheme::paintDecorations(RenderObject* o, const RenderObject::PaintInf
         case DefaultButtonPart:
         case ButtonPart:
         case MenulistPart:
+#if ENABLE(PROGRESS_TAG)
+        case ProgressBarPart:
+#endif
         case SliderHorizontalPart:
         case SliderVerticalPart:
         case SliderThumbHorizontalPart:
@@ -825,6 +839,12 @@ void RenderTheme::adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*)
 {
 }
 
+#if ENABLE(PROGRESS_TAG)
+void RenderTheme::adjustProgressBarStyle(CSSStyleSelector*, RenderStyle*, Element*) const
+{
+}
+#endif
+
 void RenderTheme::adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const
 {
 }
diff --git a/WebCore/rendering/RenderTheme.h b/WebCore/rendering/RenderTheme.h
index 0a7ea97..30c48d1 100644
--- a/WebCore/rendering/RenderTheme.h
+++ b/WebCore/rendering/RenderTheme.h
@@ -227,6 +227,11 @@ protected:
     virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
     virtual bool paintMenuListButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
 
+#if ENABLE(PROGRESS_TAG)
+    virtual void adjustProgressBarStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintProgressBar(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
+#endif
+
     virtual void adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
     virtual bool paintSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list