Changeset 262058 in webkit
- Timestamp:
- May 22, 2020 8:17:10 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r262056 r262058 1 2020-05-22 Chris Dumez <cdumez@apple.com> 2 3 Regression(r254859) DOM storage event gets fired at the frame that caused the storage modification 4 https://bugs.webkit.org/show_bug.cgi?id=211503 5 <rdar://problem/62983284> 6 7 Reviewed by Maciej Stachowiak. 8 9 Add layout test coverage. 10 11 * storage/domstorage/events/resources/storage-event-not-in-originator-frame.html: Added. 12 * storage/domstorage/events/storage-event-not-in-originator-expected.txt: Added. 13 * storage/domstorage/events/storage-event-not-in-originator.html: Added. 14 1 15 2020-05-22 Carlos Alberto Lopez Perez <clopez@igalia.com> 2 16 -
trunk/Source/WebKit/ChangeLog
r262055 r262058 1 2020-05-22 Chris Dumez <cdumez@apple.com> 2 3 Regression(r254859) DOM storage event gets fired at the frame that caused the storage modification 4 https://bugs.webkit.org/show_bug.cgi?id=211503 5 <rdar://problem/62983284> 6 7 Reviewed by Maciej Stachowiak. 8 9 r254859 refactored StorageAreaMap's dispatchSessionStorageEvent() & 10 dispatchLocalStorageEvent() to share more code by moving that code to 11 a new framesForEventDispatching() static function. However, 12 framesForEventDispatching() was always using the session storage no 13 matter the call site. It should be using the local storage when called 14 from dispatchLocalStorageEvent(). 15 16 Test: storage/domstorage/events/storage-event-not-in-originator.html 17 18 * WebProcess/WebStorage/StorageAreaMap.cpp: 19 (WebKit::framesForEventDispatching): 20 (WebKit::StorageAreaMap::dispatchSessionStorageEvent): 21 (WebKit::StorageAreaMap::dispatchLocalStorageEvent): 22 1 23 2020-05-22 Tim Horton <timothy_horton@apple.com> 2 24 -
trunk/Source/WebKit/WebProcess/WebStorage/StorageAreaMap.cpp
r260709 r262058 277 277 } 278 278 279 static Vector<RefPtr<Frame>> framesForEventDispatching(Page& page, SecurityOrigin& origin, const Optional<StorageAreaImplIdentifier>& storageAreaImplID)279 static Vector<RefPtr<Frame>> framesForEventDispatching(Page& page, SecurityOrigin& origin, StorageType storageType, const Optional<StorageAreaImplIdentifier>& storageAreaImplID) 280 280 { 281 281 Vector<RefPtr<Frame>> frames; … … 283 283 if (!document.securityOrigin().equal(&origin)) 284 284 return; 285 286 auto* window = document.domWindow(); 287 if (!window) 288 return; 285 289 286 auto* storage = document.domWindow() ? document.domWindow()->optionalSessionStorage() : nullptr; 290 Storage* storage = nullptr; 291 switch (storageType) { 292 case StorageType::Session: 293 storage = window->optionalSessionStorage(); 294 break; 295 case StorageType::Local: 296 case StorageType::TransientLocal: 297 storage = window->optionalLocalStorage(); 298 break; 299 } 300 287 301 if (!storage) 288 302 return; … … 312 326 return; 313 327 314 auto frames = framesForEventDispatching(*page, m_securityOrigin, storageAreaImplID);328 auto frames = framesForEventDispatching(*page, m_securityOrigin, StorageType::Session, storageAreaImplID); 315 329 StorageEventDispatcher::dispatchSessionStorageEventsToFrames(*page, frames, key, oldValue, newValue, urlString, m_securityOrigin->data()); 316 330 } … … 325 339 auto& pageGroup = *WebProcess::singleton().webPageGroup(m_namespace.pageGroupID())->corePageGroup(); 326 340 for (auto* page : pageGroup.pages()) 327 frames.appendVector(framesForEventDispatching(*page, m_securityOrigin, storageAreaImplID));341 frames.appendVector(framesForEventDispatching(*page, m_securityOrigin, StorageType::Local, storageAreaImplID)); 328 342 329 343 StorageEventDispatcher::dispatchLocalStorageEventsToFrames(pageGroup, frames, key, oldValue, newValue, urlString, m_securityOrigin->data());
Note: See TracChangeset
for help on using the changeset viewer.