Changeset 205383 in webkit


Ignore:
Timestamp:
Sep 2, 2016 4:25:00 PM (8 years ago)
Author:
rniwa@webkit.org
Message:

Temporarily break customElements.whenDefined to remove flaky crashes
https://bugs.webkit.org/show_bug.cgi?id=161555

Reviewed by Chris Dumez.

Source/WebCore:

Remove HashMap of DeferredWrapper which causes a crash during destruction.
This breaks the semantics of "whenDefined" for now.

  • bindings/js/JSCustomElementRegistryCustom.cpp:

(WebCore::whenDefinedPromise):

  • dom/CustomElementRegistry.cpp:

(WebCore::CustomElementRegistry::addElementDefinition):

  • dom/CustomElementRegistry.h:

(WebCore::CustomElementRegistry::promiseMap): Deleted.

LayoutTests:

Rebaseline the test now that some test cases are failing due to the partial rollout.

  • fast/custom-elements/CustomElementRegistry-expected.txt:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r205382 r205383  
     12016-09-02  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Temporarily break customElements.whenDefined to remove flaky crashes
     4        https://bugs.webkit.org/show_bug.cgi?id=161555
     5
     6        Reviewed by Chris Dumez.
     7
     8        Rebaseline the test now that some test cases are failing due to the partial rollout.
     9
     10        * fast/custom-elements/CustomElementRegistry-expected.txt:
     11
    1122016-09-02  Ryan Haddad  <ryanhaddad@apple.com>
    213
  • trunk/LayoutTests/fast/custom-elements/CustomElementRegistry-expected.txt

    r205340 r205383  
    3030PASS customElements.get must return undefined when the registry does not contain an entry with the given name even if the name was not a valid custom element name
    3131PASS customElements.get return the constructor of the entry with the given name when there is a matching entry.
    32 PASS customElements.whenDefined must return a promise for a valid custom element name
     32FAIL customElements.whenDefined must return a promise for a valid custom element name assert_true: expected true got false
    3333PASS customElements.whenDefined must return the same promise each time invoked for a valid custom element name which has not been defined
    34 PASS customElements.whenDefined must return an unresolved promise when the registry does not contain the entry with the given name
     34FAIL customElements.whenDefined must return an unresolved promise when the registry does not contain the entry with the given name undefined is not an object (evaluating 'customElements.whenDefined('a-b').then')
    3535PASS customElements.whenDefined must return a rejected promise when the given name is not a valid custom element name
    3636PASS customElements.whenDefined must return a resolved promise when the registry contains the entry with the given name
    3737PASS customElements.whenDefined must return a new resolved promise each time invoked when the registry contains the entry with the given name
    38 PASS A promise returned by customElements.whenDefined must be resolved by "define"
     38FAIL A promise returned by customElements.whenDefined must be resolved by "define" undefined is not an object (evaluating 'promise.then')
    3939
  • trunk/Source/WebCore/ChangeLog

    r205382 r205383  
     12016-09-02  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Temporarily break customElements.whenDefined to remove flaky crashes
     4        https://bugs.webkit.org/show_bug.cgi?id=161555
     5
     6        Reviewed by Chris Dumez.
     7
     8        Remove HashMap of DeferredWrapper which causes a crash during destruction.
     9        This breaks the semantics of "whenDefined" for now.
     10
     11        * bindings/js/JSCustomElementRegistryCustom.cpp:
     12        (WebCore::whenDefinedPromise):
     13        * dom/CustomElementRegistry.cpp:
     14        (WebCore::CustomElementRegistry::addElementDefinition):
     15        * dom/CustomElementRegistry.h:
     16        (WebCore::CustomElementRegistry::promiseMap): Deleted.
     17
    1182016-09-02  Ryan Haddad  <ryanhaddad@apple.com>
    219        Unreviewed, rolling out r205373.
  • trunk/Source/WebCore/bindings/js/JSCustomElementRegistryCustom.cpp

    r205340 r205383  
    183183    }
    184184
    185     auto result = registry.promiseMap().ensure(localName, [&] {
    186         return DeferredWrapper::create(&state, &globalObject, JSPromiseDeferred::create(&state, &globalObject));
    187     });
    188 
    189     return result.iterator->value->promise();
     185    return jsUndefined();
    190186}
    191187
  • trunk/Source/WebCore/dom/CustomElementRegistry.cpp

    r205340 r205383  
    7979    if (auto* document = m_window.document())
    8080        enqueueUpgradeInShadowIncludingTreeOrder(*document, elementInterface.get());
    81 
    82     if (auto promise = m_promiseMap.take(localName))
    83         promise.value()->resolve(nullptr);
    8481}
    8582
  • trunk/Source/WebCore/dom/CustomElementRegistry.h

    r205340 r205383  
    6767    JSC::JSValue get(const AtomicString&);
    6868
    69     HashMap<AtomicString, Ref<DeferredWrapper>>& promiseMap() { return m_promiseMap; }
    70 
    7169private:
    7270    CustomElementRegistry(DOMWindow&);
     
    7573    HashMap<AtomicString, Ref<JSCustomElementInterface>> m_nameMap;
    7674    HashMap<const JSC::JSObject*, JSCustomElementInterface*> m_constructorMap;
    77     HashMap<AtomicString, Ref<DeferredWrapper>> m_promiseMap;
    7875
    7976    bool m_elementDefinitionIsRunning { false };
Note: See TracChangeset for help on using the changeset viewer.