Changeset 38924 in webkit
- Timestamp:
- Dec 2, 2008 4:13:31 PM (15 years ago)
- Location:
- trunk/WebKit/wx
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/wx/ChangeLog
r38738 r38924 1 2008-12-02 Kevin Watters <kevinwatters@gmail.com> 2 3 Reviewed by Kevin Ollivier. 4 5 Add HitTest to wxWebView (and wxWebFrame). 6 7 https://bugs.webkit.org/show_bug.cgi?id=22459 8 9 * WebFrame.cpp: 10 (wxWebFrame::HitTest): 11 * WebFrame.h: 12 * WebView.cpp: 13 (wxWebView::HitTest): 14 * WebView.h: 15 1 16 2008-11-24 Darin Fisher <darin@chromium.org> 2 17 -
trunk/WebKit/wx/WebFrame.cpp
r38687 r38924 29 29 #include "Editor.h" 30 30 #include "Element.h" 31 #include "EventHandler.h" 31 32 #include "Frame.h" 32 33 #include "FrameLoader.h" 33 34 #include "FrameView.h" 35 #include "HitTestResult.h" 34 36 #include "HTMLFrameOwnerElement.h" 35 37 #include "markup.h" … … 347 349 348 350 } 351 352 wxWebViewDOMElementInfo wxWebFrame::HitTest(const wxPoint& pos) const 353 { 354 wxWebViewDOMElementInfo domInfo; 355 356 if (m_impl->frame->view()) { 357 WebCore::HitTestResult result = m_impl->frame->eventHandler()->hitTestResultAtPoint(m_impl->frame->view()->windowToContents(pos), false); 358 if (result.innerNode()) { 359 domInfo.SetLink(result.absoluteLinkURL().string()); 360 domInfo.SetText(result.textContent()); 361 domInfo.SetImageSrc(result.absoluteImageURL().string()); 362 domInfo.SetSelected(result.isSelected()); 363 } 364 } 365 366 return domInfo; 367 } 368 -
trunk/WebKit/wx/WebFrame.h
r38687 r38924 59 59 #endif // SWIG 60 60 61 class WXDLLIMPEXP_WEBKIT wxWebViewDOMElementInfo 62 { 63 public: 64 wxWebViewDOMElementInfo(); 65 66 ~wxWebViewDOMElementInfo() { } 67 68 wxString GetTagName() const { return m_tagName; } 69 void SetTagName(const wxString& name) { m_tagName = name; } 70 71 bool IsSelected() const { return m_isSelected; } 72 void SetSelected(bool sel) { m_isSelected = sel; } 73 74 wxString GetText() const { return m_text; } 75 void SetText(const wxString& text) { m_text = text; } 76 77 wxString GetImageSrc() const { return m_imageSrc; } 78 void SetImageSrc(const wxString& src) { m_imageSrc = src; } 79 80 wxString GetLink() const { return m_link; } 81 void SetLink(const wxString& link) { m_link = link; } 82 83 private: 84 void* m_domElement; 85 bool m_isSelected; 86 wxString m_tagName; 87 wxString m_text; 88 wxString m_imageSrc; 89 wxString m_link; 90 }; 91 61 92 class WXDLLIMPEXP_WEBKIT wxWebFrame 62 93 { … … 115 146 116 147 WebCore::Frame* GetFrame(); 148 149 wxWebViewDOMElementInfo HitTest(const wxPoint& post) const; 117 150 118 151 private: -
trunk/WebKit/wx/WebView.cpp
r38687 r38924 628 628 event.Skip(); 629 629 } 630 631 wxWebViewDOMElementInfo wxWebView::HitTest(const wxPoint& pos) const 632 { 633 if (m_mainFrame) 634 return m_mainFrame->HitTest(pos); 635 636 return wxWebViewDOMElementInfo(); 637 } 638 -
trunk/WebKit/wx/WebView.h
r38424 r38924 34 34 #endif 35 35 36 #include "WebFrame.h" 37 36 38 class WebViewPrivate; 37 39 class WebViewFrameData; … … 135 137 136 138 wxWebFrame* GetMainFrame() { return m_mainFrame; } 139 140 wxWebViewDOMElementInfo HitTest(const wxPoint& post) const; 137 141 138 142 protected: … … 189 193 }; 190 194 191 class WXDLLIMPEXP_WEBKIT wxWebViewDOMElementInfo192 {193 public:194 wxWebViewDOMElementInfo();195 196 ~wxWebViewDOMElementInfo() { }197 198 wxString GetTagName() const { return m_tagName; }199 void SetTagName(const wxString& name) { m_tagName = name; }200 201 bool IsSelected() const { return m_isSelected; }202 void SetSelected(bool sel) { m_isSelected = sel; }203 204 wxString GetText() const { return m_text; }205 void SetText(const wxString& text) { m_text = text; }206 207 wxString GetImageSrc() const { return m_imageSrc; }208 void SetImageSrc(const wxString& src) { m_imageSrc = src; }209 210 wxString GetLink() const { return m_link; }211 void SetLink(const wxString& link) { m_link = link; }212 213 private:214 void* m_domElement;215 bool m_isSelected;216 wxString m_tagName;217 wxString m_text;218 wxString m_imageSrc;219 wxString m_link;220 };221 222 195 class WXDLLIMPEXP_WEBKIT wxWebViewBeforeLoadEvent : public wxCommandEvent 223 196 {
Note: See TracChangeset
for help on using the changeset viewer.