Changeset 84670 in webkit


Ignore:
Timestamp:
Apr 22, 2011 1:11:08 PM (13 years ago)
Author:
weinig@apple.com
Message:

2011-04-22 Sam Weinig <sam@webkit.org>

Reviewed by Gavin Barraclough and Oliver Hunt.

Arrays should participate in global object forwarding fun
https://bugs.webkit.org/show_bug.cgi?id=59215

  • Update results of prototype-inheritance-2 for new array behavior.
  • Remove checks for primitives, since they were incorrect.
  • Force function check to check a function not on a primitive (this wasn't happening by itself, since functions normally aren't enumerable in the DOM).
  • Add exception to the test to not try and test HTMLProgressElement, since it is not available on all platforms. This allows us to remove the windows specific results.
  • fast/dom/prototype-inheritance-2-expected.txt:
  • fast/dom/script-tests/prototype-inheritance-2.js: (constructorNamesForWindow): (crawl):
  • platform/win/fast/dom/prototype-inheritance-2-expected.txt: Removed.

2011-04-22 Sam Weinig <sam@webkit.org>

Reviewed by Gavin Barraclough and Oliver Hunt.

Arrays should participate in global object forwarding fun
https://bugs.webkit.org/show_bug.cgi?id=59215

  • runtime/JSGlobalObject.h: (JSC::constructEmptyArray): (JSC::constructArray): Add variants of constructArray that take a global object.

2011-04-22 Sam Weinig <sam@webkit.org>

Reviewed by Gavin Barraclough and Oliver Hunt.

Arrays should participate in global object forwarding fun
https://bugs.webkit.org/show_bug.cgi?id=59215

Change callers of constructArray to use the new variant that takes
a global object.

  • bindings/js/JSClipboardCustom.cpp: (WebCore::JSClipboard::types):
  • bindings/js/JSConsoleCustom.cpp: (WebCore::JSConsole::profiles):
  • bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::scopeChain):
  • bindings/js/JSMessageEventCustom.cpp: (WebCore::JSMessageEvent::ports):
  • bindings/js/JSScriptProfileNodeCustom.cpp: (WebCore::JSScriptProfileNode::children):
  • bindings/js/JSWebGLRenderingContextCustom.cpp: (WebCore::toJS): (WebCore::JSWebGLRenderingContext::getAttachedShaders): (WebCore::JSWebGLRenderingContext::getSupportedExtensions):
