Changeset 41484 in webkit
- Timestamp:
- Mar 6, 2009, 9:22:07 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r41480 r41484 1 2009-03-06 Darin Adler <darin@apple.com> 2 3 Reviewed by Darin Fisher. 4 5 Bug 24422: REGRESSION: null-URL crash in FrameLoader setting location.hash on new window 6 https://bugs.webkit.org/show_bug.cgi?id=24422 7 rdar://problem/6402208 8 9 The new test manipulates all the properties of the location object on a new window which 10 has no location yet. I tested Firefox too and added comments about how its behavior differs 11 from WebKit. At some point we may want to tweak our behavior to be a bit closer to theirs, 12 or check IE's behavior or if HTML 5 or some other W3 specification has something to say 13 about this, but for now the main purpose of the test is to verify we don't crash. 14 15 * fast/dom/location-new-window-no-crash-expected.txt: Added. 16 * fast/dom/location-new-window-no-crash.html: Added. 17 * fast/dom/resources/location-new-window-no-crash.js: Added. 18 1 19 2009-03-06 Darin Adler <darin@apple.com> 2 20 -
trunk/WebCore/ChangeLog
r41483 r41484 1 2009-03-06 Darin Adler <darin@apple.com> 2 3 Reviewed by Darin Fisher. 4 5 Bug 24422: REGRESSION: null-URL crash in FrameLoader setting location.hash on new window 6 https://bugs.webkit.org/show_bug.cgi?id=24422 7 rdar://problem/6402208 8 9 Test: fast/dom/location-new-window-no-crash.html 10 11 The issue here is empty (or null) URLs. I picked the "schedule navigation" bottleneck 12 to add some checks for empty URLs. We could also put the empty URL checks at some 13 other bottleneck level and add more assertions over time. I tried adding a few more 14 assertions to functions like loadURL and hit them while running the regression tests, 15 so it's probably going to be a bit tricky to clean this up throughout the loader. 16 17 * loader/FrameLoader.cpp: 18 (WebCore::ScheduledRedirection::ScheduledRedirection): Explicitly marked this struct 19 immutable by making all its members const. Added assertions about the arguments, 20 including that the URL is not empty. Initialized one uninitialized member in one of 21 the constructors. 22 (WebCore::FrameLoader::scheduleHTTPRedirection): Added an early exit to make this 23 a no-op if passed an empty URL. 24 (WebCore::FrameLoader::scheduleLocationChange): Ditto. 25 (WebCore::FrameLoader::scheduleRefresh): Ditto. 26 1 27 2009-03-06 Gustavo Noronha Silva <gns@gnome.org> 2 28 -
trunk/WebCore/loader/FrameLoader.cpp
r41431 r41484 145 145 struct ScheduledRedirection { 146 146 enum Type { redirection, locationChange, historyNavigation, locationChangeDuringLoad }; 147 Type type; 148 double delay; 149 String url; 150 String referrer; 151 int historySteps; 152 bool lockHistory; 153 bool lockBackForwardList; 154 bool wasUserGesture; 155 bool wasRefresh; 147 148 const Type type; 149 const double delay; 150 const String url; 151 const String referrer; 152 const int historySteps; 153 const bool lockHistory; 154 const bool lockBackForwardList; 155 const bool wasUserGesture; 156 const bool wasRefresh; 156 157 157 158 ScheduledRedirection(double delay, const String& url, bool lockHistory, bool lockBackForwardList, bool wasUserGesture, bool refresh) … … 165 166 , wasRefresh(refresh) 166 167 { 168 ASSERT(!url.isEmpty()); 167 169 } 168 170 … … 178 180 , wasRefresh(refresh) 179 181 { 182 ASSERT(locationChangeType == locationChange || locationChangeType == locationChangeDuringLoad); 183 ASSERT(!url.isEmpty()); 180 184 } 181 185 … … 185 189 , historySteps(historyNavigationSteps) 186 190 , lockHistory(false) 191 , lockBackForwardList(false) 187 192 , wasUserGesture(false) 188 193 , wasRefresh(false) … … 373 378 } 374 379 375 376 380 void FrameLoader::changeLocation(const KURL& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool userGesture, bool refresh) 377 381 { … … 1314 1318 return; 1315 1319 1320 if (url.isEmpty()) 1321 return; 1322 1316 1323 // We want a new history item if the refresh timeout is > 1 second. 1317 1324 if (!m_scheduledRedirection || delay <= m_scheduledRedirection->delay) … … 1322 1329 { 1323 1330 if (!m_frame->page()) 1331 return; 1332 1333 if (url.isEmpty()) 1324 1334 return; 1325 1335 … … 1353 1363 { 1354 1364 if (!m_frame->page()) 1365 return; 1366 1367 if (m_URL.isEmpty()) 1355 1368 return; 1356 1369 … … 1466 1479 { 1467 1480 ASSERT(childFrame); 1481 1468 1482 HistoryItem* parentItem = currentHistoryItem(); 1469 1483 FrameLoadType loadType = this->loadType(); … … 1472 1486 KURL workingURL = url; 1473 1487 1474 // If we're moving in the back forward list, we might want to replace the content1488 // If we're moving in the back/forward list, we might want to replace the content 1475 1489 // of this child frame with whatever was there at that point. 1476 1490 if (parentItem && parentItem->children().size() && isBackForwardLoadType(loadType)) {
Note:
See TracChangeset
for help on using the changeset viewer.