Changeset 208173 in webkit
- Timestamp:
- Oct 31, 2016 2:03:56 PM (8 years ago)
- Location:
- branches/safari-602-branch/Source
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-602-branch/Source/WebCore/ChangeLog
r208167 r208173 1 2016-10-31 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r208168. rdar://problem/28962886 4 5 2016-10-28 Brent Fulgham <bfulgham@apple.com> 6 7 Do a better job of protecting Frame objects in the context of JavaScript calls 8 https://bugs.webkit.org/show_bug.cgi?id=164163 9 <rdar://problem/28955249> 10 11 Reviewed by Darin Adler. 12 13 * editing/AlternativeTextController.cpp: 14 (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Protected the Frame. 15 * editing/Editor.cpp: 16 (WebCore::Editor::setTextAsChildOfElement): Ditto. 17 * editing/EditorCommand.cpp: 18 (WebCore::executeSwapWithMark): Ditto. 19 * editing/TypingCommand.cpp: 20 (WebCore::TypingCommand::deleteKeyPressed): Ditto. 21 (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto. 22 * editing/mac/EditorMac.mm: 23 (WebCore::Editor::replaceNodeFromPasteboard): Ditto. 24 * page/ContextMenuController.cpp: 25 (WebCore::ContextMenuController::contextMenuItemSelected): Ditto. 26 * page/DOMSelection.cpp: 27 (WebCore::DOMSelection::collapse): Ditto. 28 (WebCore::DOMSelection::collapseToEnd): Ditto. 29 (WebCore::DOMSelection::collapseToStart): Ditto. 30 (WebCore::DOMSelection::setBaseAndExtent): Ditto. 31 (WebCore::DOMSelection::setPosition): Ditto. 32 (WebCore::DOMSelection::modify): Ditto. 33 (WebCore::DOMSelection::extend): Ditto. 34 (WebCore::DOMSelection::addRange): Ditto. 35 (WebCore::DOMSelection::deleteFromDocument): Ditto. 36 * page/DragController.cpp: 37 (WebCore::setSelectionToDragCaret): Ditto. 38 (WebCore::DragController::startDrag): Ditto. 39 * page/Frame.cpp: 40 (WebCore::Frame::checkOverflowScroll): Ditto. 41 * page/TextIndicator.cpp: 42 (WebCore::TextIndicator::createWithRange): Ditto. 43 1 44 2016-10-31 Matthew Hanson <matthew_hanson@apple.com> 2 45 -
branches/safari-602-branch/Source/WebCore/editing/AlternativeTextController.cpp
r203322 r208173 1 1 /* 2 * Copyright (C) 2006 , 2007, 2008Apple Inc. All rights reserved.2 * Copyright (C) 2006-2008, 2016 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 4 * … … 318 318 if (AlternativeTextClient* client = alternativeTextClient()) 319 319 client->recordAutocorrectionResponse(AutocorrectionReverted, corrected, correction); 320 321 Ref<Frame> protector(m_frame); 320 322 m_frame.document()->updateLayout(); 321 323 m_frame.selection().setSelection(selectionOfCorrected, FrameSelection::defaultSetSelectionOptions() | FrameSelection::SpellCorrectionTriggered); -
branches/safari-602-branch/Source/WebCore/editing/Editor.cpp
r205950 r208173 1 1 /* 2 * Copyright (C) 2006 , 2007, 2008, 2011, 2013-2015Apple Inc. All rights reserved.2 * Copyright (C) 2006-2008, 2011, 2013-2016 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 4 * … … 1791 1791 void Editor::setComposition(const String& text, const Vector<CompositionUnderline>& underlines, unsigned selectionStart, unsigned selectionEnd) 1792 1792 { 1793 Ref<Frame> protection(m_frame); 1794 1793 1795 UserTypingGestureIndicator typingGestureIndicator(m_frame); 1794 1796 … … 1924 1926 void Editor::advanceToNextMisspelling(bool startBeforeSelection) 1925 1927 { 1928 Ref<Frame> protection(m_frame); 1929 1926 1930 // The basic approach is to search in two phases - from the selection end to the end of the doc, and 1927 1931 // then we wrap and search from the doc start to (approximately) where we started. … … 2242 2246 void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart, const VisibleSelection& selectionAfterTyping, bool doReplacement) 2243 2247 { 2248 Ref<Frame> protection(m_frame); 2249 2244 2250 #if PLATFORM(IOS) 2245 2251 UNUSED_PARAM(selectionAfterTyping); … … 2492 2498 void Editor::markAndReplaceFor(PassRefPtr<SpellCheckRequest> request, const Vector<TextCheckingResult>& results) 2493 2499 { 2500 Ref<Frame> protection(m_frame); 2494 2501 ASSERT(request); 2495 2502 … … 2950 2957 void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection, FrameSelection::SetSelectionOptions options) 2951 2958 { 2959 Ref<Frame> protection(m_frame); 2960 2952 2961 // If the new selection is orphaned, then don't update the selection. 2953 2962 if (newSelection.start().isOrphan() || newSelection.end().isOrphan()) … … 3140 3149 bool Editor::findString(const String& target, FindOptions options) 3141 3150 { 3151 Ref<Frame> protection(m_frame); 3152 3142 3153 VisibleSelection selection = m_frame.selection().selection(); 3143 3154 -
branches/safari-602-branch/Source/WebCore/editing/EditorCommand.cpp
r202242 r208173 1 1 /* 2 * Copyright (C) 2006 , 2007, 2008, 2014Apple Inc. All rights reserved.2 * Copyright (C) 2006-2008, 2014, 2016 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 4 * Copyright (C) 2009 Igalia S.L. … … 1062 1062 static bool executeSwapWithMark(Frame& frame, Event*, EditorCommandSource, const String&) 1063 1063 { 1064 Ref<Frame> protector(frame); 1064 1065 const VisibleSelection& mark = frame.editor().mark(); 1065 1066 const VisibleSelection& selection = frame.selection().selection(); -
branches/safari-602-branch/Source/WebCore/editing/TypingCommand.cpp
r203322 r208173 1 1 /* 2 * Copyright (C) 2005 , 2006, 2007, 2008Apple Inc. All rights reserved.2 * Copyright (C) 2005-2008, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 476 476 { 477 477 Frame& frame = this->frame(); 478 Ref<Frame> protector(frame); 478 479 479 480 frame.editor().updateMarkersForWordsAffectedByEditing(false); … … 589 590 { 590 591 Frame& frame = this->frame(); 592 Ref<Frame> protector(frame); 591 593 592 594 frame.editor().updateMarkersForWordsAffectedByEditing(false); -
branches/safari-602-branch/Source/WebCore/editing/mac/EditorMac.mm
r203322 r208173 261 261 return; 262 262 263 Ref<Frame> protector(m_frame); 263 264 RefPtr<Range> range = Range::create(node->document(), Position(node, Position::PositionIsBeforeAnchor), Position(node, Position::PositionIsAfterAnchor)); 264 265 m_frame.selection().setSelection(VisibleSelection(*range), FrameSelection::DoNotSetFocus); -
branches/safari-602-branch/Source/WebCore/page/ContextMenuController.cpp
r203322 r208173 1 1 /* 2 * Copyright (C) 2006 , 2007Apple Inc. All rights reserved.2 * Copyright (C) 2006-2007, 2016 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2010 Igalia S.L 4 4 * … … 224 224 return; 225 225 226 Ref<Frame> protector(*frame); 227 226 228 switch (action) { 227 229 case ContextMenuItemTagOpenLinkInNewWindow: -
branches/safari-602-branch/Source/WebCore/page/DOMSelection.cpp
r200931 r208173 1 1 /* 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2009, 2016 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2012 Google Inc. All rights reserved. 4 4 * … … 202 202 203 203 // FIXME: Eliminate legacy editing positions 204 Ref<Frame> protector(*m_frame); 204 205 m_frame->selection().moveTo(createLegacyEditingPosition(node, offset), DOWNSTREAM); 205 206 } … … 217 218 } 218 219 220 Ref<Frame> protector(*m_frame); 219 221 m_frame->selection().moveTo(selection.end(), DOWNSTREAM); 220 222 } … … 232 234 } 233 235 236 Ref<Frame> protector(*m_frame); 234 237 m_frame->selection().moveTo(selection.start(), DOWNSTREAM); 235 238 } … … 256 259 257 260 // FIXME: Eliminate legacy editing positions 261 Ref<Frame> protector(*m_frame); 258 262 m_frame->selection().moveTo(createLegacyEditingPosition(baseNode, baseOffset), createLegacyEditingPosition(extentNode, extentOffset), DOWNSTREAM); 259 263 } … … 272 276 273 277 // FIXME: Eliminate legacy editing positions 278 Ref<Frame> protector(*m_frame); 274 279 m_frame->selection().moveTo(createLegacyEditingPosition(node, offset), DOWNSTREAM); 275 280 } … … 322 327 return; 323 328 329 Ref<Frame> protector(*m_frame); 324 330 m_frame->selection().modify(alter, direction, granularity); 325 331 } … … 339 345 340 346 // FIXME: Eliminate legacy editing positions 347 Ref<Frame> protector(*m_frame); 341 348 m_frame->selection().setExtent(createLegacyEditingPosition(&node, offset), DOWNSTREAM); 342 349 } … … 377 384 if (!r) 378 385 return; 386 387 Ref<Frame> protector(*m_frame); 379 388 380 389 FrameSelection& selection = m_frame->selection(); … … 429 438 return; 430 439 440 Ref<Frame> protector(*m_frame); 431 441 selectedRange->deleteContents(ASSERT_NO_EXCEPTION); 432 442 -
branches/safari-602-branch/Source/WebCore/page/DragController.cpp
r203085 r208173 1 1 /* 2 * Copyright (C) 2007, 2009 , 2010, 2013, 2015Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2009-2010, 2013, 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 433 433 static bool setSelectionToDragCaret(Frame* frame, VisibleSelection& dragCaret, RefPtr<Range>& range, const IntPoint& point) 434 434 { 435 Ref<Frame> protector(*frame); 435 436 frame->selection().setSelection(dragCaret); 436 437 if (frame->selection().selection().isNone()) { … … 753 754 return false; 754 755 756 Ref<Frame> protector(src); 755 757 HitTestResult hitTestResult = src.eventHandler().hitTestResultAtPoint(dragOrigin, HitTestRequest::ReadOnly | HitTestRequest::Active); 756 758 -
branches/safari-602-branch/Source/WebCore/page/Frame.cpp
r207207 r208173 604 604 } 605 605 606 Ref<Frame> protectedThis(*this); 607 606 608 if (action == PerformOverflowScroll && (deltaX || deltaY)) { 607 609 layer->scrollToOffset(layer->scrollOffset() + IntSize(deltaX, deltaY)); -
branches/safari-602-branch/Source/WebCore/page/TextIndicator.cpp
r199817 r208173 1 1 /* 2 * Copyright (C) 2010, 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 70 70 return nullptr; 71 71 72 Ref<Frame> protector(*frame); 73 72 74 #if PLATFORM(IOS) 73 75 frame->editor().setIgnoreCompositionSelectionChange(true); -
branches/safari-602-branch/Source/WebKit2/ChangeLog
r208162 r208173 1 2016-10-31 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r208168. rdar://problem/28962886 4 5 2016-10-28 Brent Fulgham <bfulgham@apple.com> 6 7 Do a better job of protecting Frame objects in the context of JavaScript calls 8 https://bugs.webkit.org/show_bug.cgi?id=164163 9 <rdar://problem/28955249> 10 11 Reviewed by Darin Adler. 12 13 * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: 14 (WebKit::InjectedBundleRangeHandle::renderedImage): Protected the Frame. 15 * WebProcess/WebPage/WebPage.cpp: 16 (WebKit::WebPage::insertTextAsync): Ditto. 17 (WebKit::WebPage::setComposition): Ditto. 18 * WebProcess/WebPage/mac/WebPageMac.mm: 19 (WebKit::WebPage::insertDictatedTextAsync): Ditto. 20 1 21 2016-10-31 Matthew Hanson <matthew_hanson@apple.com> 2 22 -
branches/safari-602-branch/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp
r202242 r208173 1 1 /* 2 * Copyright (C) 2010, 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 114 114 return nullptr; 115 115 116 Ref<Frame> protector(*frame); 117 116 118 VisibleSelection oldSelection = frame->selection().selection(); 117 119 frame->selection().setSelection(VisibleSelection(*m_range)); -
branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r207801 r208173 4583 4583 Frame& frame = m_page->focusController().focusedOrMainFrame(); 4584 4584 4585 Ref<Frame> protector(frame); 4586 4585 4587 if (replacementEditingRange.location != notFound) { 4586 4588 RefPtr<Range> replacementRange = rangeFromEditingRange(frame, replacementEditingRange, static_cast<EditingRangeIsRelativeTo>(editingRangeIsRelativeTo)); … … 4746 4748 return; 4747 4749 } 4750 4751 Ref<Frame> protector(*targetFrame); 4748 4752 4749 4753 if (replacementLength > 0) { -
branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
r207750 r208173 1 1 /* 2 * Copyright (C) 2010 , 2011, 2012, 2015Apple Inc. All rights reserved.2 * Copyright (C) 2010-2012, 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 328 328 Frame& frame = m_page->focusController().focusedOrMainFrame(); 329 329 330 Ref<Frame> protector(frame); 331 330 332 if (replacementEditingRange.location != notFound) { 331 333 RefPtr<Range> replacementRange = rangeFromEditingRange(frame, replacementEditingRange);
Note: See TracChangeset
for help on using the changeset viewer.