Commit 2c41705b authored by antonm@chromium.org's avatar antonm@chromium.org

2010-11-08 Anton Muhin <antonm@chromium.org>

        Reviewed by Nate Chapin.

        [v8] Get rid of automatically generated named property getter for classes with namedItem method
        https://bugs.webkit.org/show_bug.cgi?id=48770

        * platform/chromium-mac/fast/dom/HTMLSelectElement/named-options-expected.txt:
        * platform/chromium-win/fast/dom/HTMLSelectElement/named-options-expected.txt:
2010-11-08  Anton Muhin  <antonm@chromium.org>

        Reviewed by Nate Chapin.

        [v8] Get rid of automatically generated named property getter for classes with namedItem method
        https://bugs.webkit.org/show_bug.cgi?id=48770

        * bindings/scripts/CodeGeneratorV8.pm:
        * bindings/v8/custom/V8HTMLSelectElementCustom.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0557d7a0
2010-11-08 Anton Muhin <antonm@chromium.org>
Reviewed by Nate Chapin.
[v8] Get rid of automatically generated named property getter for classes with namedItem method
https://bugs.webkit.org/show_bug.cgi?id=48770
* platform/chromium-mac/fast/dom/HTMLSelectElement/named-options-expected.txt:
* platform/chromium-win/fast/dom/HTMLSelectElement/named-options-expected.txt:
2010-11-08 Dumitru Daniliuc <dumi@chromium.org>
Unreviewed, updating Chromium expectations.
......@@ -4,16 +4,16 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
Confirm that the option named 'test' is accessible from the select element
PASS select1.test.toString() is "[object HTMLOptionElement]"
PASS select1.test.value is "Value"
FAIL select1.test.toString() should be [object HTMLOptionElement]. Threw exception TypeError: Cannot call method 'toString' of undefined
FAIL select1.test.value should be Value. Threw exception TypeError: Cannot read property 'value' of undefined
Confirm that the option named 'test' is accessible from the options collection
PASS select1.options.test.toString() is "[object HTMLOptionElement]"
PASS select1.options.test.value is "Value"
Confirm that both options named 'test' are accessible from the select element
PASS select2.test.length is 2
PASS select2.test.toString() is "[object NodeList]"
PASS select2.test[0].value is "Value1"
PASS select2.test[1].value is "Value2"
FAIL select2.test.length should be 2. Threw exception TypeError: Cannot read property 'length' of undefined
FAIL select2.test.toString() should be [object NodeList]. Threw exception TypeError: Cannot call method 'toString' of undefined
FAIL select2.test[0].value should be Value1. Threw exception TypeError: Cannot read property '0' of undefined
FAIL select2.test[1].value should be Value2. Threw exception TypeError: Cannot read property '1' of undefined
Confirm that both options named 'test' are accessible from the options collection
PASS select2.options.test.length is 2
PASS select2.options.test.toString() is "[object NodeList]"
......
......@@ -4,16 +4,16 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
Confirm that the option named 'test' is accessible from the select element
PASS select1.test.toString() is "[object HTMLOptionElement]"
PASS select1.test.value is "Value"
FAIL select1.test.toString() should be [object HTMLOptionElement]. Threw exception TypeError: Cannot call method 'toString' of undefined
FAIL select1.test.value should be Value. Threw exception TypeError: Cannot read property 'value' of undefined
Confirm that the option named 'test' is accessible from the options collection
PASS select1.options.test.toString() is "[object HTMLOptionElement]"
PASS select1.options.test.value is "Value"
Confirm that both options named 'test' are accessible from the select element
PASS select2.test.length is 2
PASS select2.test.toString() is "[object NodeList]"
PASS select2.test[0].value is "Value1"
PASS select2.test[1].value is "Value2"
FAIL select2.test.length should be 2. Threw exception TypeError: Cannot read property 'length' of undefined
FAIL select2.test.toString() should be [object NodeList]. Threw exception TypeError: Cannot call method 'toString' of undefined
FAIL select2.test[0].value should be Value1. Threw exception TypeError: Cannot read property '0' of undefined
FAIL select2.test[1].value should be Value2. Threw exception TypeError: Cannot read property '1' of undefined
Confirm that both options named 'test' are accessible from the options collection
PASS select2.options.test.length is 2
PASS select2.options.test.toString() is "[object NodeList]"
......
2010-11-08 Anton Muhin <antonm@chromium.org>
Reviewed by Nate Chapin.
[v8] Get rid of automatically generated named property getter for classes with namedItem method
https://bugs.webkit.org/show_bug.cgi?id=48770
* bindings/scripts/CodeGeneratorV8.pm:
* bindings/v8/custom/V8HTMLSelectElementCustom.cpp:
2010-11-08 Ned Holbrook <nholbrook@apple.com>
Reviewed by Adam Barth.
......@@ -524,7 +524,7 @@ sub GenerateHeaderNamedAndIndexedPropertyAccessors
$hasCustomDeleterr = 0;
$hasEnumerator = 0;
}
if ($interfaceName eq "HTMLSelectElement" || $interfaceName eq "HTMLAppletElement" || $interfaceName eq "HTMLEmbedElement" || $interfaceName eq "HTMLObjectElement") {
if ($interfaceName eq "HTMLAppletElement" || $interfaceName eq "HTMLEmbedElement" || $interfaceName eq "HTMLObjectElement") {
$hasCustomNamedGetter = 1;
}
if ($interfaceName eq "HTMLDocument") {
......@@ -1742,7 +1742,7 @@ sub GenerateImplementationNamedPropertyGetter
$hasCustomGetter = 0;
}
my $hasGetter = $dataNode->extendedAttributes->{"HasNameGetter"} || $hasCustomGetter || $namedPropertyGetter;
my $hasGetter = $dataNode->extendedAttributes->{"HasNameGetter"} || $hasCustomGetter;
if (!$hasGetter) {
return;
}
......
......@@ -46,33 +46,6 @@
namespace WebCore {
v8::Handle<v8::Value> V8HTMLSelectElement::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLSelectElement.NamedPropertyGetter");
HTMLSelectElement* select = V8HTMLSelectElement::toNative(info.Holder());
v8::Handle<v8::Value> value = info.Holder()->GetRealNamedPropertyInPrototypeChain(name);
if (!value.IsEmpty())
return value;
// Search local callback properties next to find IDL defined properties.
if (info.Holder()->HasRealNamedCallbackProperty(name))
return notHandledByInterceptor();
PassRefPtr<HTMLOptionsCollection> collection = select->options();
Vector<RefPtr<Node> > items;
collection->namedItems(v8StringToAtomicWebCoreString(name), items);
if (!items.size())
return notHandledByInterceptor();
if (items.size() == 1)
return toV8(items.at(0).release());
return toV8(V8NamedNodesCollection::create(items));
}
v8::Handle<v8::Value> V8HTMLSelectElement::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
{
ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment