Bug 261180
| Summary: | Fix inconsistent LengthMode definition for 'textLength' | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | sabouhallawa, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ahmad Saleem
Hi Team,
While going through Blink's commit, I came across another potential merge and looked in Blink's latest source code and the length is still 'Width'.
Blink Commit - https://src.chromium.org/viewvc/blink?view=revision&revision=189707
WebKit Source - https://github.com/WebKit/WebKit/blob/94ce519cd2eaba3a1f2f4cb9753f40c98e9d9472/Source/WebCore/svg/SVGTextContentElement.cpp#L175
From changing:
m_textLength->setBaseValInternal(SVGLengthValue::construct(SVGLengthMode::Other
to
m_textLength->setBaseValInternal(SVGLengthValue::construct(SVGLengthMode::Width
___
Just raising so we can fix it.
Thanks!
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
Although this commit deleted other use: https://github.com/WebKit/WebKit/commit/4c53eb1e29f8c451411f0ef7f5f47d84adeb3118
Ahmad Saleem
Chromium Source: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/svg/svg_text_content_element.cc;l=67?q=SVGAnimatedTextLength
and
class SVGAnimatedTextLength final : public SVGAnimatedLength {
public:
SVGAnimatedTextLength(SVGTextContentElement* context_element)
: SVGAnimatedLength(context_element,
svg_names::kTextLengthAttr,
SVGLengthMode::kWidth, <----- HERE
SVGLength::Initial::kUnitlessZero) {}
Ahmad Saleem
We don't crash in --debug build on top of WebKit ToT and running this test via --debug flag.
Radar WebKit Bug Importer
<rdar://problem/115389551>
Said Abou-Hallawa
In WebKit we do not have inconsistency in the LengthMode when changing the baseVal of 'textLength'.
This is how we create the textLength in SVGTextContentElement:
Ref<SVGAnimatedLength> m_textLength { SVGAnimatedLength::create(this, SVGLengthMode::Other) };
And this is how we change its baseVal
m_textLength->setBaseValInternal(SVGLengthValue::construct(SVGLengthMode::Other, newValue, parseError, SVGLengthNegativeValuesMode::Forbid));
So the LengthMode is always SVGLengthMode::Other.
If you want to change the LengthMode to be SVGLengthMode::Width, please retitle this bug. Otherwise please close it.