|
Lines 252-281
bool JSDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* exec, Property
a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp_sec1
|
| 252 |
// (Particularly, is it correct that this exists here but not in getOwnPropertySlotByIndex?) |
252 |
// (Particularly, is it correct that this exists here but not in getOwnPropertySlotByIndex?) |
| 253 |
slot.setWatchpointSet(thisObject->m_windowCloseWatchpoints); |
253 |
slot.setWatchpointSet(thisObject->m_windowCloseWatchpoints); |
| 254 |
|
254 |
|
| 255 |
// FIXME: These are all bogus. Keeping these here make some tests pass that check these properties |
|
|
| 256 |
// are own properties of the window, but introduces other problems instead (e.g. if you overwrite |
| 257 |
// & delete then the original value is restored!) Should be removed. |
| 258 |
if (propertyName == exec->propertyNames().blur) { |
| 259 |
if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) |
| 260 |
slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionBlur, 0>); |
| 261 |
return true; |
| 262 |
} |
| 263 |
if (propertyName == exec->propertyNames().close) { |
| 264 |
if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) |
| 265 |
slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>); |
| 266 |
return true; |
| 267 |
} |
| 268 |
if (propertyName == exec->propertyNames().focus) { |
| 269 |
if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) |
| 270 |
slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionFocus, 0>); |
| 271 |
return true; |
| 272 |
} |
| 273 |
if (propertyName == exec->propertyNames().postMessage) { |
| 274 |
if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) |
| 275 |
slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionPostMessage, 2>); |
| 276 |
return true; |
| 277 |
} |
| 278 |
|
| 279 |
if (propertyName == exec->propertyNames().showModalDialog) { |
255 |
if (propertyName == exec->propertyNames().showModalDialog) { |
| 280 |
if (Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) |
256 |
if (Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) |
| 281 |
return true; |
257 |
return true; |
|
Lines 612-619
static JSValue handlePostMessage(DOMWindow& impl, ExecState& state)
a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp_sec2
|
| 612 |
if (state.hadException()) |
588 |
if (state.hadException()) |
| 613 |
return jsUndefined(); |
589 |
return jsUndefined(); |
| 614 |
|
590 |
|
|
|
591 |
DOMWindow* callerWindow = callerDOMWindow(&state); |
| 592 |
if (!callerWindow) { |
| 593 |
setDOMException(&state, TypeError); |
| 594 |
return jsUndefined(); |
| 595 |
} |
| 596 |
|
| 615 |
ExceptionCode ec = 0; |
597 |
ExceptionCode ec = 0; |
| 616 |
impl.postMessage(message.release(), &messagePorts, targetOrigin, activeDOMWindow(&state), ec); |
598 |
impl.postMessage(message.release(), &messagePorts, targetOrigin, *callerWindow, ec); |
| 617 |
setDOMException(&state, ec); |
599 |
setDOMException(&state, ec); |
| 618 |
|
600 |
|
| 619 |
return jsUndefined(); |
601 |
return jsUndefined(); |