Skip to content

Commit

Permalink
Cherry-pick bfc6efd. rdar://problem/113287677
Browse files Browse the repository at this point in the history
    REGRESSION: WebKit provides rectilinear selection rects for rotated text in images
    https://bugs.webkit.org/show_bug.cgi?id=259888
    rdar://113287677

    Reviewed by Wenson Hsieh.

    `EditorState::clipOwnedRectExtentsToNumericLimits` was erroneously converting some selection
    geometries from quads to rects.

    Fix by removing these conversions. Since `FloatQuad`s have no notion of validity, there is no
    need to clip them to numeric limits.

    * Source/WebKit/Shared/EditorState.cpp:
    (WebKit::EditorState::clipOwnedRectExtentsToNumericLimits):

    Canonical link: https://commits.webkit.org/265870.235@safari-7616-branch

Identifier: 265870.310@safari-7616.1.27.10-branch
  • Loading branch information
rr-codes authored and rjepstein committed Aug 8, 2023
1 parent 4798fb6 commit 02e340d
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions Source/WebKit/Shared/EditorState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,6 @@ void EditorState::clipOwnedRectExtentsToNumericLimits()
visualData.caretRectAtEnd = visualData.caretRectAtEnd.toRectWithExtentsClippedToNumericLimits();
visualData.markedTextCaretRectAtStart = visualData.markedTextCaretRectAtStart.toRectWithExtentsClippedToNumericLimits();
visualData.markedTextCaretRectAtEnd = visualData.markedTextCaretRectAtEnd.toRectWithExtentsClippedToNumericLimits();

auto sanitizeSelectionGeometryVector = [](auto& selectionGeometries) {
forEach(selectionGeometries, [](auto& selectionGeometry) {
selectionGeometry.setRect(selectionGeometry.rect().toRectWithExtentsClippedToNumericLimits());
});
};
sanitizeSelectionGeometryVector(visualData.selectionGeometries);
sanitizeSelectionGeometryVector(visualData.markedTextRects);
#endif
#if PLATFORM(IOS_FAMILY) || PLATFORM(GTK) || PLATFORM(WPE)
visualData.caretRectAtStart = visualData.caretRectAtStart.toRectWithExtentsClippedToNumericLimits();
Expand Down

0 comments on commit 02e340d

Please sign in to comment.