2010-12-15 Jarred Nicholls <jarred@sencha.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Dec 2010 16:00:48 +0000 (16:00 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Dec 2010 16:00:48 +0000 (16:00 +0000)
        Reviewed by Andreas Kling.

        [Qt] Implement the File API spec
        https://bugs.webkit.org/show_bug.cgi?id=49839

        * platform/qt/fast/dom/Window/window-properties-expected.txt:
        * platform/qt/fast/dom/Window/window-property-descriptors-expected.txt:
        * platform/qt/fast/dom/prototype-inheritance-expected.txt:
        * platform/qt/fast/js/global-constructors-expected.txt:
2010-12-15  Jarred Nicholls  <jarred@sencha.com>

        Reviewed by Andreas Kling.

        [Qt] Implement the File API spec
        https://bugs.webkit.org/show_bug.cgi?id=49839

        No new tests. fast/files tests work when manually operated.
        They do not automatically work due to Qt's inability to handle multi-file
        inputs (https://bugs.webkit.org/show_bug.cgi?id=22048) as well as Qt's DRT
        is missing an eventSender.beginDragWithFiles implementation.

        * WebCore.pri:
        * WebCore.pro:
        * features.pri:
        * platform/qt/FileSystemQt.cpp:
        (WebCore::directoryName):
        (WebCore::readFromFile):
        (WebCore::seekFile):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74115 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/qt/fast/dom/Window/window-properties-expected.txt
LayoutTests/platform/qt/fast/dom/Window/window-property-descriptors-expected.txt
LayoutTests/platform/qt/fast/dom/prototype-inheritance-expected.txt
LayoutTests/platform/qt/fast/js/global-constructors-expected.txt
WebCore/ChangeLog
WebCore/WebCore.pri
WebCore/WebCore.pro
WebCore/features.pri
WebCore/platform/qt/FileSystemQt.cpp

index 8f74dd1..81b4545 100644 (file)
@@ -1,3 +1,15 @@
+2010-12-15  Jarred Nicholls  <jarred@sencha.com>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] Implement the File API spec
+        https://bugs.webkit.org/show_bug.cgi?id=49839
+
+        * platform/qt/fast/dom/Window/window-properties-expected.txt:
+        * platform/qt/fast/dom/Window/window-property-descriptors-expected.txt:
+        * platform/qt/fast/dom/prototype-inheritance-expected.txt:
+        * platform/qt/fast/js/global-constructors-expected.txt:
+
 2010-12-15  Yury Semikhatsky  <yurys@chromium.org>
 
         Unreviewed. Rebaseline Chromium tests.
index 49c043a..24553ea 100644 (file)
@@ -2165,6 +2165,7 @@ window.constructor.prototype.clearInterval [function]
 window.constructor.prototype.clearTimeout [function]
 window.constructor.prototype.close [function]
 window.constructor.prototype.confirm [function]
+window.constructor.prototype.createObjectURL [function]
 window.constructor.prototype.dispatchEvent [function]
 window.constructor.prototype.find [function]
 window.constructor.prototype.focus [function]
@@ -2183,6 +2184,7 @@ window.constructor.prototype.releaseEvents [function]
 window.constructor.prototype.removeEventListener [function]
 window.constructor.prototype.resizeBy [function]
 window.constructor.prototype.resizeTo [function]
+window.constructor.prototype.revokeObjectURL [function]
 window.constructor.prototype.scroll [function]
 window.constructor.prototype.scrollBy [function]
 window.constructor.prototype.scrollTo [function]
index 03d0d15..dd2e3bd 100644 (file)
@@ -8,6 +8,7 @@ PASS typeof Object.getOwnPropertyDescriptor(window, 'Attr') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'Audio') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'BeforeLoadEvent') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'Blob') is 'object'
+PASS typeof Object.getOwnPropertyDescriptor(window, 'BlobBuilder') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'Boolean') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'CDATASection') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'CSSCharsetRule') is 'object'
index 3c01987..738fb95 100644 (file)
@@ -13,6 +13,8 @@ PASS inner.BeforeLoadEvent.isInner is true
 PASS inner.BeforeLoadEvent.constructor.isInner is true
 PASS inner.Blob.isInner is true
 PASS inner.Blob.constructor.isInner is true
