RESOLVED FIXED 204006
Add WebKit Legacy SPI to retrieve editable elements in rect
https://bugs.webkit.org/show_bug.cgi?id=204006
Summary Add WebKit Legacy SPI to retrieve editable elements in rect
Daniel Bates
Reported 2019-11-08 09:40:21 PST
Add WebKit Legacy SPI to retrieve editable elements in rect.
Attachments
Patch (12.29 KB, patch)
2019-11-08 10:36 PST, Daniel Bates
no flags
To Land (12.29 KB, patch)
2019-11-08 12:48 PST, Daniel Bates
no flags
Daniel Bates
Comment 1 2019-11-08 09:40:29 PST
Daniel Bates
Comment 2 2019-11-08 10:36:30 PST
Wenson Hsieh
Comment 3 2019-11-08 11:37:43 PST
Comment on attachment 383142 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383142&action=review > Source/WebCore/page/Page.cpp:940 > + auto node = nodesToSearch.takeFirst(); Nit - auto* > Source/WebKit/WebProcess/WebPage/WebPage.cpp:6696 > + auto contexts = m_page->editableElementsInRect(searchRect).map([this] (const auto& element) { Nit - I think we prefer just auto& over const auto&
Daniel Bates
Comment 4 2019-11-08 11:50:48 PST
Comment on attachment 383142 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383142&action=review Thanks for the review! >> Source/WebCore/page/Page.cpp:940 >> + auto node = nodesToSearch.takeFirst(); > > Nit - auto* Ok >> Source/WebKit/WebProcess/WebPage/WebPage.cpp:6696 >> + auto contexts = m_page->editableElementsInRect(searchRect).map([this] (const auto& element) { > > Nit - I think we prefer just auto& over const auto& The issue with this is that the compiler will not enforce the const-ness. I cannot envision a case where this code should ever mutate element right now and I am annotating the ref so the compiler can enforce this.
Daniel Bates
Comment 5 2019-11-08 12:41:40 PST
Comment on attachment 383142 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383142&action=review > Source/WebKit/WebProcess/WebPage/WebPage.cpp:6695 > Vector<WebCore::ElementContext> textInputContexts; This is unused.
Daniel Bates
Comment 6 2019-11-08 12:42:17 PST
Comment on attachment 383142 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383142&action=review >>> Source/WebKit/WebProcess/WebPage/WebPage.cpp:6696 >>> + auto contexts = m_page->editableElementsInRect(searchRect).map([this] (const auto& element) { >> >> Nit - I think we prefer just auto& over const auto& > > The issue with this is that the compiler will not enforce the const-ness. I cannot envision a case where this code should ever mutate element right now and I am annotating the ref so the compiler can enforce this. this => &
Daniel Bates
Comment 7 2019-11-08 12:45:13 PST
Comment on attachment 383142 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383142&action=review > Source/WebCore/page/Page.cpp:944 > + if (!is<Element>(*node) || !isEditableTextInputElement(downcast<Element>(*node))) { is<Element>(*node) => is<Element>(node)
Daniel Bates
Comment 8 2019-11-08 12:46:56 PST
Comment on attachment 383142 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383142&action=review > Source/WebCore/page/Page.cpp:918 > +static bool isEditableTextInputElement(Element& element) Element& => const Element& > Source/WebCore/page/Page.cpp:925 > + Will remove this empty line.
Daniel Bates
Comment 9 2019-11-08 12:48:11 PST
Daniel Bates
Comment 10 2019-11-08 12:50:15 PST
Note You need to log in before you can comment on or make changes to this bug.