Changeset 245924 in webkit
- Timestamp:
- May 30, 2019, 5:30:10 PM (7 years ago)
- Location:
- branches/safari-607-branch
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/window-inner-width-crash-expected.txt (added)
-
LayoutTests/fast/dom/window-inner-width-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/DOMWindow.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-607-branch/LayoutTests/ChangeLog
r245922 r245924 1 2019-05-30 Kocsen Chung <kocsen_chung@apple.com> 2 3 Cherry-pick r245509. rdar://problem/51264845 4 5 Wait to get frame until after layout has been run 6 https://bugs.webkit.org/show_bug.cgi?id=197999 7 <rdar://problem/50800345> 8 9 Reviewed by Alex Christensen. 10 11 Source/WebCore: 12 13 The current frame can change when layout runs, so don't bother retrieving 14 the frame until the final layout pass is complete. 15 16 Test: fast/dom/window-inner-width-crash.html 17 18 * page/DOMWindow.cpp: 19 (WebCore::DOMWindow::innerHeight const): Move frame access past the 20 layout operation. 21 (WebCore::DOMWindow::innerWidth const): Ditto. 22 (WebCore::DOMWindow::scrollX const): Ditto. 23 (WebCore::DOMWindow::scrollY const): Ditto. 24 25 LayoutTests: 26 27 * fast/dom/window-inner-width-crash-expected.txt: Added. 28 * fast/dom/window-inner-width-crash.html: Added. 29 30 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245509 268f45cc-cd09-0410-ab3c-d52691b4dbfc 31 32 2019-05-19 Brent Fulgham <bfulgham@apple.com> 33 34 Wait to get frame until after layout has been run 35 https://bugs.webkit.org/show_bug.cgi?id=197999 36 <rdar://problem/50800345> 37 38 Reviewed by Alex Christensen. 39 40 * fast/dom/window-inner-width-crash-expected.txt: Added. 41 * fast/dom/window-inner-width-crash.html: Added. 42 1 43 2019-05-30 Kocsen Chung <kocsen_chung@apple.com> 2 44 -
branches/safari-607-branch/Source/WebCore/ChangeLog
r245923 r245924 1 2019-05-30 Kocsen Chung <kocsen_chung@apple.com> 2 3 Cherry-pick r245509. rdar://problem/51264845 4 5 Wait to get frame until after layout has been run 6 https://bugs.webkit.org/show_bug.cgi?id=197999 7 <rdar://problem/50800345> 8 9 Reviewed by Alex Christensen. 10 11 Source/WebCore: 12 13 The current frame can change when layout runs, so don't bother retrieving 14 the frame until the final layout pass is complete. 15 16 Test: fast/dom/window-inner-width-crash.html 17 18 * page/DOMWindow.cpp: 19 (WebCore::DOMWindow::innerHeight const): Move frame access past the 20 layout operation. 21 (WebCore::DOMWindow::innerWidth const): Ditto. 22 (WebCore::DOMWindow::scrollX const): Ditto. 23 (WebCore::DOMWindow::scrollY const): Ditto. 24 25 LayoutTests: 26 27 * fast/dom/window-inner-width-crash-expected.txt: Added. 28 * fast/dom/window-inner-width-crash.html: Added. 29 30 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245509 268f45cc-cd09-0410-ab3c-d52691b4dbfc 31 32 2019-05-19 Brent Fulgham <bfulgham@apple.com> 33 34 Wait to get frame until after layout has been run 35 https://bugs.webkit.org/show_bug.cgi?id=197999 36 <rdar://problem/50800345> 37 38 Reviewed by Alex Christensen. 39 40 The current frame can change when layout runs, so don't bother retrieving 41 the frame until the final layout pass is complete. 42 43 Test: fast/dom/window-inner-width-crash.html 44 45 * page/DOMWindow.cpp: 46 (WebCore::DOMWindow::innerHeight const): Move frame access past the 47 layout operation. 48 (WebCore::DOMWindow::innerWidth const): Ditto. 49 (WebCore::DOMWindow::scrollX const): Ditto. 50 (WebCore::DOMWindow::scrollY const): Ditto. 51 1 52 2019-05-30 Kocsen Chung <kocsen_chung@apple.com> 2 53 -
branches/safari-607-branch/Source/WebCore/page/DOMWindow.cpp
r245346 r245924 1237 1237 int DOMWindow::innerHeight() const 1238 1238 { 1239 auto* frame = this->frame(); 1240 if (!frame) 1241 return 0; 1242 1239 if (!frame()) 1240 return 0; 1241 1243 1242 // Force enough layout in the parent document to ensure that the FrameView has been resized. 1244 1243 if (auto* frameElement = this->frameElement()) 1245 1244 frameElement->document().updateLayoutIfDimensionsOutOfDate(*frameElement, HeightDimensionsCheck); 1246 1245 1246 auto* frame = this->frame(); 1247 if (!frame) 1248 return 0; 1249 1247 1250 FrameView* view = frame->view(); 1248 1251 if (!view) … … 1254 1257 int DOMWindow::innerWidth() const 1255 1258 { 1256 auto* frame = this->frame(); 1257 if (!frame) 1259 if (!frame()) 1258 1260 return 0; 1259 1261 … … 1262 1264 frameElement->document().updateLayoutIfDimensionsOutOfDate(*frameElement, WidthDimensionsCheck); 1263 1265 1266 auto* frame = this->frame(); 1267 if (!frame) 1268 return 0; 1269 1264 1270 FrameView* view = frame->view(); 1265 1271 if (!view) … … 1311 1317 frame->document()->updateLayoutIgnorePendingStylesheets(); 1312 1318 1313 return view->mapFromLayoutToCSSUnits(view->contentsScrollPosition().x()); 1319 // Layout may have affected the current frame: 1320 auto* frameAfterLayout = this->frame(); 1321 if (!frameAfterLayout) 1322 return 0; 1323 1324 FrameView* viewAfterLayout = frameAfterLayout->view(); 1325 if (!viewAfterLayout) 1326 return 0; 1327 1328 return viewAfterLayout->mapFromLayoutToCSSUnits(viewAfterLayout->contentsScrollPosition().x()); 1314 1329 } 1315 1330 … … 1330 1345 frame->document()->updateLayoutIgnorePendingStylesheets(); 1331 1346 1332 return view->mapFromLayoutToCSSUnits(view->contentsScrollPosition().y()); 1347 // Layout may have affected the current frame: 1348 auto* frameAfterLayout = this->frame(); 1349 if (!frameAfterLayout) 1350 return 0; 1351 1352 FrameView* viewAfterLayout = frameAfterLayout->view(); 1353 if (!viewAfterLayout) 1354 return 0; 1355 1356 return viewAfterLayout->mapFromLayoutToCSSUnits(viewAfterLayout->contentsScrollPosition().y()); 1333 1357 } 1334 1358
Note:
See TracChangeset
for help on using the changeset viewer.