Changeset 57313 in webkit
- Timestamp:
- Apr 8, 2010 11:43:19 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r57305 r57313 1 2010-04-08 Chris Evans <cevans@chromium.org> 2 3 Reviewed by Sam Weinig. 4 5 Add test for POST & _blank popup blocker bypass. 6 https://bugs.webkit.org/show_bug.cgi?id=34541 7 8 * fast/events/popup-blocked-to-post-blank.html: added 9 * fast/events/popup-blocked-to-post-blank-expected.txt: added 10 1 11 2010-04-08 Ojan Vafai <ojan@chromium.org> 2 12 -
trunk/WebCore/ChangeLog
r57304 r57313 1 2010-04-08 Chris Evans <cevans@chromium.org> 2 3 Reviewed by Sam Weinig. 4 5 Use the new UserGestureIndictor for _blank POST requests. 6 7 https://bugs.webkit.org/show_bug.cgi?id=34541 8 9 Test: fast/events/popup-blocked-to-post-blank.html 10 11 * bindings/v8/ScriptController.cpp: 12 (WebCore::ScriptController::processingUserGesture): 13 Use UserGestureIndicator in more cases. 14 * page/EventHandler.cpp: 15 (WebCore::EventHandler): 16 Impact from UserGestureIndicator API change. 17 (WebCore::FrameLoader::submitForm): 18 Block the load immediately if popups are not allowed and it would 19 open a new window. 20 * loader/RedirectScheduler.cpp: 21 (WebCore::ScheduledFormSubmission::ScheduledFormSubmission): 22 Note the UserGestureIndicator status at the time of submission. 23 (WebCore::ScheduledFormSubmission::fire): 24 Use the stored UserGestureIndicator status in the asynchronous 25 callback. 26 * dom/UserGestureIndicator.h: 27 * dom/UserGestureIndicator.cpp: 28 (WebCore::UserGestureIndicator::UserGestureIndicator): 29 Add ability to store a negative indication. 30 1 31 2010-03-29 Antonio Gomes <tonikitoo@webkit.org> 2 32 -
trunk/WebCore/bindings/v8/ScriptController.cpp
r57243 r57313 155 155 { 156 156 Frame* activeFrame = V8Proxy::retrieveFrameForEnteredContext(); 157 // No script is running, so it must be run by users. 157 // No script is running, so it is user-initiated unless the gesture stack 158 // explicitly says it is not. 158 159 if (!activeFrame) 159 return true;160 return UserGestureIndicator::processingUserGesture(); 160 161 161 162 V8Proxy* activeProxy = activeFrame->script()->proxy(); -
trunk/WebCore/dom/UserGestureIndicator.cpp
r57159 r57313 31 31 bool UserGestureIndicator::s_processingUserGesture = false; 32 32 33 UserGestureIndicator::UserGestureIndicator( )33 UserGestureIndicator::UserGestureIndicator(ProcessingUserGestureState state) 34 34 : m_previousValue(s_processingUserGesture) 35 35 { 36 s_processingUserGesture = true; 36 if (state == DefinitelyProcessingUserGesture) 37 s_processingUserGesture = true; 37 38 } 38 39 -
trunk/WebCore/dom/UserGestureIndicator.h
r57159 r57313 31 31 namespace WebCore { 32 32 33 enum ProcessingUserGestureState { 34 DefinitelyProcessingUserGesture, 35 PossiblyProcessingUserGesture 36 }; 37 33 38 class UserGestureIndicator : public Noncopyable { 34 39 public: 35 40 static bool processingUserGesture() { return s_processingUserGesture; } 36 37 UserGestureIndicator();41 42 explicit UserGestureIndicator(ProcessingUserGestureState); 38 43 ~UserGestureIndicator(); 39 44 40 45 private: 41 46 static bool s_processingUserGesture; -
trunk/WebCore/loader/FrameLoader.cpp
r57095 r57313 477 477 return; 478 478 if (!targetFrame) { 479 if (!DOMWindow::allowPopUp(m_frame) && !isProcessingUserGesture()) 480 return; 481 479 482 targetFrame = m_frame; 480 483 frameRequest.setFrameName(targetOrBaseTarget); -
trunk/WebCore/loader/RedirectScheduler.cpp
r56875 r57313 44 44 #include "HTMLFrameOwnerElement.h" 45 45 #include "Page.h" 46 #include "UserGestureIndicator.h" 46 47 #include <wtf/CurrentTime.h> 47 48 … … 176 177 , m_event(event) 177 178 , m_formState(formState) 179 , m_wasProcessingUserGesture(UserGestureIndicator::processingUserGesture()) 178 180 { 179 181 ASSERT(!frameRequest.isEmpty()); … … 183 185 virtual void fire(Frame* frame) 184 186 { 187 UserGestureIndicator gestureIndicator(m_wasProcessingUserGesture ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture); 188 185 189 // The submitForm function will find a target frame before using the redirection timer. 186 190 // Now that the timer has fired, we need to repeat the security check which normally is done when … … 201 205 const RefPtr<Event> m_event; 202 206 const RefPtr<FormState> m_formState; 207 bool m_wasProcessingUserGesture; 203 208 }; 204 209 -
trunk/WebCore/page/EventHandler.cpp
r57045 r57313 1167 1167 { 1168 1168 RefPtr<FrameView> protector(m_frame->view()); 1169 1170 UserGestureIndicator gestureIndicator ;1171 1169 1170 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 1171 1172 1172 cancelFakeMouseMoveEvent(); 1173 1173 m_mousePressed = true; … … 1298 1298 { 1299 1299 RefPtr<FrameView> protector(m_frame->view()); 1300 1301 UserGestureIndicator gestureIndicator ;1300 1301 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 1302 1302 1303 1303 // We get this instead of a second mouse-up … … 1468 1468 RefPtr<FrameView> protector(m_frame->view()); 1469 1469 1470 UserGestureIndicator gestureIndicator ;1470 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 1471 1471 1472 1472 #if ENABLE(PAN_SCROLLING) … … 2128 2128 if (!node) 2129 2129 return false; 2130 2131 UserGestureIndicator gestureIndicator ;2130 2131 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 2132 2132 2133 2133 if (FrameView* view = m_frame->view()) … … 2697 2697 const Vector<PlatformTouchPoint>& points = event.touchPoints(); 2698 2698 AtomicString* eventName = 0; 2699 2700 UserGestureIndicator gestureIndicator ;2699 2700 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 2701 2701 2702 2702 for (unsigned i = 0; i < points.size(); ++i) {
Note: See TracChangeset
for help on using the changeset viewer.