[webkit-reviews] review granted: [Bug 184981] window.postMessage() / focus() / blur() throw a TypeError when called on a RemoteDOMWindow : [Attachment 338757] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 25 17:29:00 PDT 2018


Sam Weinig <sam at webkit.org> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 184981: window.postMessage() / focus() / blur() throw a TypeError when
called on a RemoteDOMWindow
https://bugs.webkit.org/show_bug.cgi?id=184981

Attachment 338757: Patch

https://bugs.webkit.org/attachment.cgi?id=338757&action=review




--- Comment #2 from Sam Weinig <sam at webkit.org> ---
Comment on attachment 338757
  --> https://bugs.webkit.org/attachment.cgi?id=338757
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=338757&action=review

> Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:111
> -	   slot.setCustom(thisObject,
static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly |
JSC::PropertyAttribute::DontEnum), windowType == DOMWindowType::Remote ?
nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0> :
nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>);
> +	   slot.setCustom(thisObject,
static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly |
JSC::PropertyAttribute::DontEnum), windowType == DOMWindowType::Remote ?
nonCachingStaticFunctionGetter<jsRemoteDOMWindowInstanceFunctionClose, 0> :
nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>);
>	   return true;
>      }
>      if (propertyName == builtinNames.focusPublicName()) {
> -	   slot.setCustom(thisObject,
static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly |
JSC::PropertyAttribute::DontEnum), windowType == DOMWindowType::Remote ?
nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionFocus, 0> :
nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionFocus, 0>);
> +	   slot.setCustom(thisObject,
static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly |
JSC::PropertyAttribute::DontEnum), windowType == DOMWindowType::Remote ?
nonCachingStaticFunctionGetter<jsRemoteDOMWindowInstanceFunctionFocus, 0> :
nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionFocus, 0>);
>	   return true;
>      }
>      if (propertyName == builtinNames.postMessagePublicName()) {
> -	   slot.setCustom(thisObject,
static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly |
JSC::PropertyAttribute::DontEnum), windowType == DOMWindowType::Remote ?
nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionPostMessage, 0> :
nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionPostMessage, 2>);
> +	   slot.setCustom(thisObject,
static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly |
JSC::PropertyAttribute::DontEnum), windowType == DOMWindowType::Remote ?
nonCachingStaticFunctionGetter<jsRemoteDOMWindowInstanceFunctionPostMessage, 0>
: nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionPostMessage, 2>);

It really bums me out that JSRemoteDOMWindow is referenced in this JSDOMWindow
specific file.	I think we should think about moving this to a more neutral
location at some point.


More information about the webkit-reviews mailing list