RESOLVED FIXED 62500
Editing SVGs will cause assertions
https://bugs.webkit.org/show_bug.cgi?id=62500
Summary Editing SVGs will cause assertions
Nikolas Zimmermann
Reported 2011-06-11 01:08:55 PDT
Editing SVGs will cause assertions. Try the linked URL, which is an example given from Ryosuke on IRC. Play around with editing on, delete the "X", by placing the caret after the "X" and pressing <delete>. /Users/nzimmermann/Coding/WebKit/Source/WebCore/rendering/svg/SVGRenderSupport.cpp(75) : static void WebCore::SVGRenderSupport::mapLocalToContainer(const WebCore::RenderObject*, WebCore::RenderBoxModelObject*, bool, bool, WebCore::TransformState&) 1 WebCore::SVGRenderSupport::mapLocalToContainer(WebCore::RenderObject const*, WebCore::RenderBoxModelObject*, bool, bool, WebCore::TransformState&) 2 WebCore::RenderSVGText::mapLocalToContainer(WebCore::RenderBoxModelObject*, bool, bool, WebCore::TransformState&) const 3 WebCore::RenderObject::mapLocalToContainer(WebCore::RenderBoxModelObject*, bool, bool, WebCore::TransformState&) const 4 WebCore::RenderObject::localToAbsolute(WebCore::FloatPoint const&, bool, bool) const 5 WebCore::VisiblePosition::xOffsetForVerticalNavigation() const 6 WebCore::FrameSelection::xPosForVerticalArrowNavigation(WebCore::FrameSelection::EPositionType) 7 WebCore::FrameSelection::modify(WebCore::FrameSelection::EAlteration, WebCore::SelectionDirection, WebCore::TextGranularity, bool) 8 WebCore::TypingCommand::deleteKeyPressed(WebCore::TextGranularity, bool) 9 WebCore::TypingCommand::doApply() 10 WebCore::EditCommand::apply() 11 WebCore::TypingCommand::deleteKeyPressed(WebCore::Document*, unsigned int, WebCore::TextGranularity) 12 WebCore::Editor::deleteWithDirection(WebCore::SelectionDirection, WebCore::TextGranularity, bool, bool) 13 WebCore::executeDeleteBackward(WebCore::Frame*, WebCore::Event*, WebCore::EditorCommandSource, WTF::String const&) 14 WebCore::Editor::Command::execute(WTF::String const&, WebCore::Event*) const 15 WebCore::Editor::Command::execute(WebCore::Event*) const See the comment in VisiblePosition::xOffsetForVerticalNavigation: // This ignores transforms on purpose, for now. Vertical navigation is done // without consulting transforms, so that 'up' in transformed text is 'up' // relative to the text, not absolute 'up'. return renderer->localToAbsolute(localRect.location()).x(); Each call to localToAbsolute with useTransform=false, will cause an assertion for SVG. VisiblePosition nextLinePosition(const VisiblePosition &visiblePosition, int x) in visible_units.cpp is affected as well: // FIXME: Can be wrong for multi-column layout and with transforms. FloatPoint absPos = containingBlock->localToAbsolute(FloatPoint()); ... An important step towards supporting editing in SVG, is making editing work under CSS transforms perfectly. Everytime where localToAbsolute is called with useTrafos=false, there's a potential bug - it just needs a testcase that triggers the code with CSS transform used on the <div> that's edited, no SVG involved at all. Maybe Ryosuke can come up with some? :-)
Attachments
EWS
Comment 2 2022-12-10 16:27:21 PST
Committed 257691@main (99962e54b060): <https://commits.webkit.org/257691@main> Reviewed commits have been landed. Closing PR #7386 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2022-12-10 16:28:16 PST
Note You need to log in before you can comment on or make changes to this bug.