Bug 261984
| Summary: | [Performance Optimization] Skip non-text SVG elements in Most{For/Back}wardCaretPosition | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | karlcow, rniwa, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar, Performance |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ahmad Saleem
Hi Team,
While going through Blink bug, I came across another potential issue, which we face as well and we are slow:
Test Case (Copy paste from crbug.com/822312):
1. Access website http://cwsdemo.hexagonusfederal.com/cwe
2. Click Open
3. Click Choose File
4. Browse to 5672-1.svg (attached)
5. Click open
6. Click Insert Item
7. Click Text
8. Click in map
9. "New Text" should be placed in the map
What is the expected behavior?
Immediate placement of default text.
What went wrong?
Depending on the size of the SVG file it takes seconds to minutes to place the text in the map with the last two official builds of Chrome.
___
Blink Commit: https://chromium.googlesource.com/chromium/src.git/+/8e793a18ec6358414ffc337b336c93d4f6061c91
GitHub WebKit Source: https://github.com/WebKit/WebKit/blob/main/Source/WebCore/dom/Position.cpp#L715 & https://github.com/WebKit/WebKit/blob/main/Source/WebCore/dom/Position.cpp#L823
__
Just wanted to raise so we can track and see if we can apply this optimization without any regression. Haven't tried fixing on my local build (Xcode 15 curse on macOS Ventura - waiting for Sonoma).
Thanks!
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/116261189>
Ahmad Saleem
Need two headers -
#include "SVGTextElement.h"
#include "SVGElementTypeHelpers.h"
and then following compiles:
if (currentNode.isSVGElement() && !is<SVGTextElement>(currentNode))
continue;
EWS
Committed 268699@main (13274cf68d90): <https://commits.webkit.org/268699@main>
Reviewed commits have been landed. Closing PR #18464 and removing active labels.