+PASS inner.BlobBuilder.isInner is true
+PASS inner.BlobBuilder.constructor.isInner is true
 PASS inner.Boolean.isInner is true
 PASS inner.Boolean.constructor.isInner is true
 PASS inner.CDATASection.isInner is true
index aa95784..6731cba 100644 (file)
@@ -7,6 +7,7 @@ PASS Attr.toString() is '[object AttrConstructor]'
 PASS Audio.toString() is '[object AudioConstructor]'
 PASS BeforeLoadEvent.toString() is '[object BeforeLoadEventConstructor]'
 PASS Blob.toString() is '[object BlobConstructor]'
+PASS BlobBuilder.toString() is '[object BlobBuilderConstructor]'
 PASS CDATASection.toString() is '[object CDATASectionConstructor]'
 PASS CSSCharsetRule.toString() is '[object CSSCharsetRuleConstructor]'
 PASS CSSFontFaceRule.toString() is '[object CSSFontFaceRuleConstructor]'
index 2471475..aac3009 100644 (file)
@@ -1,3 +1,23 @@
+2010-12-15  Jarred Nicholls  <jarred@sencha.com>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] Implement the File API spec
+        https://bugs.webkit.org/show_bug.cgi?id=49839
+
+        No new tests. fast/files tests work when manually operated.
+        They do not automatically work due to Qt's inability to handle multi-file
+        inputs (https://bugs.webkit.org/show_bug.cgi?id=22048) as well as Qt's DRT
+        is missing an eventSender.beginDragWithFiles implementation.
+
+        * WebCore.pri:
+        * WebCore.pro:
+        * features.pri:
+        * platform/qt/FileSystemQt.cpp:
+        (WebCore::directoryName):
+        (WebCore::readFromFile):
+        (WebCore::seekFile):
+
 2010-12-14  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Alexey Proskuryakov.
index 31ba32d..bc3f595 100644 (file)
@@ -175,6 +175,7 @@ IDL_BINDINGS += \
     fileapi/FileException.idl \
     fileapi/FileList.idl \
     fileapi/FileReader.idl \
+    fileapi/FileReaderSync.idl \
     fileapi/FileSystemCallback.idl \
     fileapi/FileWriter.idl \
     fileapi/FileWriterCallback.idl \
index 3e03b99..dc2fe65 100644 (file)
@@ -3716,85 +3716,94 @@ contains(DEFINES, ENABLE_WEB_SOCKETS=1) {
     }
 }
 
