Changeset 215872 in webkit
- Timestamp:
- Apr 27, 2017, 9:42:13 AM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r215870 r215872 1 2017-04-27 Alex Christensen <achristensen@webkit.org> 2 3 Modernize Frame.h 4 https://bugs.webkit.org/show_bug.cgi?id=171357 5 6 Reviewed by Andy Estes. 7 8 Frame.h has several std::unique_ptrs that are created in the constructor, never null, 9 and destroyed in the destructor. This is what WTF::UniqueRef is for, and using UniqueRef 10 allows us to not check for null values because a UniqueRef can never be null. 11 An interesting case was the EventHandler, which we explicitly set to nullptr in the destructor 12 of MainFrame, a subclass of Frame. We added this in r199181 to fix a crash tested by 13 fast/events/wheel-event-destroys-frame.html and this improved lifetime also does not crash 14 or assert in that test. 15 16 Using UniqueRef also requires const correctness, which this patch adds when necessary. 17 18 * accessibility/AccessibilityObject.cpp: 19 (WebCore::AccessibilityObject::dispatchTouchEvent): 20 * editing/DeleteSelectionCommand.cpp: 21 (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete): 22 * editing/Editor.cpp: 23 (WebCore::Editor::isSelectTrailingWhitespaceEnabled): 24 (WebCore::Editor::computeAndSetTypingStyle): 25 * editing/Editor.h: 26 * editing/FrameSelection.cpp: 27 (WebCore::FrameSelection::contains): 28 (WebCore::FrameSelection::copyTypingStyle): 29 * editing/FrameSelection.h: 30 (WebCore::FrameSelection::setTypingStyle): 31 * loader/EmptyClients.cpp: 32 * loader/FrameLoader.cpp: 33 (WebCore::FrameLoader::clear): 34 * page/EditorClient.h: 35 * page/EventHandler.cpp: 36 (WebCore::EventHandler::hitTestResultAtPoint): 37 * page/EventHandler.h: 38 * page/Frame.cpp: 39 (WebCore::Frame::Frame): 40 (WebCore::Frame::setView): 41 (WebCore::Frame::injectUserScripts): 42 * page/Frame.h: 43 (WebCore::Frame::editor): 44 (WebCore::Frame::eventHandler): 45 (WebCore::Frame::selection): 46 (WebCore::Frame::animation): 47 (WebCore::Frame::script): 48 (WebCore::Frame::eventHandlerPtr): Deleted. 49 * page/MainFrame.cpp: 50 (WebCore::MainFrame::~MainFrame): 51 * replay/UserInputBridge.cpp: 52 (WebCore::UserInputBridge::handleContextMenuEvent): 53 * replay/UserInputBridge.h: 54 1 55 2017-04-27 Andy Estes <aestes@apple.com> 2 56 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r215837 r215872 952 952 bool AccessibilityObject::dispatchTouchEvent() 953 953 { 954 bool handled = false;955 954 #if ENABLE(IOS_TOUCH_EVENTS) 956 MainFrame* frame = mainFrame(); 957 if (!frame) 958 return false; 959 960 handled = frame->eventHandler().dispatchSimulatedTouchEvent(clickPoint()); 955 if (auto* frame = mainFrame()) 956 return frame->eventHandler().dispatchSimulatedTouchEvent(clickPoint()); 961 957 #endif 962 return handled;958 return false; 963 959 } 964 960 -
trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp
r213355 r215872 764 764 // but, if we change the selection, come back and start typing that style should be lost. Also see 765 765 // preserveTypingStyle() below. 766 frame().selection().setTypingStyle(m_typingStyle );766 frame().selection().setTypingStyle(m_typingStyle.copyRef()); 767 767 } 768 768 -
trunk/Source/WebCore/editing/Editor.cpp
r215160 r215872 362 362 } 363 363 364 bool Editor::isSelectTrailingWhitespaceEnabled() 364 bool Editor::isSelectTrailingWhitespaceEnabled() const 365 365 { 366 366 return client() && client()->isSelectTrailingWhitespaceEnabled(); … … 3042 3042 3043 3043 // Set the remaining style as the typing style. 3044 m_frame.selection().setTypingStyle( typingStyle);3044 m_frame.selection().setTypingStyle(WTFMove(typingStyle)); 3045 3045 } 3046 3046 -
trunk/Source/WebCore/editing/Editor.h
r213902 r215872 313 313 // mutually exclusive, meaning that enabling one will disable the other. 314 314 bool smartInsertDeleteEnabled(); 315 bool isSelectTrailingWhitespaceEnabled() ;315 bool isSelectTrailingWhitespaceEnabled() const; 316 316 317 317 WEBCORE_EXPORT bool hasBidiSelection() const; -
trunk/Source/WebCore/editing/FrameSelection.cpp
r215167 r215872 1814 1814 } 1815 1815 1816 bool FrameSelection::contains(const LayoutPoint& point) 1816 bool FrameSelection::contains(const LayoutPoint& point) const 1817 1817 { 1818 1818 // Treat a collapsed selection like no selection. … … 2202 2202 } 2203 2203 2204 PassRefPtr<MutableStyleProperties> FrameSelection::copyTypingStyle() const2204 RefPtr<MutableStyleProperties> FrameSelection::copyTypingStyle() const 2205 2205 { 2206 2206 if (!m_typingStyle || !m_typingStyle->style()) 2207 return 0;2207 return nullptr; 2208 2208 return m_typingStyle->style()->mutableCopy(); 2209 2209 } … … 2429 2429 } 2430 2430 2431 PassRefPtr<Range> FrameSelection::elementRangeContainingCaretSelection() const2431 RefPtr<Range> FrameSelection::elementRangeContainingCaretSelection() const 2432 2432 { 2433 2433 if (m_selection.isNone()) … … 2468 2468 } 2469 2469 2470 PassRefPtr<Range> FrameSelection::wordRangeContainingCaretSelection()2470 RefPtr<Range> FrameSelection::wordRangeContainingCaretSelection() 2471 2471 { 2472 2472 return wordSelectionContainingCaretSelection(m_selection).toNormalizedRange(); … … 2620 2620 } 2621 2621 2622 PassRefPtr<Range> FrameSelection::rangeByMovingCurrentSelection(int amount) const2622 RefPtr<Range> FrameSelection::rangeByMovingCurrentSelection(int amount) const 2623 2623 { 2624 2624 return rangeByAlteringCurrentSelection(AlterationMove, amount); 2625 2625 } 2626 2626 2627 PassRefPtr<Range> FrameSelection::rangeByExtendingCurrentSelection(int amount) const2627 RefPtr<Range> FrameSelection::rangeByExtendingCurrentSelection(int amount) const 2628 2628 { 2629 2629 return rangeByAlteringCurrentSelection(AlterationExtend, amount); … … 2786 2786 } 2787 2787 2788 PassRefPtr<Range> FrameSelection::rangeByAlteringCurrentSelection(EAlteration alteration, int amount) const2788 RefPtr<Range> FrameSelection::rangeByAlteringCurrentSelection(EAlteration alteration, int amount) const 2789 2789 { 2790 2790 if (m_selection.isNone()) -
trunk/Source/WebCore/editing/FrameSelection.h
r215724 r215872 154 154 void setNeedsSelectionUpdate(); 155 155 156 bool contains(const LayoutPoint&) ;156 bool contains(const LayoutPoint&) const; 157 157 158 158 WEBCORE_EXPORT bool modify(EAlteration, SelectionDirection, TextGranularity, EUserTriggered = NotUserTriggered); … … 216 216 public: 217 217 WEBCORE_EXPORT void expandSelectionToElementContainingCaretSelection(); 218 WEBCORE_EXPORT PassRefPtr<Range> elementRangeContainingCaretSelection() const;218 WEBCORE_EXPORT RefPtr<Range> elementRangeContainingCaretSelection() const; 219 219 WEBCORE_EXPORT void expandSelectionToWordContainingCaretSelection(); 220 WEBCORE_EXPORT PassRefPtr<Range> wordRangeContainingCaretSelection();220 WEBCORE_EXPORT RefPtr<Range> wordRangeContainingCaretSelection(); 221 221 WEBCORE_EXPORT void expandSelectionToStartOfWordContainingCaretSelection(); 222 222 WEBCORE_EXPORT UChar characterInRelationToCaretSelection(int amount) const; … … 228 228 WEBCORE_EXPORT bool selectionAtSentenceStart() const; 229 229 WEBCORE_EXPORT bool selectionAtWordStart() const; 230 WEBCORE_EXPORT PassRefPtr<Range> rangeByMovingCurrentSelection(int amount) const;231 WEBCORE_EXPORT PassRefPtr<Range> rangeByExtendingCurrentSelection(int amount) const;230 WEBCORE_EXPORT RefPtr<Range> rangeByMovingCurrentSelection(int amount) const; 231 WEBCORE_EXPORT RefPtr<Range> rangeByExtendingCurrentSelection(int amount) const; 232 232 WEBCORE_EXPORT void selectRangeOnElement(unsigned location, unsigned length, Node&); 233 233 WEBCORE_EXPORT void clearCurrentSelection(); … … 244 244 private: 245 245 bool actualSelectionAtSentenceStart(const VisibleSelection&) const; 246 PassRefPtr<Range> rangeByAlteringCurrentSelection(EAlteration, int amount) const;246 RefPtr<Range> rangeByAlteringCurrentSelection(EAlteration, int amount) const; 247 247 public: 248 248 #endif … … 254 254 255 255 EditingStyle* typingStyle() const; 256 WEBCORE_EXPORT PassRefPtr<MutableStyleProperties> copyTypingStyle() const;257 void setTypingStyle( PassRefPtr<EditingStyle>);256 WEBCORE_EXPORT RefPtr<MutableStyleProperties> copyTypingStyle() const; 257 void setTypingStyle(RefPtr<EditingStyle>&& style) { m_typingStyle = WTFMove(style); } 258 258 void clearTypingStyle(); 259 259 … … 365 365 } 366 366 367 inline void FrameSelection::setTypingStyle(PassRefPtr<EditingStyle> style)368 {369 m_typingStyle = style;370 }371 372 367 #if !(PLATFORM(COCOA) || PLATFORM(GTK)) 373 368 #if HAVE(ACCESSIBILITY) -
trunk/Source/WebCore/loader/EmptyClients.cpp
r215831 r215872 147 147 bool shouldDeleteRange(Range*) final { return false; } 148 148 bool smartInsertDeleteEnabled() final { return false; } 149 bool isSelectTrailingWhitespaceEnabled() final { return false; }149 bool isSelectTrailingWhitespaceEnabled() const final { return false; } 150 150 bool isContinuousSpellCheckingEnabled() final { return false; } 151 151 void toggleContinuousSpellChecking() final { } -
trunk/Source/WebCore/loader/FrameLoader.cpp
r215816 r215872 628 628 629 629 m_frame.selection().prepareForDestruction(); 630 631 // We may call this code during object destruction, so need to make sure eventHandler is present. 632 if (auto eventHandler = m_frame.eventHandlerPtr()) 633 eventHandler->clear(); 630 m_frame.eventHandler().clear(); 634 631 635 632 if (clearFrameView && m_frame.view()) -
trunk/Source/WebCore/page/EditorClient.h
r210845 r215872 71 71 virtual bool shouldDeleteRange(Range*) = 0; 72 72 virtual bool smartInsertDeleteEnabled() = 0; 73 virtual bool isSelectTrailingWhitespaceEnabled() = 0;73 virtual bool isSelectTrailingWhitespaceEnabled() const = 0; 74 74 virtual bool isContinuousSpellCheckingEnabled() = 0; 75 75 virtual void toggleContinuousSpellChecking() = 0; -
trunk/Source/WebCore/page/EventHandler.cpp
r215404 r215872 1119 1119 #endif // ENABLE(DRAG_SUPPORT) 1120 1120 1121 HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, HitTestRequest::HitTestRequestType hitType, const LayoutSize& padding) 1121 HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, HitTestRequest::HitTestRequestType hitType, const LayoutSize& padding) const 1122 1122 { 1123 1123 Ref<Frame> protectedFrame(m_frame); -
trunk/Source/WebCore/page/EventHandler.h
r215404 r215872 148 148 void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); 149 149 150 WEBCORE_EXPORT HitTestResult hitTestResultAtPoint(const LayoutPoint&, 151 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowUserAgentShadowContent, 152 const LayoutSize& padding = LayoutSize()); 150 WEBCORE_EXPORT HitTestResult hitTestResultAtPoint(const LayoutPoint&, HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowUserAgentShadowContent, const LayoutSize& padding = LayoutSize()) const; 153 151 154 152 bool mousePressed() const { return m_mousePressed; } -
trunk/Source/WebCore/page/Frame.cpp
r215831 r215872 158 158 , m_navigationScheduler(*this) 159 159 , m_ownerElement(ownerElement) 160 , m_script( std::make_unique<ScriptController>(*this))161 , m_editor( std::make_unique<Editor>(*this))162 , m_selection( std::make_unique<FrameSelection>(this))163 , m_animationController( std::make_unique<CSSAnimationController>(*this))160 , m_script(makeUniqueRef<ScriptController>(*this)) 161 , m_editor(makeUniqueRef<Editor>(*this)) 162 , m_selection(makeUniqueRef<FrameSelection>(this)) 163 , m_animationController(makeUniqueRef<CSSAnimationController>(*this)) 164 164 #if PLATFORM(IOS) 165 165 , m_overflowAutoScrollTimer(*this, &Frame::overflowAutoScrollTimerFired) … … 169 169 , m_textZoomFactor(parentTextZoomFactor(this)) 170 170 , m_activeDOMObjectsAndAnimationsSuspendedCount(0) 171 , m_eventHandler( std::make_unique<EventHandler>(*this))171 , m_eventHandler(makeUniqueRef<EventHandler>(*this)) 172 172 { 173 173 AtomicString::init(); … … 252 252 m_view->unscheduleRelayout(); 253 253 254 // This may be called during destruction, so need to do a null check. 255 if (m_eventHandler) 256 m_eventHandler->clear(); 254 m_eventHandler->clear(); 257 255 258 256 RELEASE_ASSERT(!m_doc || !m_doc->hasLivingRenderTree()); … … 715 713 if (m_page) 716 714 m_page->setAsRunningUserScripts(); 717 if (m_script) 718 m_script->evaluateInWorld(ScriptSourceCode(script.source(), script.url()), world); 715 m_script->evaluateInWorld(ScriptSourceCode(script.source(), script.url()), world); 719 716 } 720 717 }); -
trunk/Source/WebCore/page/Frame.h
r211949 r215872 35 35 #include "ScrollTypes.h" 36 36 #include "UserScriptTypes.h" 37 #include <memory>38 37 #include <wtf/ThreadSafeRefCounted.h> 38 #include <wtf/UniqueRef.h> 39 39 40 40 #if PLATFORM(IOS) … … 144 144 FrameView* view() const; 145 145 146 Editor& editor() const; 147 EventHandler& eventHandler() const; 148 EventHandler* eventHandlerPtr() const; 146 Editor& editor() { return m_editor; } 147 const Editor& editor() const { return m_editor; } 148 EventHandler& eventHandler() { return m_eventHandler; } 149 const EventHandler& eventHandler() const { return m_eventHandler; } 149 150 FrameLoader& loader() const; 150 151 NavigationScheduler& navigationScheduler() const; 151 FrameSelection& selection() const; 152 FrameSelection& selection() { return m_selection; } 153 const FrameSelection& selection() const { return m_selection; } 152 154 FrameTree& tree() const; 153 CSSAnimationController& animation() const; 154 ScriptController& script(); 155 CSSAnimationController& animation() { return m_animationController; } 156 const CSSAnimationController& animation() const { return m_animationController; } 157 ScriptController& script() { return m_script; } 158 const ScriptController& script() const { return m_script; } 155 159 156 160 WEBCORE_EXPORT RenderView* contentRenderer() const; // Root of the render tree for the document contained in this frame. … … 242 246 WEBCORE_EXPORT int preferredHeight() const; 243 247 WEBCORE_EXPORT void updateLayout() const; 244 WEBCORE_EXPORT NSRect caretRect() const;245 WEBCORE_EXPORT NSRect rectForScrollToVisible() const;248 WEBCORE_EXPORT NSRect caretRect(); 249 WEBCORE_EXPORT NSRect rectForScrollToVisible(); 246 250 WEBCORE_EXPORT unsigned formElementsCharacterCount() const; 247 251 … … 289 293 RefPtr<Document> m_doc; 290 294 291 const std::unique_ptr<ScriptController> m_script;292 const std::unique_ptr<Editor> m_editor;293 const std::unique_ptr<FrameSelection> m_selection;294 const std::unique_ptr<CSSAnimationController> m_animationController;295 UniqueRef<ScriptController> m_script; 296 UniqueRef<Editor> m_editor; 297 UniqueRef<FrameSelection> m_selection; 298 UniqueRef<CSSAnimationController> m_animationController; 295 299 296 300 #if ENABLE(DATA_DETECTION) … … 325 329 326 330 protected: 327 std::unique_ptr<EventHandler> m_eventHandler;331 UniqueRef<EventHandler> m_eventHandler; 328 332 }; 329 333 … … 348 352 } 349 353 350 inline ScriptController& Frame::script()351 {352 return *m_script;353 }354 355 354 inline Document* Frame::document() const 356 355 { … … 358 357 } 359 358 360 inline FrameSelection& Frame::selection() const361 {362 return *m_selection;363 }364 365 inline Editor& Frame::editor() const366 {367 return *m_editor;368 }369 370 inline CSSAnimationController& Frame::animation() const371 {372 return *m_animationController;373 }374 375 359 inline HTMLFrameOwnerElement* Frame::ownerElement() const 376 360 { … … 391 375 { 392 376 m_page = nullptr; 393 }394 395 inline EventHandler& Frame::eventHandler() const396 {397 return *m_eventHandler;398 }399 400 inline EventHandler* Frame::eventHandlerPtr() const401 {402 return m_eventHandler.get();403 377 } 404 378 -
trunk/Source/WebCore/page/MainFrame.cpp
r214294 r215872 60 60 { 61 61 m_recentWheelEventDeltaFilter = nullptr; 62 m_eventHandler = nullptr;63 62 64 63 setMainFrameWasDestroyed(); -
trunk/Source/WebCore/page/ios/FrameIOS.mm
r211741 r215872 511 511 } 512 512 513 NSRect Frame::caretRect() const513 NSRect Frame::caretRect() 514 514 { 515 515 VisibleSelection visibleSelection = selection().selection(); … … 519 519 } 520 520 521 NSRect Frame::rectForScrollToVisible() const521 NSRect Frame::rectForScrollToVisible() 522 522 { 523 523 VisibleSelection selection(this->selection().selection()); -
trunk/Source/WebCore/replay/UserInputBridge.cpp
r214113 r215872 70 70 71 71 #if ENABLE(CONTEXT_MENUS) 72 bool UserInputBridge::handleContextMenuEvent(const PlatformMouseEvent& mouseEvent, const Frame*frame, InputSource)73 { 74 return frame ->eventHandler().sendContextMenuEvent(mouseEvent);72 bool UserInputBridge::handleContextMenuEvent(const PlatformMouseEvent& mouseEvent, Frame& frame, InputSource) 73 { 74 return frame.eventHandler().sendContextMenuEvent(mouseEvent); 75 75 } 76 76 #endif -
trunk/Source/WebCore/replay/UserInputBridge.h
r214113 r215872 73 73 // User input APIs. 74 74 #if ENABLE(CONTEXT_MENUS) 75 WEBCORE_EXPORT bool handleContextMenuEvent(const PlatformMouseEvent&, const Frame*, InputSource source = InputSource::User);75 WEBCORE_EXPORT bool handleContextMenuEvent(const PlatformMouseEvent&, Frame&, InputSource = InputSource::User); 76 76 #endif 77 77 WEBCORE_EXPORT bool handleMousePressEvent(const PlatformMouseEvent&, InputSource source = InputSource::User); -
trunk/Source/WebKit/mac/ChangeLog
r215866 r215872 1 2017-04-27 Alex Christensen <achristensen@webkit.org> 2 3 Modernize Frame.h 4 https://bugs.webkit.org/show_bug.cgi?id=171357 5 6 Reviewed by Andy Estes. 7 8 * WebCoreSupport/WebEditorClient.h: 9 * WebCoreSupport/WebEditorClient.mm: 10 (WebEditorClient::isSelectTrailingWhitespaceEnabled): 11 1 12 2017-04-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 13 -
trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h
r210845 r215872 59 59 60 60 bool smartInsertDeleteEnabled() final; 61 bool isSelectTrailingWhitespaceEnabled() final;61 bool isSelectTrailingWhitespaceEnabled() const final; 62 62 63 63 bool shouldDeleteRange(WebCore::Range*) final; -
trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
r212642 r215872 243 243 } 244 244 245 bool WebEditorClient::isSelectTrailingWhitespaceEnabled() 245 bool WebEditorClient::isSelectTrailingWhitespaceEnabled() const 246 246 { 247 247 Page* page = [m_webView page]; -
trunk/Source/WebKit/win/ChangeLog
r215585 r215872 1 2017-04-27 Alex Christensen <achristensen@webkit.org> 2 3 Modernize Frame.h 4 https://bugs.webkit.org/show_bug.cgi?id=171357 5 6 Reviewed by Andy Estes. 7 8 * WebCoreSupport/WebEditorClient.cpp: 9 (WebEditorClient::isSelectTrailingWhitespaceEnabled): 10 * WebCoreSupport/WebEditorClient.h: 11 1 12 2017-04-20 Fujii Hironori <Hironori.Fujii@sony.com> 2 13 -
trunk/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp
r210845 r215872 383 383 } 384 384 385 bool WebEditorClient::isSelectTrailingWhitespaceEnabled(void) 385 bool WebEditorClient::isSelectTrailingWhitespaceEnabled(void) const 386 386 { 387 387 Page* page = m_webView->page(); -
trunk/Source/WebKit/win/WebCoreSupport/WebEditorClient.h
r210845 r215872 71 71 72 72 bool smartInsertDeleteEnabled() final; 73 bool isSelectTrailingWhitespaceEnabled() final;73 bool isSelectTrailingWhitespaceEnabled() const final; 74 74 75 75 void registerUndoStep(WebCore::UndoStep&) final; -
trunk/Source/WebKit2/ChangeLog
r215862 r215872 1 2017-04-27 Alex Christensen <achristensen@webkit.org> 2 3 Modernize Frame.h 4 https://bugs.webkit.org/show_bug.cgi?id=171357 5 6 Reviewed by Andy Estes. 7 8 * WebProcess/WebCoreSupport/WebEditorClient.cpp: 9 (WebKit::WebEditorClient::isSelectTrailingWhitespaceEnabled): 10 * WebProcess/WebCoreSupport/WebEditorClient.h: 11 * WebProcess/WebPage/WebPage.cpp: 12 (WebKit::WebPage::contextMenuAtPointInWindow): 13 (WebKit::handleContextMenuEvent): 14 (WebKit::WebPage::isSelectTrailingWhitespaceEnabled): 15 * WebProcess/WebPage/WebPage.h: 16 * WebProcess/WebPage/ios/WebPageIOS.mm: 17 (WebKit::WebPage::selectWithGesture): 18 (WebKit::WebPage::selectPositionAtPoint): 19 (WebKit::WebPage::selectPositionAtBoundaryWithDirection): 20 (WebKit::WebPage::rangeForGranularityAtPoint): 21 (WebKit::WebPage::selectTextWithGranularityAtPoint): 22 (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary): 23 (WebKit::WebPage::updateSelectionWithExtentPoint): 24 1 25 2017-04-27 Carlos Garcia Campos <cgarcia@igalia.com> 2 26 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
r215255 r215872 83 83 } 84 84 85 bool WebEditorClient::isSelectTrailingWhitespaceEnabled() 85 bool WebEditorClient::isSelectTrailingWhitespaceEnabled() const 86 86 { 87 87 return m_page->isSelectTrailingWhitespaceEnabled(); -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
r210845 r215872 43 43 bool shouldDeleteRange(WebCore::Range*) final; 44 44 bool smartInsertDeleteEnabled() final; 45 bool isSelectTrailingWhitespaceEnabled() final;45 bool isSelectTrailingWhitespaceEnabled() const final; 46 46 bool isContinuousSpellCheckingEnabled() final; 47 47 void toggleContinuousSpellChecking() final; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r215724 r215872 2136 2136 // Simulate a mouse click to generate the correct menu. 2137 2137 PlatformMouseEvent mouseEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, WebCore::NoTap); 2138 bool handled = corePage()->userInputBridge().handleContextMenuEvent(mouseEvent, &corePage()->mainFrame());2138 bool handled = corePage()->userInputBridge().handleContextMenuEvent(mouseEvent, corePage()->mainFrame()); 2139 2139 if (!handled) 2140 2140 return 0; … … 2261 2261 frame = result.innerNonSharedNode()->document().frame(); 2262 2262 2263 bool handled = page->corePage()->userInputBridge().handleContextMenuEvent(platformMouseEvent, frame);2263 bool handled = page->corePage()->userInputBridge().handleContextMenuEvent(platformMouseEvent, *frame); 2264 2264 if (handled) 2265 2265 page->contextMenu()->show(); … … 5187 5187 } 5188 5188 5189 bool WebPage::isSelectTrailingWhitespaceEnabled() 5189 bool WebPage::isSelectTrailingWhitespaceEnabled() const 5190 5190 { 5191 5191 return m_page->settings().selectTrailingWhitespaceEnabled(); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r215724 r215872 721 721 void setSmartInsertDeleteEnabled(bool); 722 722 723 bool isSelectTrailingWhitespaceEnabled() ;723 bool isSelectTrailingWhitespaceEnabled() const; 724 724 void setSelectTrailingWhitespaceEnabled(bool); 725 725 … … 1012 1012 void resetTextAutosizing(); 1013 1013 WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithAssistedNode); 1014 RefPtr<WebCore::Range> rangeForGranularityAtPoint( constWebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode);1014 RefPtr<WebCore::Range> rangeForGranularityAtPoint(WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode); 1015 1015 bool shouldSwitchToBlockModeForHandle(const WebCore::IntPoint& handlePoint, SelectionHandlePosition); 1016 1016 RefPtr<WebCore::Range> switchToBlockSelectionAtPoint(const WebCore::IntPoint&, SelectionHandlePosition); -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r215446 r215872 1041 1041 void WebPage::selectWithGesture(const IntPoint& point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, uint64_t callbackID) 1042 1042 { 1043 const Frame& frame = m_page->focusController().focusedOrMainFrame();1043 auto& frame = m_page->focusController().focusedOrMainFrame(); 1044 1044 VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode); 1045 1045 … … 1920 1920 void WebPage::selectPositionAtPoint(const WebCore::IntPoint& point, bool isInteractingWithAssistedNode, uint64_t callbackID) 1921 1921 { 1922 const Frame& frame = m_page->focusController().focusedOrMainFrame();1922 auto& frame = m_page->focusController().focusedOrMainFrame(); 1923 1923 VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode); 1924 1924 … … 1930 1930 void WebPage::selectPositionAtBoundaryWithDirection(const WebCore::IntPoint& point, uint32_t granularity, uint32_t direction, bool isInteractingWithAssistedNode, uint64_t callbackID) 1931 1931 { 1932 const Frame& frame = m_page->focusController().focusedOrMainFrame();1932 auto& frame = m_page->focusController().focusedOrMainFrame(); 1933 1933 VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode); 1934 1934 … … 1955 1955 } 1956 1956 1957 RefPtr<Range> WebPage::rangeForGranularityAtPoint( constFrame& frame, const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithAssistedNode)1957 RefPtr<Range> WebPage::rangeForGranularityAtPoint(Frame& frame, const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithAssistedNode) 1958 1958 { 1959 1959 VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode); … … 1987 1987 void WebPage::selectTextWithGranularityAtPoint(const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithAssistedNode, uint64_t callbackID) 1988 1988 { 1989 const Frame& frame = m_page->focusController().focusedOrMainFrame();1989 auto& frame = m_page->focusController().focusedOrMainFrame(); 1990 1990 RefPtr<Range> range = rangeForGranularityAtPoint(frame, point, granularity, isInteractingWithAssistedNode); 1991 1991 if (!isInteractingWithAssistedNode) { … … 2020 2020 void WebPage::updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithAssistedNode, uint64_t callbackID) 2021 2021 { 2022 const Frame& frame = m_page->focusController().focusedOrMainFrame();2022 auto& frame = m_page->focusController().focusedOrMainFrame(); 2023 2023 VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode); 2024 2024 RefPtr<Range> newRange = rangeForGranularityAtPoint(frame, point, granularity, isInteractingWithAssistedNode); … … 2049 2049 void WebPage::updateSelectionWithExtentPoint(const WebCore::IntPoint& point, bool isInteractingWithAssistedNode, uint64_t callbackID) 2050 2050 { 2051 const Frame& frame = m_page->focusController().focusedOrMainFrame();2051 auto& frame = m_page->focusController().focusedOrMainFrame(); 2052 2052 VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode); 2053 2053
Note:
See TracChangeset
for help on using the changeset viewer.