Renumber FileError/FileException error codes per latest File API spec changes http://dev.w3.org/2006/webapi/FileAPI/#dfn-FileException http://dev.w3.org/2009/dap/file-system/file-writer.html#the-fileerror-interface http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-fileerror-interface const unsigned short NOT_FOUND_ERR = 1; const unsigned short SECURITY_ERR = 2; const unsigned short ABORT_ERR = 3; const unsigned short NOT_READABLE_ERR = 4; const unsigned short ENCODING_ERR = 5; const unsigned short NO_MODIFICATION_ALLOWED_ERR = 6; const unsigned short INVALID_STATE_ERR = 7; const unsigned short SYNTAX_ERR = 8; const unsigned short INVALID_MODIFICATION_ERR = 9; const unsigned short QUOTA_EXCEEDED_ERR = 10; const unsigned short TYPE_MISMATCH_ERR = 11; const unsigned short PATH_EXISTS_ERR = 12;
Created attachment 71336 [details] Patch
Comment on attachment 71336 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=71336&action=review > LayoutTests/ChangeLog:11 > + * fast/files/read-file-async-expected.txt: You'd better also update fast/files/workers/read-*-async-expected.txt though worker tests are skipped now. > WebCore/dom/ExceptionCode.cpp:197 > + "A requested file or directory could not be found at the time an operation was processed.", Where did you get the message? > WebCore/fileapi/FileError.h:43 > + enum FileErrorCode { Probably it is simpler to name it as ErrorCode as in PositionError.h or GeolocationError.h. > WebCore/fileapi/FileException.h:65 > + static int FileErrorCodeToExceptionCode(int fileErrorCode) Probably simpler to call it as ErrorCodeToExceptionCode.
Created attachment 71386 [details] Patch
Comment on attachment 71336 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=71336&action=review >> LayoutTests/ChangeLog:11 >> + * fast/files/read-file-async-expected.txt: > > You'd better also update fast/files/workers/read-*-async-expected.txt though worker tests are skipped now. Done. >> WebCore/dom/ExceptionCode.cpp:197 >> + "A requested file or directory could not be found at the time an operation was processed.", > > Where did you get the message? Basically I copy-pasted those messages from the spec (plus some minor modifications to make them look alike). For this particular one it's from FileSystem spec, 7.3 Error Code Descriptions. http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#error-code-descriptions Please feel free to correct the sentences if they look weird or not relevant. >> WebCore/fileapi/FileError.h:43 >> + enum FileErrorCode { > > Probably it is simpler to name it as ErrorCode as in PositionError.h or GeolocationError.h. Fixed. >> WebCore/fileapi/FileException.h:65 >> + static int FileErrorCodeToExceptionCode(int fileErrorCode) > > Probably simpler to call it as ErrorCodeToExceptionCode. Fixed.
Comment on attachment 71386 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=71386&action=review > WebCore/dom/ExceptionCode.cpp:204 > + "An attempt was made to supply an invalid line ending specifier to the API. ", This description text seems to be too specific.
(In reply to comment #5) > (From update of attachment 71386 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=71386&action=review > > > WebCore/dom/ExceptionCode.cpp:204 > > + "An attempt was made to supply an invalid line ending specifier to the API. ", > > This description text seems to be too specific. Do you have any alternative suggestions? It's the only case where useragent should fire SYNTAX_ERR in the entire File API spec and I don't see the strong reason to change it now.
(In reply to comment #6) > (In reply to comment #5) > > (From update of attachment 71386 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=71386&action=review > > > > > WebCore/dom/ExceptionCode.cpp:204 > > > + "An attempt was made to supply an invalid line ending specifier to the API. ", > > > > This description text seems to be too specific. > > Do you have any alternative suggestions? > > It's the only case where useragent should fire SYNTAX_ERR in the entire File API spec and I don't see the strong reason to change it now. Though it is only used in one particular case, I am afraid that it might be used in other cases without updating the original description. How about something like: "Invalid or unsupported argument, like invalid line ending specifier."
Created attachment 71597 [details] Patch
(In reply to comment #7) > (In reply to comment #6) > > (In reply to comment #5) > > > (From update of attachment 71386 [details] [details] [details]) > > > View in context: https://bugs.webkit.org/attachment.cgi?id=71386&action=review > > > > > > > WebCore/dom/ExceptionCode.cpp:204 > > > > + "An attempt was made to supply an invalid line ending specifier to the API. ", > > > > > > This description text seems to be too specific. > > > > Do you have any alternative suggestions? > > > > It's the only case where useragent should fire SYNTAX_ERR in the entire File API spec and I don't see the strong reason to change it now. > > Though it is only used in one particular case, I am afraid that it might be used in other cases without updating the original description. How about something like: > "Invalid or unsupported argument, like invalid line ending specifier." Sounds good, updated the patch.
Committed r70438: <http://trac.webkit.org/changeset/70438>