-contains(DEFINES, ENABLE_3D_CANVAS=1) {
-tobe|!tobe: QT += opengl
+contains(DEFINES, ENABLE_BLOB=1) | contains(DEFINES, ENABLE_3D_CANVAS=1) {
     !v8 {
         HEADERS += \
             bindings/js/JSArrayBufferViewHelper.h
     }
 
-HEADERS += \
-        html/canvas/CanvasContextAttributes.h \
-        html/canvas/WebGLObject.h \
-        html/canvas/WebGLActiveInfo.h \
+    HEADERS += \
         html/canvas/ArrayBuffer.h \
         html/canvas/ArrayBufferView.h \
         html/canvas/DataView.h \
-        html/canvas/WebGLBuffer.h \
         html/canvas/Int8Array.h \
-        html/canvas/WebGLContextAttributes.h \
         html/canvas/Float32Array.h \
+        html/canvas/Int32Array.h \
+        html/canvas/Int16Array.h \
+        html/canvas/Uint8Array.h \
+        html/canvas/Uint32Array.h \
+        html/canvas/Uint16Array.h
+
+    !v8 {
+        SOURCES += \
+            bindings/js/JSArrayBufferCustom.cpp \
+            bindings/js/JSDataViewCustom.cpp \
+            bindings/js/JSInt8ArrayCustom.cpp \
+            bindings/js/JSFloat32ArrayCustom.cpp \
+            bindings/js/JSInt32ArrayCustom.cpp \
+            bindings/js/JSInt16ArrayCustom.cpp \
+            bindings/js/JSUint8ArrayCustom.cpp \
+            bindings/js/JSUint32ArrayCustom.cpp \
+            bindings/js/JSUint16ArrayCustom.cpp
+    }
+    SOURCES += \
+        html/canvas/ArrayBuffer.cpp \
+        html/canvas/ArrayBufferView.cpp \
+        html/canvas/DataView.cpp \
+        html/canvas/Int8Array.cpp \
+        html/canvas/Float32Array.cpp \
+        html/canvas/Int32Array.cpp \
+        html/canvas/Int16Array.cpp \
+        html/canvas/Uint8Array.cpp \
+        html/canvas/Uint32Array.cpp \
+        html/canvas/Uint16Array.cpp
+    }
+
+contains(DEFINES, ENABLE_3D_CANVAS=1) {
+    tobe|!tobe: QT += opengl
+
+    HEADERS += \
+        html/canvas/CanvasContextAttributes.h \
+        html/canvas/WebGLObject.h \
+        html/canvas/WebGLActiveInfo.h \
+        html/canvas/WebGLBuffer.h \
+        html/canvas/WebGLContextAttributes.h \
         html/canvas/WebGLExtension.h \
         html/canvas/WebGLFramebuffer.h \
         html/canvas/WebGLGetInfo.h \
-        html/canvas/Int32Array.h \
         html/canvas/WebGLProgram.h \
         html/canvas/WebGLRenderbuffer.h \
         html/canvas/WebGLRenderingContext.h \
         html/canvas/WebGLShader.h \
-        html/canvas/Int16Array.h \
         html/canvas/OESTextureFloat.h \
         html/canvas/WebGLTexture.h \
         html/canvas/WebGLUniformLocation.h \
-        html/canvas/Uint8Array.h \
-        html/canvas/Uint32Array.h \
-        html/canvas/Uint16Array.h \
         platform/graphics/Extensions3D.h \
         platform/graphics/GraphicsContext3D.h \
         platform/graphics/qt/Extensions3DQt.h
 
     !v8 {
         SOURCES += \
-                bindings/js/JSArrayBufferCustom.cpp \
-                bindings/js/JSDataViewCustom.cpp \
-                bindings/js/JSInt8ArrayCustom.cpp \
-                bindings/js/JSFloat32ArrayCustom.cpp \
-                bindings/js/JSInt32ArrayCustom.cpp \
-                bindings/js/JSWebGLRenderingContextCustom.cpp \
-                bindings/js/JSInt16ArrayCustom.cpp \
-                bindings/js/JSUint8ArrayCustom.cpp \
-                bindings/js/JSUint32ArrayCustom.cpp \
-                bindings/js/JSUint16ArrayCustom.cpp
+            bindings/js/JSWebGLRenderingContextCustom.cpp
     }
-SOURCES += \
+    SOURCES += \
         html/canvas/CanvasContextAttributes.cpp \
         html/canvas/WebGLObject.cpp \
-        html/canvas/ArrayBuffer.cpp \
-        html/canvas/ArrayBufferView.cpp \
-        html/canvas/DataView.cpp \
         html/canvas/WebGLBuffer.cpp \
-        html/canvas/Int8Array.cpp \
         html/canvas/WebGLContextAttributes.cpp \
-        html/canvas/Float32Array.cpp \
         html/canvas/WebGLExtension.cpp \
         html/canvas/WebGLFramebuffer.cpp \
         html/canvas/WebGLGetInfo.cpp \
-        html/canvas/Int32Array.cpp \
         html/canvas/WebGLProgram.cpp \
         html/canvas/WebGLRenderbuffer.cpp \
         html/canvas/WebGLRenderingContext.cpp \
         html/canvas/WebGLShader.cpp \
-        html/canvas/Int16Array.cpp \
         html/canvas/OESTextureFloat.cpp \
         html/canvas/WebGLTexture.cpp \
         html/canvas/WebGLUniformLocation.cpp \
-        html/canvas/Uint8Array.cpp \
-        html/canvas/Uint32Array.cpp \
-        html/canvas/Uint16Array.cpp \
         platform/graphics/GraphicsContext3D.cpp \
         platform/graphics/qt/Extensions3DQt.cpp \
         platform/graphics/qt/GraphicsContext3DQt.cpp
-
 }
 
 contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) {
index 82bb715..96bb04d 100644 (file)
@@ -66,13 +66,14 @@ contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
 !contains(DEFINES, ENABLE_DATAGRID=.): DEFINES += ENABLE_DATAGRID=0
 !contains(DEFINES, ENABLE_METER_TAG=.): DEFINES += ENABLE_METER_TAG=1
 !contains(DEFINES, ENABLE_PROGRESS_TAG=.): DEFINES += ENABLE_PROGRESS_TAG=1
-!contains(DEFINES, ENABLE_BLOB=.): DEFINES += ENABLE_BLOB=0
+!contains(DEFINES, ENABLE_BLOB=.): DEFINES += ENABLE_BLOB=1
 !contains(DEFINES, ENABLE_NOTIFICATIONS=.): DEFINES += ENABLE_NOTIFICATIONS=1
 !contains(DEFINES, ENABLE_IMAGE_RESIZER=.): DEFINES += ENABLE_IMAGE_RESIZER=0
 !contains(DEFINES, ENABLE_INPUT_SPEECH=.): DEFINES += ENABLE_INPUT_SPEECH=0
 !contains(DEFINES, ENABLE_INSPECTOR=.): DEFINES += ENABLE_INSPECTOR=1
 !contains(DEFINES, ENABLE_3D_RENDERING=.): DEFINES += ENABLE_3D_RENDERING=1
 !contains(DEFINES, ENABLE_WEB_AUDIO=.): DEFINES += ENABLE_WEB_AUDIO=0
+!contains(DEFINES, ENABLE_3D_CANVAS=.): DEFINES += ENABLE_3D_CANVAS=0
 
 # SVG support
 !contains(DEFINES, ENABLE_SVG=0) {
@@ -203,3 +204,4 @@ contains(DEFINES, ENABLE_NOTIFICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_
 contains(DEFINES, ENABLE_METER_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_METER_TAG=1
 contains(DEFINES, ENABLE_PROGRESS_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_PROGRESS_TAG=1
 contains(DEFINES, ENABLE_GEOLOCATION=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GEOLOCATION=1
+contains(DEFINES, ENABLE_BLOB=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_BLOB=1
index b384091..d88a967 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright (C) 2007 Holger Hans Peter Freyther
  * Copyright (C) 2008 Apple, Inc. All rights reserved.
  * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
+ * Copyright (C) 2010 Sencha, Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -94,7 +95,7 @@ String pathGetFileName(const String& path)
 
 String directoryName(const String& path)
 {
-    return String(QFileInfo(path).absolutePath());
+    return QFileInfo(path).absolutePath();
 }
 
 Vector<String> listDirectory(const String& path, const String& filter)
@@ -128,7 +129,6 @@ CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
     return CString();
 }
 
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
 PlatformFileHandle openFile(const String& path, FileOpenMode mode)
 {
     QIODevice::OpenMode platformMode;
@@ -153,7 +153,6 @@ int readFromFile(PlatformFileHandle handle, char* data, int length)
         return handle->read(data, length);
     return 0;
 }
-#endif
 
 void closeFile(PlatformFileHandle& handle)
 {
@@ -163,6 +162,34 @@ void closeFile(PlatformFileHandle& handle)
     }
 }
 
+long long seekFile(PlatformFileHandle handle, long long offset, FileSeekOrigin origin)
+{
+    if (handle) {
+        long long current = 0;
+
+        switch (origin) {
+        case SeekFromBeginning:
+            break;
+        case SeekFromCurrent:
+            current = handle->pos();
+            break;
+        case SeekFromEnd:
+            current = handle->size();
+            break;
+        }
+
+        // Add the offset to the current position and seek to the new position
+        // Return our new position if the seek is successful
+        current += offset;
+        if (handle->seek(current))
+            return current;
+        else
+            return -1;
+    }
+
+    return -1;
+}
+
 int writeToFile(PlatformFileHandle handle, const char* data, int length)
 {
     if (handle && handle->exists() && handle->isWritable())