[Webkit-unassigned] [Bug 87578] [FileAPI] The result attribute of FileReader shuold use null to replace empty string

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 29 10:36:46 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=87578


Jian Li <jianli at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #144210|                            |review-
               Flag|                            |




--- Comment #10 from Jian Li <jianli at chromium.org>  2012-05-29 10:36:45 PST ---
(From update of attachment 144210)
View in context: https://bugs.webkit.org/attachment.cgi?id=144210&action=review

> Source/WebCore/fileapi/FileReader.cpp:248
> +    if (ret.isEmpty())

This would cause NULL being returned when reading an empty file. I think you should change it to:
    if (m_loader && m_loader->stringResult())
        return m_loader->stringResult();
    return String();

> LayoutTests/fast/files/blob-slice-test-expected.txt:3
> +Slicing from 2 to 2: null

The spec does not say that null needs to be returned for empty file/blob. I think we should still return empty string for this case.

You could add test cases to cover the scenarios that result is being read when readyState is EMPTY or an error occurs.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list