diff options
author | Steve Block <steveblock@google.com> | 2010-08-24 07:50:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-24 07:50:47 -0700 |
commit | c570a147a94b126d4172c30914f53dea17b4c8f5 (patch) | |
tree | 99c11741887d21f65d67c5bbdab58b7ba2a5d4d5 /WebCore/bindings/js/JSDOMWindowCustom.cpp | |
parent | c952714bc6809a5ad081baaf9fcc04107b92ea3f (diff) | |
parent | 6c65f16005b91786c2b7c0791b9ea1dd684d57f4 (diff) | |
download | external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.zip external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.tar.gz external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.tar.bz2 |
Merge changes I2e7e2317,Ie6ccde3a,I3e89f231,Id06ff339,I268dfe7d,Icaf70d9f,Ie234f1a0,Iff5c7aaa,I69b75bf0,Ifbf384f4
* changes:
Merge WebKit at r65615 : Update WebKit revision number
Merge WebKit at r65615 : Ignore http/tests/appcache/origin-quota.html
Merge WebKit at r65615 : Android-specific results for Geolocation tests.
Merge WebKit at r65615 : Fix GraphicsContext and ImageBuffer.
Merge WebKit at r65615 : processingUserGesture() is now static.
Merge WebKit at r65615 : UTF8String() becomes utf8().
Merge WebKit at r65615 : Fix include paths for string headers.
Merge WebKit at r65615 : Fix Makefiles.
Merge WebKit at r65615 : Fix conflicts.
Merge WebKit at r65615 : Initial merge by git.
Diffstat (limited to 'WebCore/bindings/js/JSDOMWindowCustom.cpp')
-rw-r--r-- | WebCore/bindings/js/JSDOMWindowCustom.cpp | 68 |
1 files changed, 13 insertions, 55 deletions
diff --git a/WebCore/bindings/js/JSDOMWindowCustom.cpp b/WebCore/bindings/js/JSDOMWindowCustom.cpp index 252ea93..2ad71f0 100644 --- a/WebCore/bindings/js/JSDOMWindowCustom.cpp +++ b/WebCore/bindings/js/JSDOMWindowCustom.cpp @@ -20,7 +20,6 @@ #include "config.h" #include "JSDOMWindowCustom.h" -#include "AtomicString.h" #include "Chrome.h" #include "DOMWindow.h" #include "Document.h" @@ -87,6 +86,7 @@ #include <runtime/JSFunction.h> #include <runtime/JSObject.h> #include <runtime/PrototypeFunction.h> +#include <wtf/text/AtomicString.h> using namespace JSC; @@ -271,7 +271,7 @@ bool JSDOMWindow::getOwnPropertySlot(ExecState* exec, const Identifier& property // allow window[1] or parent[1] etc. (#56983) bool ok; - unsigned i = propertyName.toArrayIndex(&ok); + unsigned i = propertyName.toArrayIndex(ok); if (ok && i < impl()->frame()->tree()->childCount()) { slot.setCustomIndex(this, i, indexGetter); return true; @@ -345,7 +345,7 @@ bool JSDOMWindow::getOwnPropertyDescriptor(ExecState* exec, const Identifier& pr } bool ok; - unsigned i = propertyName.toArrayIndex(&ok); + unsigned i = propertyName.toArrayIndex(ok); if (ok && i < impl()->frame()->tree()->childCount()) { PropertySlot slot; slot.setCustomIndex(this, i, indexGetter); @@ -512,7 +512,7 @@ void JSDOMWindow::setLocation(ExecState* exec, JSValue value) if (!protocolIsJavaScript(url) || allowsAccessFrom(exec)) { // We want a new history item if this JS was called via a user gesture - frame->redirectScheduler()->scheduleLocationChange(url, lexicalFrame->loader()->outgoingReferrer(), !lexicalFrame->script()->anyPageIsProcessingUserGesture(), false, processingUserGesture(exec)); + frame->redirectScheduler()->scheduleLocationChange(url, lexicalFrame->loader()->outgoingReferrer(), !lexicalFrame->script()->anyPageIsProcessingUserGesture(), false, processingUserGesture()); } } @@ -606,47 +606,6 @@ JSValue JSDOMWindow::float32Array(ExecState* exec) const return getDOMConstructor<JSFloat32ArrayConstructor>(exec, this); } -// Temporary aliases to keep current WebGL content working during transition period to TypedArray spec. -// To be removed before WebGL spec is finalized. (FIXME) -JSValue JSDOMWindow::webGLArrayBuffer(ExecState* exec) const -{ - return getDOMConstructor<JSArrayBufferConstructor>(exec, this); -} - -JSValue JSDOMWindow::webGLByteArray(ExecState* exec) const -{ - return getDOMConstructor<JSInt8ArrayConstructor>(exec, this); -} - -JSValue JSDOMWindow::webGLUnsignedByteArray(ExecState* exec) const -{ - return getDOMConstructor<JSUint8ArrayConstructor>(exec, this); -} - -JSValue JSDOMWindow::webGLIntArray(ExecState* exec) const -{ - return getDOMConstructor<JSInt32ArrayConstructor>(exec, this); -} - -JSValue JSDOMWindow::webGLUnsignedIntArray(ExecState* exec) const -{ - return getDOMConstructor<JSUint32ArrayConstructor>(exec, this); -} - -JSValue JSDOMWindow::webGLShortArray(ExecState* exec) const -{ - return getDOMConstructor<JSInt16ArrayConstructor>(exec, this); -} - -JSValue JSDOMWindow::webGLUnsignedShortArray(ExecState* exec) const -{ - return getDOMConstructor<JSUint16ArrayConstructor>(exec, this); -} - -JSValue JSDOMWindow::webGLFloatArray(ExecState* exec) const -{ - return getDOMConstructor<JSFloat32ArrayConstructor>(exec, this); -} #endif JSValue JSDOMWindow::xmlHttpRequest(ExecState* exec) const @@ -724,10 +683,9 @@ static Frame* createWindow(ExecState* exec, Frame* lexicalFrame, Frame* dynamicF // We'd have to resolve all those issues to pass the URL instead of "". bool created; - // We pass in the opener frame here so it can be used for looking up the frame name, in case the active frame - // is different from the opener frame, and the name references a frame relative to the opener frame, for example - // "_self" or "_parent". - Frame* newFrame = lexicalFrame->loader()->createWindow(openerFrame->loader(), frameRequest, windowFeatures, created); + // We pass the opener frame for the lookupFrame in case the active frame is different from + // the opener frame, and the name references a frame relative to the opener frame. + Frame* newFrame = createWindow(lexicalFrame, openerFrame, frameRequest, windowFeatures, created); if (!newFrame) return 0; @@ -742,7 +700,7 @@ static Frame* createWindow(ExecState* exec, Frame* lexicalFrame, Frame* dynamicF if (!protocolIsJavaScript(url) || newWindow->allowsAccessFrom(exec)) { KURL completedURL = url.isEmpty() ? KURL(ParsedURLString, "") : completeURL(exec, url); - bool userGesture = processingUserGesture(exec); + bool userGesture = processingUserGesture(); if (created) newFrame->loader()->changeLocation(completedURL, referrer, false, false, userGesture); @@ -753,10 +711,10 @@ static Frame* createWindow(ExecState* exec, Frame* lexicalFrame, Frame* dynamicF return newFrame; } -static bool domWindowAllowPopUp(Frame* activeFrame, ExecState* exec) +static bool domWindowAllowPopUp(Frame* activeFrame) { ASSERT(activeFrame); - if (activeFrame->script()->processingUserGesture(currentWorld(exec))) + if (ScriptController::processingUserGesture()) return true; return DOMWindow::allowPopUp(activeFrame); } @@ -781,7 +739,7 @@ JSValue JSDOMWindow::open(ExecState* exec) // Because FrameTree::find() returns true for empty strings, we must check for empty framenames. // Otherwise, illegitimate window.open() calls with no name will pass right through the popup blocker. - if (!domWindowAllowPopUp(dynamicFrame, exec) && (frameName.isEmpty() || !frame->tree()->find(frameName))) + if (!domWindowAllowPopUp(dynamicFrame) && (frameName.isEmpty() || !frame->tree()->find(frameName))) return jsUndefined(); // Get the target frame for the special cases of _top and _parent. In those @@ -805,7 +763,7 @@ JSValue JSDOMWindow::open(ExecState* exec) const JSDOMWindow* targetedWindow = toJSDOMWindow(frame, currentWorld(exec)); if (!completedURL.isEmpty() && (!protocolIsJavaScript(completedURL) || (targetedWindow && targetedWindow->allowsAccessFrom(exec)))) { - bool userGesture = processingUserGesture(exec); + bool userGesture = processingUserGesture(); // For whatever reason, Firefox uses the dynamicGlobalObject to // determine the outgoingReferrer. We replicate that behavior @@ -851,7 +809,7 @@ JSValue JSDOMWindow::showModalDialog(ExecState* exec) if (!dynamicFrame) return jsUndefined(); - if (!DOMWindow::canShowModalDialogNow(frame) || !domWindowAllowPopUp(dynamicFrame, exec)) + if (!DOMWindow::canShowModalDialogNow(frame) || !domWindowAllowPopUp(dynamicFrame)) return jsUndefined(); HashMap<String, String> features; |