Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 834e9831da4db3819ec6547aaba1f98b5bd89a32
      
https://github.com/WebKit/WebKit/commit/834e9831da4db3819ec6547aaba1f98b5bd89a32
  Author: Cathie Chen <[email protected]>
  Date:   2025-03-06 (Thu, 06 Mar 2025)

  Changed paths:
    A 
LayoutTests/editing/selection/ios/select-content-from-different-flow-001-expected.txt
    A 
LayoutTests/editing/selection/ios/select-content-from-different-flow-001.html
    A 
LayoutTests/editing/selection/ios/select-content-from-different-flow-002-expected.txt
    A 
LayoutTests/editing/selection/ios/select-content-from-different-flow-002.html
    A 
LayoutTests/editing/selection/ios/select-content-from-different-flow-003-expected.txt
    A 
LayoutTests/editing/selection/ios/select-content-from-different-flow-003.html
    A 
LayoutTests/editing/selection/ios/select-content-from-different-flow-004-expected.txt
    A 
LayoutTests/editing/selection/ios/select-content-from-different-flow-004.html
    A 
LayoutTests/editing/selection/ios/select-content-from-different-flow-005-expected.txt
    A 
LayoutTests/editing/selection/ios/select-content-from-different-flow-005.html
    M Source/WebCore/platform/ios/SelectionGeometry.h
    M Source/WebCore/rendering/RenderObject.cpp

  Log Message:
  -----------
  [iOS] The selection highlight boxes mess up when the content switch between 
inflow and out-of-flow
https://bugs.webkit.org/show_bug.cgi?id=269723

Reviewed by Wenson Hsieh.

In iOS, the selection highlight boxes are coalesced. But if the selected 
content switch between inflow and
out-of-flow, for instance, the content contains text with positioned ancestor 
and text from inflow,
the combined box could include unexpected area.
To fix this issue, we stop coalescing the highlight boxes of out-of-flow 
positioned content to others.

* 
LayoutTests/editing/selection/ios/select-content-from-different-flow-001-expected.txt:
 Added.
* 
LayoutTests/editing/selection/ios/select-content-from-different-flow-001.html: 
Added.
* 
LayoutTests/editing/selection/ios/select-content-from-different-flow-002-expected.txt:
 Added.
* 
LayoutTests/editing/selection/ios/select-content-from-different-flow-002.html: 
Added.
* 
LayoutTests/editing/selection/ios/select-content-from-different-flow-003-expected.txt:
 Added.
* 
LayoutTests/editing/selection/ios/select-content-from-different-flow-003.html: 
Added.
* 
LayoutTests/editing/selection/ios/select-content-from-different-flow-004-expected.txt:
 Added.
* 
LayoutTests/editing/selection/ios/select-content-from-different-flow-004.html: 
Added.
* 
LayoutTests/editing/selection/ios/select-content-from-different-flow-005-expected.txt:
 Added.
* 
LayoutTests/editing/selection/ios/select-content-from-different-flow-005.html: 
Added.
* Source/WebCore/platform/ios/SelectionGeometry.h:
(WebCore::SelectionGeometry::separateFromPreviousLine const): Return true if 
geometry requires to separate lines.
(WebCore::SelectionGeometry::setSeparateFromPreviousLine):
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::currentNodeRequiresToSeparateLines): Return true if current node is 
out-of-flow positioned.
(WebCore::hasAncestorRequiresToSeparateLines): Check if the node has an 
out-of-flow ancestor within the stayWithin subtree.
(WebCore::previousNodeRequiresToSeparateLines):
(WebCore::RenderObject::collectSelectionGeometriesInternal): Distinguish if 
current renderer and previous renderer
have switched between inflow and out-of-flow. If current renderer is 
positioned, or if the previous renderer
has a positioned ancestor, then they are in different flows. Do not coalesce 
lines that are not in same flow.

Canonical link: https://commits.webkit.org/291696@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to