Changeset 12480 in webkit
- Timestamp:
- Jan 30, 2006 12:14:38 PM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r12478 r12480 1 2006-01-30 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Dave Harrison. 4 5 - Fixed <rdar://problem/4378159> crash in KWQKHTMLPart::userGestureHint 6 from javascript enabled/disabled inconsistency when pasting webpage 7 into email or blot 8 9 * page/Frame.cpp: 10 (Frame::userGestureHint): Check root frame's jScript() for NULL instead 11 of checking inner frame's jScript(). 12 13 After init() has been called on a frame, but before begin() has been 14 called, the frame can have JavaScript enabled when its parent doesn't. 15 (That seems wrong, so I've filed <rdar://problem/4426499> Child frame 16 momentarily has JavaScript enabled even though parent frame doesn't.) 17 18 Regardless, it's better programming practice to NULL check the actual 19 pointer you're going to use, so that's what I've done here. 20 21 * manual-tests/paste-crash.html: Added. 22 (No automated test because the crash depends on JavaScript being 23 disabled.) 24 1 25 2006-01-30 Beth Dakin <bdakin@apple.com> 2 26 -
trunk/WebCore/page/Frame.cpp
r12476 r12480 3072 3072 bool Frame::userGestureHint() 3073 3073 { 3074 if (jScript() && jScript()->interpreter()) { 3075 Frame *rootPart = this; 3076 while (rootPart->parentFrame() != 0) 3077 rootPart = rootPart->parentFrame(); 3078 KJS::ScriptInterpreter *interpreter = rootPart->jScript()->interpreter(); 3079 return interpreter->wasRunByUserGesture(); 3080 } else 3081 // if no JS, assume the user initiated this nav 3082 return true; 3074 Frame *rootFrame = this; 3075 while (rootFrame->parentFrame()) 3076 rootFrame = rootFrame->parentFrame(); 3077 3078 if (rootFrame->jScript() && rootFrame->jScript()->interpreter()) 3079 return rootFrame->jScript()->interpreter()->wasRunByUserGesture(); 3080 3081 return true; // If JavaScript is disabled, a user gesture must have initiated the navigation 3083 3082 } 3084 3083
Note: See TracChangeset
for help on using the changeset viewer.