NamedFlowCollection getters should follow the same pattern as HTMLCollection
https://bugs.webkit.org/show_bug.cgi?id=118561

Patch by Radu Stavila <stavila@adobe.com> on 2013-07-11
Reviewed by Christophe Dumez.

Source/WebCore:

Modified item and namedItem methods from DOMNamedFlowCollection to return null instead of undefined.
https://www.w3.org/Bugs/Public/show_bug.cgi?id=22617
Completely removed the TreatReturnedNullObjectAs attribute as it was only used by the DOMNamedFlowCollection interface.

Test: fast/regions/webkit-named-flow-collection-empty-getters.html

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementationFunctionCall):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/CPP/WebDOMTestObj.cpp:
(WebDOMTestObj::treatReturnedNullObjectAsUndefined):
* bindings/scripts/test/CPP/WebDOMTestObj.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_treat_returned_null_object_as_undefined):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionTreatReturnedNullObjectAsUndefined):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj treatReturnedNullObjectAsUndefined]):
* bindings/scripts/test/TestObj.idl:
* dom/DOMNamedFlowCollection.idl:

LayoutTests:

Updated test for NamedFlowCollection getters when no named flows are created.

* fast/regions/webkit-named-flow-collection-empty-getters-expected.txt: Renamed from LayoutTests/fast/regions/webkit-named-flow-collection-undefined-expected.txt.
* fast/regions/webkit-named-flow-collection-empty-getters.html: Renamed from LayoutTests/fast/regions/webkit-named-flow-collection-undefined.html.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152569 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed