Summary: | Add WebKit Legacy SPI to retrieve editable elements in rect | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Daniel Bates <dbates> | ||||||
Component: | WebKit Misc. | Assignee: | Daniel Bates <dbates> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | thorton, webkit-bug-importer, wenson_hsieh | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Local Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Daniel Bates
2019-11-08 09:40:21 PST
Created attachment 383142 [details]
Patch
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& 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. 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. 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 => & 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) 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. Created attachment 383153 [details]
To Land
Committed r252254: <https://trac.webkit.org/changeset/252254> |