Location:
trunk
Files:
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r84665 r84670  
     12011-04-22  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Gavin Barraclough and Oliver Hunt.
     4
     5        Arrays should participate in global object forwarding fun
     6        https://bugs.webkit.org/show_bug.cgi?id=59215
     7
     8        - Update results of prototype-inheritance-2 for new array behavior.
     9        - Remove checks for primitives, since they were incorrect.
     10        - Force function check to check a function not on a primitive (this
     11          wasn't happening by itself, since functions normally aren't enumerable
     12          in the DOM).
     13        - Add exception to the test to not try and test HTMLProgressElement, since
     14          it is not available on all platforms. This allows us to remove the windows
     15          specific results.
     16
     17        * fast/dom/prototype-inheritance-2-expected.txt:
     18        * fast/dom/script-tests/prototype-inheritance-2.js:
     19        (constructorNamesForWindow):
     20        (crawl):
     21        * platform/win/fast/dom/prototype-inheritance-2-expected.txt: Removed.
     22
    1232011-04-21  Geoffrey Garen  <ggaren@apple.com>
    224
  • trunk/LayoutTests/fast/dom/prototype-inheritance-2-expected.txt

    r84641 r84670  
    44
    55
    6 FAIL Array from inner.document.forms.testForm.0.ownerDocument.defaultView.console.profiles
     6PASS Array from inner.document.forms.testForm.0.ownerDocument.defaultView.console.profiles
    77PASS Attr from inner.document.forms.testForm.0.attributes.0
    88PASS AttrConstructor from inner.document.forms.testForm.0.attributes.0.constructor
     
    1010PASS BarInfo from inner.document.forms.testForm.0.ownerDocument.defaultView.menubar
    1111PASS BarInfoPrototype from inner.document.forms.testForm.0.ownerDocument.defaultView.menubar.__proto__
    12 FAIL Boolean from inner.document.forms.testForm.0.noValidate
    1312PASS CSSCharsetRule from inner.document.getElementById("dummyStyle").sheet.cssRules.0
    1413PASS CSSCharsetRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.0.constructor
     
    8887PASS DocumentPrototype from inner.document.forms.testForm.0.ownerDocument.__proto__.__proto__
    8988PASS ElementPrototype from inner.document.forms.testForm.0.__proto__.__proto__.__proto__
    90 FAIL Function from inner.document.location.protocol.constructor
     89PASS Function from inner.document.createElement
    9190PASS HTMLAnchorElement from inner.document.forms.testForm.0.parentNode.firstElementChild
    9291PASS HTMLAnchorElementConstructor from inner.document.forms.testForm.0.parentNode.firstElementChild.constructor
     
    173172PASS NodeListPrototype from inner.document.forms.testForm.__proto__
    174173PASS NodePrototype from inner.document.forms.testForm.0.attributes.0.__proto__.__proto__
    175 FAIL Number from inner.document.forms.testForm.length
    176174PASS Object from inner.document.location.__proto__.__proto__
    177175PASS Plugin from inner.document.forms.testForm.0.ownerDocument.defaultView.clientInformation.mimeTypes.0.enabledPlugin
     
    196194PASS StorageConstructor from inner.document.forms.testForm.0.ownerDocument.defaultView.localStorage.constructor
    197195PASS StoragePrototype from inner.document.forms.testForm.0.ownerDocument.defaultView.localStorage.__proto__
    198 FAIL String from inner.document.location.protocol
    199196PASS StyleMedia from inner.document.forms.testForm.0.ownerDocument.defaultView.styleMedia
    200197PASS StyleMediaConstructor from inner.document.forms.testForm.0.ownerDocument.defaultView.styleMedia.constructor
     
    274271Never found HTMLParamElement
    275272Never found HTMLPreElement
    276 Never found HTMLProgressElement
    277273Never found HTMLQuoteElement
    278274Never found HTMLScriptElement
  • trunk/LayoutTests/fast/dom/script-tests/prototype-inheritance-2.js

    r83884 r84670  
    8282            type == "FileErrorConstructor" ||
    8383            type == "FileReaderConstructor" ||
    84             type == "WebKitBlobBuilderConstructor")
     84            type == "WebKitBlobBuilderConstructor" ||
     85            type == "HTMLProgressElementConstructor")
    8586            continue; // We ignore WebGLRenderingContext and test it elsewhere, since it is not in all builds
    8687        if (!type.match('Constructor$'))
     
    159160                    continue;
    160161            }
     162            if (typeof(object) == "string")
     163                continue;
     164            if (typeof(object) == "boolean")
     165                continue;
     166            if (typeof(object) == "number")
     167                continue;
    161168
    162169            resultsByType[type] = makeCrawlObject(object.isInner, crawlTarget.valuePath);
     
    224231
    225232var crawlStartPaths = [
     233    evalToCrawlObject('inner.document.createElement'),
    226234    evalToCrawlObject('inner.document.location'), // window.location is tested by other tests, so test document.location in this one.
    227235    //evalToCrawlObject('inner.testForm'), // Causes many failures
  • trunk/Source/JavaScriptCore/ChangeLog

    r84660 r84670  
     12011-04-22  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Gavin Barraclough and Oliver Hunt.
     4
     5        Arrays should participate in global object forwarding fun
     6        https://bugs.webkit.org/show_bug.cgi?id=59215
     7
     8        * runtime/JSGlobalObject.h:
     9        (JSC::constructEmptyArray):
     10        (JSC::constructArray):
     11        Add variants of constructArray that take a global object.
     12
    1132011-04-22  Sheriff Bot  <webkit.review.bot@gmail.com>
    214
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r84556 r84670  
    405405        return constructEmptyObject(exec, exec->lexicalGlobalObject());
    406406    }
     407
     408    inline JSArray* constructEmptyArray(ExecState* exec, JSGlobalObject* globalObject)
     409    {
     410        return new (exec) JSArray(exec->globalData(), globalObject->arrayStructure());
     411    }
    407412   
    408413    inline JSArray* constructEmptyArray(ExecState* exec)
    409414    {
    410         return new (exec) JSArray(exec->globalData(), exec->lexicalGlobalObject()->arrayStructure());
    411     }
    412    
    413     inline JSArray* constructEmptyArray(ExecState* exec, JSGlobalObject* globalObject)
    414     {
    415         return new (exec) JSArray(exec->globalData(), globalObject->arrayStructure());
     415        return constructEmptyArray(exec, exec->lexicalGlobalObject());
     416    }
     417
     418    inline JSArray* constructEmptyArray(ExecState* exec, JSGlobalObject* globalObject, unsigned initialLength)
     419    {
     420        return new (exec) JSArray(exec->globalData(), globalObject->arrayStructure(), initialLength, CreateInitialized);
    416421    }
    417422
    418423    inline JSArray* constructEmptyArray(ExecState* exec, unsigned initialLength)
    419424    {
    420         return new (exec) JSArray(exec->globalData(), exec->lexicalGlobalObject()->arrayStructure(), initialLength, CreateInitialized);
    421     }
    422 
    423     inline JSArray* constructArray(ExecState* exec, JSValue singleItemValue)
     425        return constructEmptyArray(exec, exec->lexicalGlobalObject(), initialLength);
     426    }
     427
     428    inline JSArray* constructArray(ExecState* exec, JSGlobalObject* globalObject, JSValue singleItemValue)
    424429    {
    425430        MarkedArgumentBuffer values;
    426431        values.append(singleItemValue);
    427         return new (exec) JSArray(exec->globalData(), exec->lexicalGlobalObject()->arrayStructure(), values);
     432        return new (exec) JSArray(exec->globalData(), globalObject->arrayStructure(), values);
     433    }
     434
     435    inline JSArray* constructArray(ExecState* exec, JSValue singleItemValue)
     436    {
     437        return constructArray(exec, exec->lexicalGlobalObject(), singleItemValue);
     438    }
     439
     440    inline JSArray* constructArray(ExecState* exec, JSGlobalObject* globalObject, const ArgList& values)
     441    {
     442        return new (exec) JSArray(exec->globalData(), globalObject->arrayStructure(), values);
    428443    }
    429444
    430445    inline JSArray* constructArray(ExecState* exec, const ArgList& values)
    431446    {
    432         return new (exec) JSArray(exec->globalData(), exec->lexicalGlobalObject()->arrayStructure(), values);
     447        return constructArray(exec, exec->lexicalGlobalObject(), values);
    433448    }
    434449
  • trunk/Source/WebCore/ChangeLog

    r84668 r84670  
     12011-04-22  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Gavin Barraclough and Oliver Hunt.
     4
     5        Arrays should participate in global object forwarding fun
     6        https://bugs.webkit.org/show_bug.cgi?id=59215
     7
     8        Change callers of constructArray to use the new variant that takes
     9        a global object.
     10
     11        * bindings/js/JSClipboardCustom.cpp:
     12        (WebCore::JSClipboard::types):
     13        * bindings/js/JSConsoleCustom.cpp:
     14        (WebCore::JSConsole::profiles):
     15        * bindings/js/JSJavaScriptCallFrameCustom.cpp:
     16        (WebCore::JSJavaScriptCallFrame::scopeChain):
     17        * bindings/js/JSMessageEventCustom.cpp:
     18        (WebCore::JSMessageEvent::ports):
     19        * bindings/js/JSScriptProfileNodeCustom.cpp:
     20        (WebCore::JSScriptProfileNode::children):
     21        * bindings/js/JSWebGLRenderingContextCustom.cpp:
     22        (WebCore::toJS):
     23        (WebCore::JSWebGLRenderingContext::getAttachedShaders):
     24        (WebCore::JSWebGLRenderingContext::getSupportedExtensions):
     25
    1262011-04-22  Csaba Osztrogonác  <ossy@webkit.org>
    227
  • trunk/Source/WebCore/bindings/js/JSClipboardCustom.cpp

    r67973 r84670  
    6161    for (HashSet<String>::const_iterator it = types.begin(); it != end; ++it)
    6262        list.append(jsString(exec, stringToUString(*it)));
    63     return constructArray(exec, list);
     63    return constructArray(exec, globalObject(), list);
    6464}
    6565
  • trunk/Source/WebCore/bindings/js/JSConsoleCustom.cpp

    r84641 r84670  
    5353        list.append(toJS(exec, globalObject(), iter->get()));
    5454
    55     return constructArray(exec, list);
     55    return constructArray(exec, globalObject(), list);
    5656}
    5757
  • trunk/Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp

    r82060 r84670  
    8484    } while (iter != end);
    8585
    86     return constructArray(exec, list);
     86    return constructArray(exec, globalObject(), list);
    8787}
    8888
  • trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp

    r83645 r84670  
    5252    for (size_t i = 0; i < ports->size(); i++)
    5353        list.append(toJS(exec, globalObject(), (*ports)[i].get()));
    54     return constructArray(exec, list);
     54    return constructArray(exec, globalObject(), list);
    5555}
    5656
  • trunk/Source/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp

    r84641 r84670  
    5858        list.append(toJS(exec, globalObject(), iter->get()));
    5959
    60     return constructArray(exec, list);
     60    return constructArray(exec, globalObject(), list);
    6161}
    6262
  • trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp

    r84556 r84670  
    9090        for (size_t ii = 0; ii < value.size(); ++ii)
    9191            list.append(jsBoolean(value[ii]));
    92         return constructArray(exec, list);
     92        return constructArray(exec, globalObject, list);
    9393    }
    9494    case WebGLGetInfo::kTypeFloat:
     
    224224    for (size_t ii = 0; ii < shaders.size(); ++ii)
    225225        list.append(toJS(exec, globalObject(), shaders[ii]));
    226     return constructArray(exec, list);
     226    return constructArray(exec, globalObject(), list);
    227227}
    228228
     
    343343    for (size_t ii = 0; ii < value.size(); ++ii)
    344344        list.append(jsString(exec, value[ii]));
    345     return constructArray(exec, list);
     345    return constructArray(exec, globalObject(), list);
    346346}
    347347
Note: See TracChangeset for help on using the changeset viewer.