Changeset 243656 in webkit
- Timestamp:
- Mar 29, 2019, 1:09:02 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/selection/ios/hide-selection-in-textarea-with-transform-expected.txt (added)
-
LayoutTests/editing/selection/ios/hide-selection-in-textarea-with-transform.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayer.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243655 r243656 1 2019-03-29 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 REGRESSION (r243250): Text interactions are no longer suppressed when editing in some websites 4 https://bugs.webkit.org/show_bug.cgi?id=196378 5 <rdar://problem/49231299> 6 7 Reviewed by Simon Fraser. 8 9 Add a new layout test to exercise the scenario in which a transformed textarea is hidden inside an empty 10 overflow: hidden container. 11 12 * editing/selection/ios/hide-selection-in-textarea-with-transform-expected.txt: Added. 13 * editing/selection/ios/hide-selection-in-textarea-with-transform.html: Added. 14 1 15 2019-03-29 Alex Christensen <achristensen@webkit.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r243654 r243656 1 2019-03-29 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 REGRESSION (r243250): Text interactions are no longer suppressed when editing in some websites 4 https://bugs.webkit.org/show_bug.cgi?id=196378 5 <rdar://problem/49231299> 6 7 Reviewed by Simon Fraser. 8 9 Enabling async overflow scrolling by default in r243250 exposed an issue with hidden editable area detection 10 heuristics. Currently, an empty value for RenderLayer::selfClipRect is used to determine whether the layer 11 enclosing the editable element or form control is completely clipped by a parent (in other words, the clip rect 12 is empty). With async overflow scrolling, the enclosing layer of the editable element (as seen in the websites 13 affected by this bug) will now be a clipping root for painting, since it is composited. This means selfClipRect 14 returns a non-empty rect despite the layer being entirely clipped, which negates the heuristic. 15 16 To address this, we adjust the clipping heuristic to instead walk up the layer tree (crossing frame boundaries) 17 and look for enclosing ancestors with overflow clip. For each layer we find with an overflow clip, compute the 18 clip rect of the previous layer relative to the ancestor with overflow clip. If the clipping rect is empty, we 19 know that the layer is hidden. 20 21 This isn't a perfect strategy, since it may still report false negatives (reporting a layer as visible when it 22 is not) in some cases. One such edge case is a series of overflow hidden containers, nested in such a way that 23 each container is only partially clipped relative to its ancestor, but the deepest layer is completely clipped 24 relative to the topmost layer. However, this heuristic is relatively cheap (entailing a layer tree walk at 25 worst) and works for common use cases on the web without risking scenarios in which text selection that 26 shouldn't be suppressed ends up becoming suppressed. 27 28 Test: editing/selection/ios/hide-selection-in-textarea-with-transform.html 29 30 * rendering/RenderLayer.cpp: 31 (WebCore::RenderLayer::isTransparentOrFullyClippedRespectingParentFrames const): 32 1 33 2019-03-29 Takashi Komori <Takashi.Komori@sony.com> 2 34 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r243416 r243656 6649 6649 } 6650 6650 6651 for (auto* layer = this; layer; layer = enclosingFrameRenderLayer(*layer)) { 6652 if (layer->selfClipRect().isEmpty()) 6651 RenderLayer* enclosingClipLayer = nullptr; 6652 for (auto* layer = this; layer; layer = enclosingClipLayer ? enclosingClipLayer->parent() : enclosingFrameRenderLayer(*layer)) { 6653 enclosingClipLayer = layer->enclosingOverflowClipLayer(IncludeSelfOrNot::IncludeSelf); 6654 if (!enclosingClipLayer) 6655 continue; 6656 6657 LayoutRect layerBounds; 6658 ClipRect backgroundRect; 6659 ClipRect foregroundRect; 6660 layer->calculateRects({ enclosingClipLayer, TemporaryClipRects }, LayoutRect::infiniteRect(), layerBounds, backgroundRect, foregroundRect, layer->offsetFromAncestor(enclosingClipLayer)); 6661 if (backgroundRect.isEmpty()) 6653 6662 return true; 6654 6663 }
Note:
See TracChangeset
for help on using the changeset viewer.