Changeset 274305 in webkit
- Timestamp:
- Mar 11, 2021 3:55:40 PM (17 months ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
html/HTMLElement.cpp (modified) (2 diffs)
-
page/EventHandler.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r274301 r274305 1 2021-03-11 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [macOS] Selecting text via mouse drag in image documents shouldn't trigger click events 4 https://bugs.webkit.org/show_bug.cgi?id=223075 5 6 Reviewed by Tim Horton. 7 8 Improve image overlay support in image documents, by setting `-webkit-user-select: text;` on the image overlay 9 container and `cursor: text;` on each of the text children. Additionally, make it so that text selection in 10 image overlays doesn't trigger a click event, so that attempting to select text doesn't trigger click events. 11 12 * html/HTMLElement.cpp: 13 (WebCore::HTMLElement::updateWithImageExtractionResult): 14 * page/EventHandler.cpp: 15 (WebCore::EventHandler::updateSelectionForMouseDrag): 16 1 17 2021-03-11 Aditya Keerthi <akeerthi@apple.com> 2 18 -
trunk/Source/WebCore/html/HTMLElement.cpp
r274215 r274305 1281 1281 auto container = HTMLDivElement::create(document()); 1282 1282 container->setIdAttribute(imageOverlayElementIdentifier()); 1283 if (document().isImageDocument()) 1284 container->setInlineStyleProperty(CSSPropertyWebkitUserSelect, CSSValueText); 1283 1285 shadowRoot->appendChild(container); 1284 1286 … … 1313 1315 "scale("_s, scale.width(), ", "_s, scale.height(), ") "_s 1314 1316 )); 1317 1318 if (document().isImageDocument()) 1319 child->setInlineStyleProperty(CSSPropertyCursor, CSSValueText); 1315 1320 } 1316 1321 -
trunk/Source/WebCore/page/EventHandler.cpp
r274215 r274305 1000 1000 m_frame.selection().setSelectionByMouseIfDifferent(newSelection, m_frame.selection().granularity(), 1001 1001 FrameSelection::EndPointsAdjustmentMode::AdjustAtBidiBoundary); 1002 1003 if (newSelection.start().containerNode() && HTMLElement::isImageOverlayText(*newSelection.start().containerNode()) 1004 && newSelection.end().containerNode() && HTMLElement::isImageOverlayText(*newSelection.end().containerNode())) 1005 invalidateClick(); 1002 1006 } 1003 1007 #endif // ENABLE(DRAG_SUPPORT)
Note: See TracChangeset
for help on using the changeset viewer.