Followup to r264531
https://bugs.webkit.org/show_bug.cgi?id=214488
<rdar://problem/64531754>
Reviewed by Darin Adler.
Source/WebCore:
Elide a null check by grabbing `RenderStyle` from the renderer instead of the element, and also limit
overflow hidden to the X axis.
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::completeManipulation):
Tools:
See WebCore ChangeLog for more details.
* TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@264556 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/editing/TextManipulationController.cpp b/Source/WebCore/editing/TextManipulationController.cpp
index 243b527..03a9d82 100644
--- a/Source/WebCore/editing/TextManipulationController.cpp
+++ b/Source/WebCore/editing/TextManipulationController.cpp
@@ -641,9 +641,11 @@
if (!box || !box->hasVisualOverflow())
continue;
- auto* style = element.renderStyle();
- if (style && style->width().isFixed() && style->height().isFixed() && !style->hasOutOfFlowPosition() && !style->hasClip())
- element.setInlineStyleProperty(CSSPropertyOverflow, CSSValueHidden);
+ auto& style = box->style();
+ if (style.width().isFixed() && style.height().isFixed() && !style.hasOutOfFlowPosition() && !style.hasClip()) {
+ element.setInlineStyleProperty(CSSPropertyOverflowX, CSSValueHidden);
+ element.setInlineStyleProperty(CSSPropertyOverflowY, CSSValueAuto);
+ }
}
}