Changeset 62380 in webkit
- Timestamp:
- Jul 2, 2010 4:43:45 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r62379 r62380 1 2010-07-02 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 [v8] Web Inspector: inspected page crashes on attempt to change iframe's src attribute 6 https://bugs.webkit.org/show_bug.cgi?id=41511 7 8 * fast/events/popup-blocked-from-fake-user-gesture-expected.txt: Added. 9 * fast/events/popup-blocked-from-fake-user-gesture.html: Added. 10 * http/tests/inspector/change-iframe-src-expected.txt: Added. 11 * http/tests/inspector/change-iframe-src.html: Added. 12 1 13 2010-07-02 Yury Semikhatsky <yurys@chromium.org> 2 14 -
trunk/WebCore/ChangeLog
r62378 r62380 1 2010-07-02 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 [v8] Web Inspector: inspected page crashes on attempt to change iframe's src attribute 6 https://bugs.webkit.org/show_bug.cgi?id=41511 7 8 Tests: fast/events/popup-blocked-from-fake-user-gesture.html 9 http/tests/inspector/change-iframe-src.html 10 11 * bindings/v8/ScriptController.cpp: 12 (WebCore::ScriptController::processingUserGesture): use V8Proxy from the ScriptController instead of one 13 from the call stack. Get event directly from hidden property to avoid unnecessary checks. 14 * bindings/v8/V8AbstractEventListener.cpp: 15 (WebCore::V8AbstractEventListener::invokeEventHandler): 16 * bindings/v8/V8HiddenPropertyName.h: 17 * bindings/v8/custom/V8DOMWindowCustom.cpp: 18 (WebCore::V8DOMWindow::eventAccessorGetter): 19 (WebCore::V8DOMWindow::eventAccessorSetter): 20 1 21 2010-07-02 Adam Barth <abarth@webkit.org> 2 22 -
trunk/WebCore/bindings/v8/ScriptController.cpp
r62274 r62380 54 54 #include "V8DOMWindow.h" 55 55 #include "V8Event.h" 56 #include "V8HiddenPropertyName.h" 56 57 #include "V8HTMLEmbedElement.h" 57 58 #include "V8IsolatedContext.h" … … 161 162 bool ScriptController::processingUserGesture(DOMWrapperWorld*) const 162 163 { 163 Frame* activeFrame = V8Proxy::retrieveFrameForEnteredContext();164 164 // No script is running, so it is user-initiated unless the gesture stack 165 165 // explicitly says it is not. 166 if (! activeFrame)166 if (!m_proxy->executingScript()) 167 167 return UserGestureIndicator::getUserGestureState() != DefinitelyNotProcessingUserGesture; 168 168 169 V8Proxy* activeProxy = activeFrame->script()->proxy(); 170 171 v8::HandleScope handleScope; 172 v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(activeFrame); 169 v8::HandleScope handleScope; 170 v8::Handle<v8::Context> v8Context = m_proxy->mainWorldContext(); 173 171 // FIXME: find all cases context can be empty: 174 172 // 1) JS is disabled; … … 180 178 181 179 v8::Handle<v8::Object> global = v8Context->Global(); 182 v8::Handle<v8::Value> jsEvent = global->Get(v8::String::NewSymbol("event")); 180 v8::Handle<v8::String> eventSymbol = V8HiddenPropertyName::event(); 181 v8::Handle<v8::Value> jsEvent = global->GetHiddenValue(eventSymbol); 183 182 Event* event = V8DOMWrapper::isValidDOMObject(jsEvent) ? V8Event::toNative(v8::Handle<v8::Object>::Cast(jsEvent)) : 0; 184 183 … … 189 188 return event->fromUserGesture(); 190 189 } 191 if (m_sourceURL && m_sourceURL->isNull() && ! activeProxy->timerCallback()) {190 if (m_sourceURL && m_sourceURL->isNull() && !m_proxy->timerCallback()) { 192 191 // This is the <a href="javascript:window.open('...')> case -> we let it through. 193 192 return true; -
trunk/WebCore/bindings/v8/V8AbstractEventListener.cpp
r62274 r62380 39 39 #include "V8Event.h" 40 40 #include "V8EventListenerList.h" 41 #include "V8HiddenPropertyName.h" 41 42 #include "V8Proxy.h" 42 43 #include "V8Utilities.h" … … 127 128 128 129 // We push the event being processed into the global object, so that it can be exposed by DOMWindow's bindings. 129 v8:: Local<v8::String> eventSymbol = v8::String::NewSymbol("event");130 v8::Handle<v8::String> eventSymbol = V8HiddenPropertyName::event(); 130 131 v8::Local<v8::Value> returnValue; 131 132 -
trunk/WebCore/bindings/v8/V8HiddenPropertyName.h
r62274 r62380 42 42 V(scriptState) \ 43 43 V(sleepFunction) \ 44 V(toStringString) 44 V(toStringString) \ 45 V(event) 45 46 46 47 class V8HiddenPropertyName { -
trunk/WebCore/bindings/v8/V8Proxy.cpp
r61531 r62380 363 363 } 364 364 365 bool V8Proxy::executingScript() const 366 { 367 return m_recursion; 368 } 369 365 370 v8::Local<v8::Value> V8Proxy::evaluate(const ScriptSourceCode& source, Node* node) 366 371 { -
trunk/WebCore/bindings/v8/V8Proxy.h
r61640 r62380 211 211 void evaluateInIsolatedWorld(int worldId, const Vector<ScriptSourceCode>& sources, int extensionGroup); 212 212 213 // Returns true if the proxy is currently executing a script in V8. 214 bool executingScript() const; 215 213 216 // Evaluate a script file in the current execution environment. 214 217 // The caller must hold an execution context. -
trunk/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
r62274 r62380 59 59 #include "V8DatabaseCallback.h" 60 60 #include "V8GCForContextDispose.h" 61 #include "V8HiddenPropertyName.h" 61 62 #include "V8HTMLAudioElementConstructor.h" 62 63 #include "V8HTMLCollection.h" … … 176 177 return v8::Undefined(); 177 178 178 v8:: Local<v8::String> eventSymbol = v8::String::NewSymbol("event");179 v8::Handle<v8::String> eventSymbol = V8HiddenPropertyName::event(); 179 180 v8::Handle<v8::Value> jsEvent = context->Global()->GetHiddenValue(eventSymbol); 180 181 if (jsEvent.IsEmpty()) … … 197 198 return; 198 199 199 v8:: Local<v8::String> eventSymbol = v8::String::NewSymbol("event");200 v8::Handle<v8::String> eventSymbol = V8HiddenPropertyName::event(); 200 201 context->Global()->SetHiddenValue(eventSymbol, value); 201 202 } -
trunk/WebKit/chromium/ChangeLog
r62351 r62380 1 2010-07-02 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 [v8] Web Inspector: inspected page crashes on attempt to change iframe's src attribute 6 https://bugs.webkit.org/show_bug.cgi?id=41511 7 8 * src/WebBindings.cpp: 9 (WebKit::getEvent): 10 1 11 2010-07-01 Sheriff Bot <webkit.review.bot@gmail.com> 2 12 -
trunk/WebKit/chromium/src/WebBindings.cpp
r62274 r62380 46 46 #include "V8Event.h" 47 47 #include "V8Helpers.h" 48 #include "V8HiddenPropertyName.h" 48 49 #include "V8NPUtils.h" 49 50 #include "V8Proxy.h" … … 209 210 static v8::Local<v8::Value> getEvent(const v8::Handle<v8::Context>& context) 210 211 { 211 static v8::Persistent<v8::String> eventSymbol(v8::Persistent<v8::String>::New(v8::String::NewSymbol("event"))); 212 return context->Global()->GetHiddenValue(eventSymbol); 212 return context->Global()->GetHiddenValue(V8HiddenPropertyName::event()); 213 213 } 214 214
Note: See TracChangeset
for help on using the changeset viewer.