RESOLVED FIXED 163222
Add support for languagechange event
https://bugs.webkit.org/show_bug.cgi?id=163222
Summary Add support for languagechange event
Chris Dumez
Reported 2016-10-10 10:50:13 PDT
Add support for languagechange event: - https://html.spec.whatwg.org/#dom-navigator-languages
Attachments
Patch (16.68 KB, patch)
2016-10-10 16:42 PDT, Chris Dumez
no flags
Patch (16.64 KB, patch)
2016-10-10 16:43 PDT, Chris Dumez
no flags
Patch (16.62 KB, patch)
2016-10-10 21:01 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2016-10-10 16:42:19 PDT
Chris Dumez
Comment 2 2016-10-10 16:43:41 PDT
Ryosuke Niwa
Comment 3 2016-10-10 19:02:37 PDT
Comment on attachment 291185 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=291185&action=review > Source/WebCore/page/DOMWindow.cpp:426 > + > + addLanguageChangeObserver(this, &languagesChangedCallback); This would be racy with regards with the cache being invalidated in FontGenericFamilies. We need to either force invalidating the cache in there first or add some other mechanism to make sure this observer is called at the very end or very first so that there is no observable race conditions.
Chris Dumez
Comment 4 2016-10-10 19:27:42 PDT
Comment on attachment 291185 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=291185&action=review >> Source/WebCore/page/DOMWindow.cpp:426 >> + addLanguageChangeObserver(this, &languagesChangedCallback); > > This would be racy with regards with the cache being invalidated in FontGenericFamilies. > We need to either force invalidating the cache in there first > or add some other mechanism to make sure this observer is called at the very end or very first > so that there is no observable race conditions. Sorry, I do not understand your comment at all. I see that FontGenericFamilies is also registering a language change callback but I do not understand how this impacts Window registering its own callback. Which cache are you referring to?
Chris Dumez
Comment 5 2016-10-10 19:32:45 PDT
Comment on attachment 291185 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=291185&action=review >>> Source/WebCore/page/DOMWindow.cpp:426 >>> + addLanguageChangeObserver(this, &languagesChangedCallback); >> >> This would be racy with regards with the cache being invalidated in FontGenericFamilies. >> We need to either force invalidating the cache in there first >> or add some other mechanism to make sure this observer is called at the very end or very first >> so that there is no observable race conditions. > > Sorry, I do not understand your comment at all. I see that FontGenericFamilies is also registering a language change callback but I do not understand how this impacts Window registering its own callback. > Which cache are you referring to? Oh, I think I understand your worry now. How about we simply fire the JS event asynchronously?
Ryosuke Niwa
Comment 6 2016-10-10 19:41:15 PDT
(In reply to comment #5) > Comment on attachment 291185 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=291185&action=review > > >>> Source/WebCore/page/DOMWindow.cpp:426 > >>> + addLanguageChangeObserver(this, &languagesChangedCallback); > >> > >> This would be racy with regards with the cache being invalidated in FontGenericFamilies. > >> We need to either force invalidating the cache in there first > >> or add some other mechanism to make sure this observer is called at the very end or very first > >> so that there is no observable race conditions. > > > > Sorry, I do not understand your comment at all. I see that FontGenericFamilies is also registering a language change callback but I do not understand how this impacts Window registering its own callback. > > Which cache are you referring to? > > Oh, I think I understand your worry now. How about we simply fire the JS > event asynchronously? Yeah, that works too.
Chris Dumez
Comment 7 2016-10-10 21:01:27 PDT
WebKit Commit Bot
Comment 8 2016-10-10 21:36:31 PDT
Comment on attachment 291223 [details] Patch Clearing flags on attachment: 291223 Committed r207040: <http://trac.webkit.org/changeset/207040>
WebKit Commit Bot
Comment 9 2016-10-10 21:36:37 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.