Rework FontFace promise attribute handling
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 May 2016 20:04:27 +0000 (20:04 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 May 2016 20:04:27 +0000 (20:04 +0000)
commit410487ef9c9bd8fa0b9989f061ba398736df5b15
treeb1b02c23614cf979e380ee41640cc34fd6dccac7
parent503894ce30c6897af19f85a58a52442e2561f0e0
Rework FontFace promise attribute handling
https://bugs.webkit.org/show_bug.cgi?id=157310

Reviewed by Myles C. Maxfield.

Making promise attributes cached attributes, so that they are created only once.
They are created in the custom binding code and passed to DOM class as needed.

Removed usage of ExecState& from DOM iterators.

No change should be visible from user scripts.

* Modules/fetch/FetchHeaders.cpp:
(WebCore::FetchHeaders::Iterator::next): Removing ExecState parameter.
* Modules/fetch/FetchHeaders.h:
* bindings/js/JSDOMIterator.h:
(WebCore::keyValueIteratorForEach):
(WebCore::JSDOMIterator<JSWrapper>::next): Ditto.
* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredWrapper::promise): Removed deferred() and added access to promise directly.
* bindings/js/JSDOMPromise.h:
* bindings/js/JSFontFaceCustom.cpp:
(WebCore::JSFontFace::loaded): Using cached attribute to call FontFace::loaded only once.
* bindings/js/JSFontFaceSetCustom.cpp:
(WebCore::JSFontFaceSet::ready): Using cached attribute to call FontFaceSet::ready only once.
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::wrapper): Removing ExecState parameter.
* css/CSSFontFace.h:
* css/FontFace.cpp:
(WebCore::FontFace::create): Ditto.
(WebCore::FontFace::FontFace): Ditto.
(WebCore::FontFace::fontStateChanged): Updating promise handling.
(WebCore::FontFace::registerLoaded): Resolving/rejecting promise if backing CSSFontFace loading is ended.
(WebCore::FontFace::load): Calling backing load.
* css/FontFace.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::Iterator::next): Removing ExecState parameter.
(WebCore::FontFaceSet::load): Removing ExecState and ExceptionCode parameter.
(WebCore::FontFaceSet::registerReady): Resolving promise if ready otherwise storing it for resolving it later.
(WebCore::FontFaceSet::completedLoading): Resolving promise if any is stored.
(WebCore::FontFaceSet::create): Deleted.
* css/FontFaceSet.h:
* css/FontFaceSet.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/fetch/FetchHeaders.cpp
Source/WebCore/Modules/fetch/FetchHeaders.h
Source/WebCore/bindings/js/JSDOMIterator.h
Source/WebCore/bindings/js/JSDOMPromise.cpp
Source/WebCore/bindings/js/JSDOMPromise.h
Source/WebCore/bindings/js/JSFontFaceCustom.cpp
Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp
Source/WebCore/css/CSSFontFace.cpp
Source/WebCore/css/CSSFontFace.h
Source/WebCore/css/FontFace.cpp
Source/WebCore/css/FontFace.h
Source/WebCore/css/FontFaceSet.cpp
Source/WebCore/css/FontFaceSet.h
Source/WebCore/css/FontFaceSet.idl